Summary
MrRobot,a Linux box is created by user ben, was a easy box.The Initial scan show that robots.txt
. which show the first key and fsocity.dic
and using that and username elliot
we get access to word-press,using which we can get a shell.Cracking the md5 hash we can su as robot
user and grab second key. Privilege Escalation was using nmap
suid binary we can get a shell as root.
Initial Scan
nmap scan
1 | # Nmap 7.80 scan initiated Thu Apr 30 21:55:50 2020 as: nmap -sC -sV -oN nmap/mrrobot 10.10.130.158 |
Manual Enumeration
Visiting http://10.10.130.158/robots.txt shows the first key path as key-1-of-3.txt
1 | User-agent: * |
WP-Login
Cracking the password with user elliot
(This was a guess based on the box name) we get the password as ER28-0652
Low Privilege Shell
Using the appearance we can change the code of any page so i edited 404.php
and placed a pentestmoney php-code to get a shell as demon
User
From the User robot
home directory we can see there is a password.raw-md5
which we can read
1 | daemon@linux:/home/robot$ cat password.raw-md5 |
Cracking the hash c3fcd3d76192e4007dfb496cca67e13b:abcdefghijklmnopqrstuvwxyz
using that we can su
as robot
and can read key-2-of-3.txt
1 | robot@linux:~$ cat key-2-of-3.txt |
Privilege Escalation
Lets run linpeas.sh
we see the kernel is vulnerable to exploit.
Lets try to see if we have some other easier way to Privilege Escalate.
we also see
1 | /usr/local/bin/nmap |
has SUID bit set lets check gtfobins to see how to get a shell using nmap
we see we can get a shell using
1 | TF=$(mktemp) |
but the nmap version installed doesn’t support –script but we see an interesting flag as --interactive
using which we can get a shell as root
1 | # uname -a;id;hostname |
and we can grab key-3-of-3.txt
as
1 | # cat key-3-of-3.txt |
And we have pwned this box.
Questions to Answer
What is key 1?
1
073403c8a58a1f80d943455fb30724b9
What is key 2?
1
822c73956184f694993bede3eb39f959
What is key 3?
1
04787ddef27c3dee1ee161b21670b4e4