1、发现靶机IP
arp-scan -l
![](https://img-blog.csdnimg.cn/img_convert/b7a986827bb543a18c1a98b653fb24eb.png)
根据mac地址可确认靶机IP为10.10.10.143
2、发现端口
nmap -p- -sS -sV -T4 10.10.10.143
![](https://img-blog.csdnimg.cn/img_convert/a696d207d1294a08b6d88f8aec52ba92.png)
访问3128,无法访问,将10.10.10.143:3128作为代理服务器,即可访问8080端口(我暂时还未理解为什么要这么做,先跟着操作,做的多了,慢慢就熟悉了)
![](https://img-blog.csdnimg.cn/img_convert/be7deb1cc4ac4f1bb4b150677d927c12.png)
3、设置代理
我这里使用火狐的插件FoxyProxy Standard(挺好用的)
![](https://img-blog.csdnimg.cn/img_convert/2b62744fbdde4466bda9baf39e124fa8.png)
这时候发现80端口也是可以访问的
![](https://img-blog.csdnimg.cn/img_convert/59083f20bc6747abbe2dcbb781290bd9.png)
4、爆破目录
dirb挂代理的方法为-p
![](https://img-blog.csdnimg.cn/img_convert/5849d631021340ab8eadd37bc4423544.png)
dirb http://10.10.10.143/ -p http://10.10.10.143:3128 | grep 200
我这里过滤了200的,其实所有的响应码都应该被关注
![](https://img-blog.csdnimg.cn/img_convert/1d5a76645bb6406593d3d81d07d52fc4.png)
访问http://10.10.10.143/robots.txt
一般情况下robot相关的目录都是需要访问一下的
![](https://img-blog.csdnimg.cn/img_convert/313a738a7ab243d8a89b79fbae2df200.png)
![](https://img-blog.csdnimg.cn/img_convert/ced39c892fb44d309a77de632a818222.png)
查找与wolfcms相关的漏洞
searchsploit wolf
这里使用36818.php这个poc
![](https://img-blog.csdnimg.cn/img_convert/263355a529f04d73836aa28af4e96548.png)
searchsploit -m php/webapps/36818.php
将poc拷贝到当前目录,方便查看
![](https://img-blog.csdnimg.cn/img_convert/a1d5acf53f67490fa6f6bcda8e4e6187.png)
6、发现后台
查看php文件发现后台路径
http://10.10.10.143/wolfcms/?/admin
![](https://img-blog.csdnimg.cn/img_convert/d88e3ef951534eaa878e28a7160bb928.png)
访问
![](https://img-blog.csdnimg.cn/img_convert/6a8e7393c71d43659f1824a4d47b8cce.png)
尝试弱口令admin/admin
![](https://img-blog.csdnimg.cn/img_convert/18096832a2bb45cba1b9ad9d1ee45d57.png)
找到上传路径的位置
![](https://img-blog.csdnimg.cn/img_convert/b222237c98124a3da1ede3276a935ff3.png)
7、利用文件上传漏洞获取shell
利用kali自带的木马文件php-reverse-shell.php
![](https://img-blog.csdnimg.cn/img_convert/03ed02dff31c4d0a8753e4132dc56967.png)
编辑木马文件,将目标IP改为kali的IP
![](https://img-blog.csdnimg.cn/img_convert/2acfe5fb35fe4bd4970e4aee097f57d1.png)
将文件上传至靶机上
![](https://img-blog.csdnimg.cn/img_convert/f1298ecbfce6451b89b175419e1ef173.png)
访问文件,可以看到文件路径为http://10.10.10.143/wolfcms/public/php-reverse-shell.php
![](https://img-blog.csdnimg.cn/img_convert/5e101cb3629142a986f418a827f61ba1.png)
kali开启1234端口监听,访问木马路径,可以发现shell已经反弹回来
![](https://img-blog.csdnimg.cn/img_convert/88e6a40c332e4154a0e7a0caabab985f.png)
建立交互式shell
python -c 'import pty;pty.spawn("/bin/bash")'
![](https://img-blog.csdnimg.cn/img_convert/defdfc378b3648659cbfb32a3f19368f.png)
8、提权
查看配置信息
find / -name *config.php 2</dev/null
root
john@123
![](https://img-blog.csdnimg.cn/img_convert/ceb6d38aea7348988258e9c5333a5686.png)
直接转换为root用户失败,查看用户情况
![](https://img-blog.csdnimg.cn/img_convert/6b1f3625ab234bac8abb1f6f80e8344d.png)
这个方法更好用,过滤用户情况cat -n /etc/passwd | grep home
![](https://img-blog.csdnimg.cn/img_convert/e1661d7663b04dda95666d36907eed57.png)
su sickos
![](https://img-blog.csdnimg.cn/img_convert/738fc221fdb6401b8e69676695e46489.png)
sudo su root
![](https://img-blog.csdnimg.cn/img_convert/4de1803ac86a46458f3db1c6afd6921e.png)