Grotesque 1

Grotesque:1.0.1

一、基本信息

名称:Grotesque:1.0.1

发布日期:2021.3.10

作者:tasiyanci

系列:Grotesque

推特:@tasiyanci

二、靶机简介

Flags:

raphael://user.txt
root:/
/root.txt

难度:中等

三、文件信息

文件名:grotesque_vh-1.0.1.ova

文件大小:672MB

下载地址:

MD5: 7E73878BDB1251D1DADC4CC49F5BAD68

SHA1: 778CF0A9721E530587C78DD198039297C7BB16AB

四、镜像信息

格式:Virtual Machine (Virtualbox - OVA)

操作系统:Linux(debain)

五、网络信息

DHCP服务:可用

IP地址:自动分配

六、环境配置

1.将靶机grotesque和攻击机kali2021在VirtualBox下设置为仅主机模式,使用DHCP分配ip地址:

image-

七、攻略步骤

信息探测

1.因为是没有直接告知我们靶机ip的,所以要先进行主机探测,先查看下kali分配到的ip,在进行网段扫描,命令如下,得到靶机ip为192.168.56.102:

1
ifconfig,查看kali分配到的ip

image-

1
nmap -sP 192.168.56.0/24,扫描靶机ip

image-

2.再进行端口扫描,发现只开放了66和80端口,而主页并没有东西:

1
nmap -T4 -sC -sV -p- --min-rate=1000 192.168.56.108 | tee nmapscan,端口扫描

image-

image-

3.最后再进行一下目录扫描,发现只有/javascript,也无法直接查看:

1
gobuster dir -u http://192.168.56.108/ -x html,php,bak,txt --wordlist /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt,目录扫描

image-

端口指向发现

1.访问一下192.168.56.108:66页面,vvmlist.github.io,页面提示我们去下载这个项目,而在源码我们发现了一组很像brainfuck编码的注释:

image-

2.brainfuck解码出来指向/sshpasswd.png,同时我们下载下vvmlist这个项目,解压后很快就能发现这张图片:

image-

image-

3.利用多种工具分析sshpasswd.png没有分析出来,但靶机也没有开放22端口无法ssh登录,所以转向查看vvmlist中的其他文件,按照操作时间,我们可以发现80端口真正的指向,而且很可能是使用wordpress搭建的:

1
cat _vvmlist/* | sort | uniq

image-

image-

Wordpress后台登录

1.访问192.168.56.108/lyricsblog,查看源码,我们会发现一张图片地址,查看图片,没有太多线索:

image-

image-

2.前面提到了这个页面是wordpress搭建的,我们使用wpscan扫描一下,也没有太多发现:

1
wpscan --url http://grotesqueip/lyricsblog -e ap,cb,dbe,u1-999 --plugins-detection aggressive --plugins-version-detection aggressive

image-

3.说句实话,思路到这里就断掉了,后来通过维基,发现/lyricsblog页都是歌曲的歌词,然后yesman.png又提示他喜欢听hakan-tasiyan-doktor,我们尝试把这首歌的歌词全部获取下来md5然后大写一下,发现就是可以登录wordpress后台的密码,用户名是erdalkomurcu,页面有显示:

1
2
vim doctor-lyrics.txt,写入歌词
md5sum doctor-lyrics.txt

image-

image-

4.访问192.168.56.108/lyricsblog/wp-admin,提示密码要大写,我们登录看看:

image-

image-

Wordpress后台写入webshell,准备提权

1.在wordpress后台Appearance页Theme Editor,在404.php(my favorite)内粘贴kali自带的webshell,/usr/share/webshells/php/php-reverse-shell.php,并在kali开启对应端口监听,通过访问
http://192.168.56.108/lyricsblog/index.php/author/erdalkomurcu/1触发webshell:

image-

image-

2.通过查看/var/www/html/lyricsblog/wp-config.php,能够得到raphael用户及密码,登录一下试试:

image-

image-

3.用python建立一个交互式shell,可以发现user.txt是一串类似md5值,但是解不出来;在发现有一个.kdbx文件,应该是root的密钥库文件,获取到kali:

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

image-

1
python3 -m http.server 8001

image-

image-

4.对.chadroot.kdbx使用keepass2john进行解密,这里要用到rockyou.txt,下载地址为https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt:

image-

image-

root提权

1.获取到密码,利用app.keeweb.info,上传chadroot.kdbx,可以获得root密码:

image-

2.在/root页下获得flag,即root.txt:

image-