Page cover

HTB-Forge: Double SSRF to Root Breaking Forge from the Inside Out 🧨

Just finished cracking HTB: Forge, and it turned out to be a slick lesson in chaining internal trust, redirection logic, and misconfigurations. A simple redirect opened the door, and an internal service’s blind trust in itself handed me the keys. This post takes you through the full chain—from initial recon to full root. 🔐


Recon: Nmap to the Rescue 🔍

Kicked things off with a full port scan:

Start with a full port scan:

Results

Observations 📌

  • Port 21 is behind a firewall.

  • Port 80 is hosting a web application that redirects to http://forge.htb.

When navigating the site, clicking on images gives URLs like:

The presence of a /static/ path hints at an MVC-style framework.


Subdomain Discovery

Running a subdomain fuzz revealed:


Exploitation: SSRF + Redirect = Win

  • The application followed redirects on user-submitted URLs. So, I spun up a Flask server to exploit that behavior:

  • this had an upload and announcements

Visiting /announcements on this subdomain displayed:


Shell Time

Once I had the key:

Boom. User shell obtained.


Privilege Escalation: Debug Mode Exploit

Found this script at /opt/remote-manage.py:

If the script fails, it invokes pdb—a Python debugger. With two simultaneous sessions, I triggered it to drop into interactive mode.

Then, I popped a shell:

Rooted.

Last updated