Hackthebox - Hack the boo 2023 writeup
HauntMart
Category: web Rating: Easy
This challenge had a downloadable part , it was a web applicatio that allowed a user to register and login and add a product.
To get the flag we have to login as admin.
The is a /addAdmin route but it only accepts requests from localhost
|
|
I Tries using X-Forwarded-For headers but it didnt work.
If you look closer at the code there is a function to send a request to fetch the manual from a url.
This vulnerability is called ssrf (server side request forgery) check more »> here
|
|
There is also a poor attempt of a filter for the url
|
|
We can easily bypass this , there are many routed to localhost other that the ones listed there. You can check them out »> here
For me this one worked:
NOTE: you can get the port that the app is listenig from in therun.py , we have to make a request to /api/addAdmin to make our user admin
|
|
We get the flag as : HTB{A11_55RF_5C4rY_p4tch_3m_411!}