SSRF

Server Side Request Forgery: Methodology, payloads, tools

ko-fi

Detection - Vulnerable Parameters

Basic payload

Paylod List

SSRF to LFI

File Inclusion LFI / RFI

Finding SSRF with Burp

Match: https?:\/\/(www\.)?[-a-zA-Z0–9@:%._\+~#=]{1,256}\.[a-zA-Z0–9()]{1,6}\b([-a-zA-Z0–9()@:%_\+.~#?&//=]*)

Replace: https://{YOUR_SERVER}/ (Burp Collaborator)

Source: https://x.com/intigriti/status/1848288871735320916?t=bTTpk3N1LoqLpO1768DhQw&s=03

Port scan

List of common ports

Filter Bypass

Burp extension

Decimal notation

Other notation

More payload: https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/url-format-bypass

IP encoding

Here IP 8.8.4.4 (Google DNS) is used:

Use your own server to redirect on localhost

redirector.py:

Run redirector server:

Vicitim payload: http://[YOUR_IP]

DNS Rebinding

Also try 127.0.0.1 and 169.254.169.254

More payloads

Also check Paylaod List

Cloud Metadata IP

URL / Host Validation Bypass

Replace "{CANARY_TOKEN}" with your controlled hostname and replace "example.com" with a whitelisted target host.

Bypassing protocol whitelists

URL Schemes

file://, dict://, sftp://, ldap://, tftp://, gopher://

Gopher

Blind SSRF with OOB

See Use your own server to redirect on localhost

Platform to receive HTTP & DNS callbacks for SSRF (Blind) - interactsh

SSRF (XSS) in PDF Generator

XSS

Some PDF generators rely on the Chromium web browser without sandbox security enabled and with root privileges. This can often be further escalated to remote code execution!

PDF Generator - SSRF in .NET Application to RCE

Look for encryption keys in web.config

Craft a ViewState payload that executed a PowerShell command to exfiltrate server information

NextJS apps

Next.js

CVE-2024-34351 - fixed in v14.1.1.

Tools

SSRFmap

Autossrf

0dSSRF

SSRFPwned

Interesting Books

Interesting Books

Disclaimer: As an Amazon Associate, I earn from qualifying purchases. This helps support this GitBook project at no extra cost to you.

Support this Gitbook

I hope it helps you as much as it has helped me. If you can support me in any way, I would deeply appreciate it.

ko-fi

buymeacoffee

Resources

Last updated