Vegeta - Walkthrough [Vulnhub]
Here's my solution for Vegeta.
The Machine can be downloaded from here.
Nmap
Starting with nmap scanning for all TCP open ports.
nmap -sC -sV -p- 192.168.1.109

We find only two open ports.
Directory Scan


Using dirb for scanning the directories.
dirb http://192.168.1.109/

The robots.txt file, has an interesting entry.

Navigating to http://192.168.1.109/find_me, reveals find_me.php file.


Browsed CyberChef for decoding, after decoding for second time saved the output
as file.png, viewing the image shows a QR code.



Decoding QR Code
Browsed Zxing to decode.
After decoding we get a hint as- Password : topshellv


Created a list with these names, after playing around with this list.

dirb http://192.168.1.109 list -X .php

Finally found an interesting page http://192.168.1.109/b374k.php
Checking the source reveals a directory name.

Browsing http://192.168.1.109/bulma/, shows up .wav file.

Decoding Morse Code
After listening, it can be easily guessed that the sound is a Morse code.
Browsed MorseCode to decode.

We get the credential as
User: trunks
Password: u$3r

Privilege Escalation
Checking the permissions on /etc/passwd file, shows that we have read and write privileges.
ls -l /etc/passwd

On target machine, edit the /etc/passwd file and save it.
nano /etc/passwd

On target machine, now the passwd file, has an entry of the new root user.

Switching to new root user.
su rootuser
password: rootpass

To get the flag,
cd /root
cat root.txt
The Machine can be downloaded from here.
Nmap
Starting with nmap scanning for all TCP open ports.
nmap -sC -sV -p- 192.168.1.109

We find only two open ports.
Directory Scan
Just browsed the website, checked the source did not reveal much information.


Using dirb for scanning the directories.
dirb http://192.168.1.109/

The robots.txt file, has an interesting entry.

Navigating to http://192.168.1.109/find_me, reveals find_me.php file.

Browsing http://192.168.1.109/find_me/find_me.php and checking the source of the page,
shows double encoded base64 strings.

Browsed CyberChef for decoding, after decoding for second time saved the output
as file.png, viewing the image shows a QR code.



Decoding QR Code
Browsed Zxing to decode.
After decoding we get a hint as- Password : topshellv

Tried brute forcing on ssh did not worked, After a while searched for topshellv, landed on
http://www.topshellv.com/, which lists php shells.

Created a list with these names, after playing around with this list.

dirb http://192.168.1.109 list -X .php

Finally found an interesting page http://192.168.1.109/b374k.php
Checking the source reveals a directory name.

Browsing http://192.168.1.109/bulma/, shows up .wav file.

Decoding Morse Code
After listening, it can be easily guessed that the sound is a Morse code.
Browsed MorseCode to decode.

We get the credential as
User: trunks
Password: u$3r
Getting Access
ssh trunks@192.168.1.109
password: u$3r
Privilege Escalation
Checking the permissions on /etc/passwd file, shows that we have read and write privileges.
ls -l /etc/passwd

We create a new root user as- rootuser and password- rootpass
On our machine creating password for the new root user.
mkpasswd -m SHA-512 rootpass
On target machine, edit the /etc/passwd file and save it.
nano /etc/passwd

On target machine, now the passwd file, has an entry of the new root user.

Switching to new root user.
su rootuser
password: rootpass

To get the flag,
cd /root
cat root.txt

Comments
Post a Comment