Sar - Walkthrough [Vulnhub]
Here's my solution for Sar.
The machine can be downloaded from here.
Nmap
Scanning for all TCP ports.
nmap -sC -sV -p- 192.168.1.111
Scanning for all TCP ports.
nmap -sC -sV -p- 192.168.1.111

We find only 1 open port.
Directory Scan
Browsing the web and checking the source, we did not find any hint.

Using dirb to scan for directories.
dirb http://192.168.1.111

We find an interesting entry in /robots.txt file.

Lets browse /sar2HTML.

We found an exploit, and we get this 47204.txt.

What does the exploit says-

The paramter- plot= , is vulnerable to code execution.

Getting Access
Now we upload a php reverse shell file.




We also give full permission to the file- ;chmod 777 shell.php
To run the exploit, we browse 192.168.1.111/sar2HTML/shell.php
and on the other hand we start the netcat listener.


We get the reverse shell.
User Flag.

Privilege Escalation
We find cron jobs , which runs in every 5 minutes.

We see that, finally.sh will execute the file- write.sh and we have full permission on write.sh

Now we encode the payload in base64 and place it in file- write.sh and on other hand we start the netcat listener.


We wait for 5 minutes and we have a shell.

Root Flag.
Comments
Post a Comment