githubEdit

SSRF

Manipulate a web application into making requests to arbitrary URLs from the server.


URL Schemes

Scheme
Use Case

http:// / https://

Access internal endpoints, bypass WAFs

file://

Read local files (LFI)

gopher://

Send arbitrary bytes (POST requests, DB queries)


Confirm SSRF

# Start listener
nc -lnvp 8000

# Inject your URL in vulnerable parameter
http://YOUR_IP:8000/ssrf

If you receive a connection, SSRF is confirmed.


Internal Port Scan

Generate Ports Wordlist

Fuzz Open Ports


Enumerate Internal Endpoints


Local File Inclusion via SSRF


Gopher Protocol (Send POST Requests)

Use gopher to send arbitrary HTTP requests (e.g., POST with body).

Manual Gopher URL

Note: URL-encode the gopher URL twice when injecting into a POST parameter.

Gopherus (Generate Gopher URLs)


Blind SSRF

No response reflected, but can still:

  • Port scan (different error messages for open/closed)

  • Enumerate files (different errors for existing/non-existing)

  • Send payloads to internal services blindly

Detect Open Ports (Blind)

Look for different error messages:

  • Closed port: Something went wrong!

  • Open port: Date unavailable (or different error)


SSRF Bypass Techniques

Localhost Alternatives

URL Encoding

Double URL Encoding

Decimal IP

Hex IP

DNS Rebinding

Point a domain to internal IP after initial DNS check passes.


Cloud Metadata Endpoints

AWS

GCP

(Requires header: Metadata-Flavor: Google)

Azure

(Requires header: Metadata: true)


Common SSRF Parameters

Last updated