We Start with scaning with Nmap
There's port 80 open if we go to URL on browser we will saw website with source download.
We can do a little bit recon with git command to see what we can get.
as we can see we saw an username password on it.
Now take look in app/app/ there is a view.py file that the one store the functions.
when we look in file_url=request.host_url + "uploads/" +file_name
it have path traversal in upload page if we intercept it in burpsuite.
We can perform path traversal with url-encode this string ..//..//..//..//..//etc/passwd
We will got this when click on file in /upload.
After this i try to add another app.route to get reverse shell by add this line of code in view.py
After add this code in view.py i try to upload in 10.10.11.164/upload and intercept in burp to change filename"..//app/app/views.py" and we success uploaded our views.py file
To get reverse shell on our terminal i use https://www.revshells.com
Open our browser to http://10.10.11.164/kira?cmd= and past the reverse shell after cmd=
As we see in Nmap there an port 8000 has been filltered. but now we can have shell as root in container. so there an tool name chisel can relay the traffic with sigle file execute. we need to upload it in to HTB server using wget. then follow my command.
On attacker machine
On victim machine
When we access our local:3000 on browser we will get gitea panel, we can login it with credentials we found in recon is dev01:Soulless_Developer#2022.
we got id_rsa key to access ssh to get user.txt flag by command :
After we need to bypass to root user to get another flag, we can use linPEAS or pspy by upload it to ssh server of victim.
We will rooted the machine!!!!
dev01@opensource:/tmp$ cat /tmp/tmp.txt 1e******************a dev01@opensource:/tmp$
0 Comments