HackTheBox: Popcorn
Welcome back Guys to another writeup on Hack the Box, machine named POPCORN.
So Lets start with Network Mapper (NMap scan). *This time I wont share complete output just the required content would be shared here.
So now lets check the web portal as port 80 is working.
So after seeing the webpage we should see which web directories are available for this web portal. So lets use Dirbuster for directory bruteforcing.
While the attack was going on I encountered an file named torrent.
So lets check the webpage
So encountering this webpage signup and login in the webpage and checkout all the possible tabs in this webpage.
Researching through got to know about Browse tab and upload tab, uploaded content is torrent file of kali linux and in upload tab we can upload torrent files.
So lets upload any torrent file and see what can be done to get remote code execution/reverse shell from this page.
So this is how was the response and then we would go to edit this torrent option for uploading our php reverse shell.php to get reverse shell.
Before submitting start the burpsuite and intercept the request, remember to change Content-Type: application/x-php to Content-Type: image/png.
After that you would get a notification on screen that screenshot has been updated, and we can refresh to see it.
As we refresh on torrent page it shows no image file, so navigate the web url to http://10.10.10.6/torrent/upload/ .
After you see the uploaded php file start the listener on the port number mentioned in shell.php, and click on the php file in upload directory to get the reverse shell.
Here now you could find the user.txt, for root.txt we have to do the privileage escalation. For that lets try the tool for linux exploit suggester named les.sh
To send this file start a http.server on your local computer
After this check the ifconfig tun0 IP address and search that on browser url and search the les.sh file, copy the link and victim's reverse shell we got before and use wget command.
Hmm, so we cant write in user's profile so lets change the directory to /tmp, and try again.
Now firstly we have to change the mode of the file les.sh, for this try using chmod +x les.sh and the execute the command ./les.sh.
The list goes on with the vulnerabilities for this machine, we have to chose, try and execute.
This vulnerability was listed on 1st number so trying this would be better. Link for the execution and helping hand is provided already on the link mentioned in the details.
Get the file using command wget on your local file, and then use same command on victim pc for downloading on their machine. remember to keep http.server on for this file transfers.
Thats it!! Please write us to know any detailing.
Comments
Post a Comment