靶机地址:Web Machine(N7)
渗透过程:
kali ip:192.168.56.104,靶机ip,使用arp-scan进行查看
![](https://img-blog.csdnimg.cn/img_convert/7c91d03499354595a39891fe4039424d.png)
靶机地址:192.168.56.128
收集靶机开放端口:nmap -sS -sV -T5 -A 192.168.56.128
![](https://img-blog.csdnimg.cn/img_convert/b6eb6fc34b02430a8ac0728343473c9a.png)
开放了80端口,进入web界面信息收集,并没有什么收获
![](https://img-blog.csdnimg.cn/img_convert/07cfea63671e48b8bfc35c69daeccfb8.png)
随便点点,啥玩意都没得,那就只能目录爆破了,用dirsearch,第一遍啥都没爆出来,后面换了个字典,爆出来了点东西
![](https://img-blog.csdnimg.cn/img_convert/a66eaa352ad84894b82fe1df60f27a2a.png)
![](https://img-blog.csdnimg.cn/img_convert/b008069dda5f47298d3abf3da1818114.png)
输入exploit.html发现了上传文件功能,查看源代码,发现了提示,随便上传一个看看
![](https://img-blog.csdnimg.cn/img_convert/18c9695753d8468ba43c21a59f4f97f8.png)
![](https://img-blog.csdnimg.cn/img_convert/d9e4160113ae45748ddbeb54586b97c0.png)
返回了localhost,这边把地址改为靶机地址
![](https://img-blog.csdnimg.cn/img_convert/d21979b72b7a45fa8602e3b71a10085e.png)
![](https://img-blog.csdnimg.cn/img_convert/64d13e3ae4204a569d31b689315d57e9.png)
输入后,出现了半个flag
![](https://img-blog.csdnimg.cn/img_convert/a952480935c3433887d4bf39c14b1ef3.png)
输入另一个路径,发现了登录框,尝试弱口令没什么用,抓包发现,cookie中存在role,这个%253D是经过两次url编码后出现了,所以这边,利用Decoder两次解码,发现了个32位字符串,应该是MD5
![](https://img-blog.csdnimg.cn/img_convert/54152429fd474968ade3004e1de57e4e.png)
![](https://img-blog.csdnimg.cn/img_convert/3c66bfea7eb64b459f940f418c699e2a.png)
![](https://img-blog.csdnimg.cn/img_convert/19fe6ac52b2648f6b886b788b231b0ef.png)
利用md5解密后,是admin,证明role是admin
![](https://img-blog.csdnimg.cn/img_convert/32ad497de2c54982b9d43317fccf86db.png)
那就应该存在一个admin的页面,这边尝试输入个admin.php发现,他说这个接口是admin所有
![](https://img-blog.csdnimg.cn/img_convert/1f70a382b97d475abfe1e3b4ff2a0c0f.png)
下面对这个页面进行抓包,然后发到Repeater里
![](https://img-blog.csdnimg.cn/img_convert/bfd6bcdd3f154aff80e45b04977a0396.png)
将role改为admin,这边返回了flag的后半部分
![](https://img-blog.csdnimg.cn/img_convert/a3735739096f411db23bc11a83f243e8.png)
![](https://img-blog.csdnimg.cn/img_convert/9dd08511181341768bf7e4fcf942bc6a.png)
这样就得到了全部的flag{N7:KSA_01}
另一种方法:
对于这个登录框,可能还存在sql注入,将登录框的包保存到一个文件夹中
![](https://img-blog.csdnimg.cn/img_convert/27a86eb53ef240ea8e9684fe6b0f523a.png)
![](https://img-blog.csdnimg.cn/img_convert/6fb6f0b6f2374de19d007259ded20254.png)
利用sqlmap进行爆破,果不其然爆出了数据库
![](https://img-blog.csdnimg.cn/img_convert/fe8fadb7052c4d4fb13c835e9a74f4db.png)
![](https://img-blog.csdnimg.cn/img_convert/23b3eafd11294451a985e4355fb62eb2.png)
进一步爆破表,发现了login表
![](https://img-blog.csdnimg.cn/img_convert/e3a7e6c311704924b34942075e154c1c.png)
最后取表中数据
![](https://img-blog.csdnimg.cn/img_convert/de2a43c6e95b4b5988ef34667a916ffc.png)
将flag取出
![](https://img-blog.csdnimg.cn/img_convert/e82c6207a1964119b4146352565d8fc2.png)
本次渗透结束!希望能帮助有需要的同学!
一起学习,一起进步!