Confirming SSRF
Start with a URL pointing at a host you control and listen for the callback. If the request arrives, SSRF is confirmed.http://$LHOST:8000/test in the vulnerable parameter and watch for the incoming request.
Basic Payloads
Hit localhost and the link-local range first: internal services and cloud metadata endpoints are the most common targets.AWS Metadata
The IMDSv1 endpoint hands out IAM credentials with no auth: if the app is on EC2 and SSRF is confirmed, hit this immediately.Bypass Filters
Blocklists keyed on “127.0.0.1” or “localhost” miss decimal, hex, and wildcard DNS representations.Port Scanning
Use SSRF to sweep internal ports. A closed port typically returns a connection refused error; an open port returns a response or times out differently. Compare error messages to distinguish open from closed.Internal Endpoint Enumeration
Once you identify an internal hostname, enumerate its paths through the SSRF parameter.File Read via file://
Switch to thefile:// scheme to read local files from the server’s filesystem.
Protocol Smuggling
Switch protocols to reach non-HTTP internal services: gopher is especially powerful for attacking Redis, memcached, and SMTP.Gopher: Sending POST Requests
Thegopher:// scheme sends raw bytes to a TCP socket, letting you craft arbitrary HTTP requests including POST bodies. This is useful when the SSRF target requires a POST request that the http:// scheme cannot send.
Build the raw request, URL-encode spaces as %20 and newlines as %0D%0A, prefix with gopher://host:port/_, then double-encode the entire URL because the parameter itself is URL-encoded.