Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 38 ยท Common Vulnerability Workflows

SSRF and Out-of-Band Testing with Collaborator

Understand server-side request forgery and blind vulnerabilities, how Burp Collaborator detects out-of-band interactions, and how to validate URLs safely with a Python model.

Some vulnerabilities leave no trace in the response you can see. You send a request, the server does something dangerous in the background, and the page looks perfectly normal. Blind bugs like this need a different detection method: make the server contact you, and watch for the contact. In Burp that is the job of Burp Collaborator. This lesson covers the idea, the most important bug it detects (server-side request forgery, SSRF), and how to defend against it.

Burp and Collaborator are not available in the browser here, so the screens are labelled example output. The Python blocks are offline stand-ins that need no network.

Only test systems you are authorised to test. Collaborator sends and receives network traffic through PortSwigger's public service (or your own private server), so do not include real customer data in payloads, and never point SSRF tests at internal systems that were not in scope.

What is SSRF?

Many features make the server fetch a URL that the user supplies: import from URL, webhook tests, link previews, PDF generators, image proxies, avatar-from-URL. If the server fetches whatever URL it is given, an attacker may make it request something the attacker cannot reach directly:

  • Internal services on the private network (admin panels, databases' HTTP interfaces).
  • The cloud metadata endpoint (169.254.169.254), which can expose credentials on cloud hosts.
  • Localhost-only administration ports on the server itself.
  • Files, through non-HTTP schemes like file: if the library allows them.

The server acts as a confused deputy: it has network privileges the user lacks, and it lends them out.

flowchart LR
  U["User sends<br/>url=http://internal/admin"] --> S["Web server<br/>(in the DMZ)"]
  S -->|"fetches the URL"| I["Internal service<br/>(not reachable from internet)"]
  I -->|"response"| S
  S -->|"returns or leaks content"| U

The user never talks to the internal service; the server does it for them.

Burp Collaborator in plain words

Collaborator is a server run on the internet (by PortSwigger by default, or privately by you) that answers on a unique, random domain name and records every interaction: DNS lookups, HTTP requests, SMTP mail. The workflow:

  1. Burp generates a payload such as x7k3q9.oastify.com, unique to this test.
  2. You put it into an input: a URL parameter, a header, an XML entity, an email address.
  3. If the target (or something behind it) resolves or fetches that name, Collaborator records the interaction.
  4. Burp polls Collaborator and shows the interaction with time, type and source address.

An interaction proves the server made a network request influenced by your input, even when the page output shows nothing. That is called an out-of-band (OAST) finding.

TEXT
Example (labelled): Collaborator client
#  Time      Type  Payload             Source IP
1  10:41:07  DNS   x7k3q9.oastify.com  203.0.113.55
2  10:41:07  HTTP  x7k3q9.oastify.com  203.0.113.55   GET / (User-Agent: python-requests/2.31)
Conclusion: the server resolves and fetches the supplied URL -> SSRF candidate

The Scanner uses Collaborator automatically for checks such as SSRF, blind SQL injection, blind XSS, XXE and some injection into logging or email systems. You can also use it by hand: Burp menu, Collaborator client, Copy to clipboard, then paste into Repeater.

Where to place payloads

  • Any parameter that looks like a URL (url=, redirect=, callback=, webhook=, image=).
  • Headers: Referer, X-Forwarded-Host, Host (host-header issues), X-Forwarded-For.
  • Body formats that resolve names: XML (external entities), SVG and document uploads, JSON with URL fields.
  • Email fields that trigger a message (SMTP interaction).

Testing workflow

  1. Identify features that fetch URLs.
  2. Probe with a Collaborator domain and check for DNS/HTTP interaction. This confirms the server-side fetch.
  3. Classify: is it full SSRF (the response is returned to you) or blind (only interaction)?
  4. In a lab or explicitly in-scope environment, check what the fetcher would be allowed to reach: only your own approved internal test host, and which schemes are accepted (http, https; anything else is a red flag).
  5. Stop at proof of the reachable behaviour; do not probe internal ranges outside scope, and never retrieve cloud credentials from a real environment.

A safe URL validator model

Defending is the most useful thing to learn. The model below shows why naive checks fail and what a stricter check looks like. It uses only string and IP logic; no network access is performed.

Python Naive versus strict URL validation (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the naive prefix check accepts the images.example.test.evil.example host. The strict version checks the scheme, rejects embedded credentials, requires an exact host, and checks the resolved address, so an allowed name pointing to 127.0.0.1 is refused.

Other blind issue classes Collaborator finds

Issue Interaction seen
Blind SSRF DNS plus HTTP from the app server
Blind SQL injection (OAST) DNS lookup triggered by a database function
Blind XXE DNS/HTTP when an external entity is resolved
Blind XSS HTTP from an admin's browser later viewing stored input
Email header injection SMTP interaction
Log injection / log4j-style DNS from a logging library

Fixes for SSRF

  1. Prefer not fetching user URLs; if needed, accept a choice from a list, not a free URL.
  2. Use an allow-list of hosts and schemes, validate after URL parsing, and re-check after redirects (disable redirects or revalidate each hop).
  3. Resolve DNS yourself and connect to the validated IP, to defeat rebinding.
  4. Block private, loopback and link-local ranges; require IMDSv2 and hop limits on cloud metadata.
  5. Run fetchers in a network-isolated environment with no route to internal services.
  6. Do not return raw responses to the user.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is SSRF?

    SSRF makes the server fetch attacker-chosen URLs, abusing its network position.
  2. 2. What does Burp Collaborator detect?

    It records interactions with unique payload domains, revealing blind issues.
  3. 3. Why is a prefix check like startswith('https://images.example.test') unsafe?

    String-prefix tests do not parse the host; attackers register look-alike names.
  4. 4. Which is a strong SSRF defence?

    Exact allow-lists and resolved-address checks stop most abuse, including rebinding.
  5. 5. A page shows nothing odd but Collaborator logs a DNS lookup from the server. What is this?

    An out-of-band interaction proves the server acted on your input even without visible output.

Summary

  • SSRF turns the server into a proxy for the attacker; internal services and cloud metadata are the usual targets.
  • Collaborator generates unique domains and records DNS, HTTP and SMTP interactions to find blind issues.
  • Test URL-like inputs and headers, classify full versus blind, and stay within scope.
  • Defend with allow-lists, resolved-IP checks, redirect control, network isolation and metadata hardening.
  • The Collaborator output is labelled example; the Python validator is an offline stand-in.

Next: Writing findings and severity ratings