boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources
boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources

SSRF

Server-Side Request Forgery (SSRF): abusing a parameter that makes the server fetch a URL, so the request comes from the server instead of from us. This covers how to spot it, how to craft a payload, the common defences, and a practice scenario on the Acme IT Support site.

For example, say we want to modify the address a web server fetches, https://website.thm/item/2?server=, so it returns data from https://server.website.thm/flag?id=9.

We type our desired website with a slight modification, adding &x= after 9, and we remove https:// after server=, ending up with this:

Take note of Server Requesting. We injected our website for the server to execute our request.

Where to Look

Potential SSRF vulnerabilities show up in web applications in many ways. Four common places to look:

When a full URL is used in a parameter in the address bar

A Hidden Field in a Form

A Partial URL Such as Just the Hostname

Or Perhaps Only the Path of the URL

Some of these are easier to exploit than others, and finding a working payload takes a lot of trial and error.

With a blind SSRF where no output is reflected back, you need an external HTTP logging tool to watch for requests, such as requestbin.com, your own HTTP server, or Burp Suite's Collaborator client.

Remedies

More security-savvy developers may add checks so the requested resource must meet specific rules. There are usually two approaches: a deny list or an allow list.

Deny List

A deny list accepts all requests except resources named in a list or matching a pattern. A web application may use one to protect sensitive endpoints, IP addresses, or domains from the public while still allowing access elsewhere. A common endpoint to restrict is localhost, which may hold server performance data or other sensitive information, so names like localhost and 127.0.0.1 would appear on a deny list.

Attackers can bypass a deny list with alternative localhost references such as 0, 0.0.0.0, 0000, 127.1, 127.*.*.*, 2130706433, 017700000001, or subdomains with a DNS record resolving to 127.0.0.1 such as 127.0.0.1.nip.io.

In a cloud environment it also helps to block 169.254.169.254, which holds metadata for the deployed cloud server, possibly including sensitive information. An attacker can bypass this by registering a subdomain on their own domain with a DNS record pointing to 169.254.169.254.

Allow List

An allow list denies every request unless it appears on a list or matches a pattern, such as a rule that a URL in a parameter must begin with https://website.thm. An attacker could sidestep this by creating a subdomain on their own domain, such as https://website.thm.attackers-domain.thm. The application logic would allow this input and let the attacker control the internal HTTP request.

Open Redirect

If the above bypasses fail, there is one more trick: the open redirect. An open redirect is a server endpoint that automatically redirects the visitor to another address. Take the link https://website.thm/link?url=https://tryhackme.com, created to count clicks for advertising. If an SSRF had stringent rules only allowing URLs beginning with https://website.thm/, an attacker could use this feature to redirect the internal HTTP request to a domain of their choice.

Practice with Scenario

Let's test this in a fictional scenario. During a content discovery exercise against the Acme IT Support website we found two new endpoints. The first, /private, returns an error saying its contents can't be viewed from our IP address. The second is a new version of the customer account page at /customers/new-account-page, with a feature letting customers choose an avatar.

Click the Start Machine button to launch the Acme IT Support website. Once it's running, visit https://10-10-231-193.p.thmlabs.com and follow the instructions to get the flag.

First, create a customer account and sign in. Then visit https://10-10-231-193.p.thmlabs.com/customers/new-account-page to see the new avatar selection feature. Viewing the page source of the avatar form, the avatar form field value contains the path to the image. The background-image style on the DIV element confirms this, as in the screenshot below:

Choose an avatar and click Update Avatar, and the form changes to display your currently selected avatar above it. The page source shows the current avatar is displayed using the data URI scheme, with the image content base64 encoded, as below:

Now try the request again but change the avatar value to private, hoping the server will access the resource and get past the IP address block. Right-click one of the radio buttons on the avatar form and select Inspect:

And then edit the value of the radio button to private

Then click Update Avatar. Unfortunately the application has a deny list and blocks access to the /private endpoint.

The error message says the path cannot start with /private, but we still have a trick: a directory traversal to reach the endpoint. Try setting the avatar value to x/../private.

We've now bypassed the rule and the avatar updated. The trick works because when the web server receives the request for x/../private, it reads the ../ as "move up a directory", which translates the request back to just /private.

Viewing the page source of the avatar form, the currently set avatar now holds the contents from the /private directory in base64. Decode it and it reveals a flag you can enter below.