Making the Server Your Puppet
Imagine you're standing outside a locked building. You can't get in, but there's an employee inside who'll fetch anything you ask for. You say "Hey, can you check what's in the CEO's office?" and they just... do it. That's Server-Side Request Forgery (SSRF).
SSRF occurs when you can make a server send HTTP requests on your behalf. The server becomes your proxy, accessing internal resources you couldn't reach directly. In cloud environments, this is devastating - you can steal credentials, access internal services, and sometimes achieve full server compromise.
How SSRF Works
SSRF exploits features where a server fetches content from a URL you provide. Instead of giving it a legitimate URL, you point it to something interesting:
Why Servers Fetch URLs
The Devastating Impact
1. Cloud Metadata Services
Cloud providers expose metadata APIs accessible only from within instances. SSRF lets you reach them:
2. Internal Service Access
3. Port Scanning & Service Discovery
4. Local File Access
Finding SSRF Vulnerabilities
SSRF Hunting Methodology
- Any parameter containing URLs (check url=, site=, link=, src=, path=)
- Import/export features
- PDF generators, image processors
- Webhook configurations
- File upload by URL
- Use Burp Collaborator, RequestBin, or your own server
- Submit your callback URL as the target
- Check for incoming HTTP requests
- This confirms the server is making requests
- Try localhost/127.0.0.1
- Try 169.254.169.254 (cloud metadata)
- Try internal IP ranges (192.168.x.x, 10.x.x.x, 172.16-31.x.x)
- If blocked, try bypass techniques (see below)
- Different encodings, protocols, redirects
- Enumerate internal services
- Extract credentials
- Interact with internal APIs
Detecting Blind SSRF
Bypassing SSRF Protections
Applications often implement blocklists or allowlists. Here's how to bypass common protections:
IP Address Bypasses
URL Parsing Bypasses
Protocol Bypasses
DNS Rebinding
Exploitation Techniques
AWS Credential Theft
Redis Exploitation via Gopher
Internal Network Scanning
Practice Challenges
Knowledge Check
Key Takeaways
- SSRF makes servers your proxy - accessing internal resources, cloud metadata, and firewalled services
- Cloud metadata is the prize - 169.254.169.254 contains IAM credentials that often grant extensive access
- Blocklists are easily bypassed - decimal IPs, IPv6, DNS rebinding, URL parsing tricks
- Gopher protocol enables service exploitation - attack Redis, MySQL, Memcached via SSRF
- Defense requires allowlists + DNS resolution checks - validate both hostname AND resolved IP