
SSRFmap is a Python framework that fuzzes a chosen parameter in a captured HTTP request to detect and leverage SSRF conditions during authorized penetration tests and lab exercises.
| Tool | swisskyrepo/SSRFmap — modular SSRF detection and exploitation framework driven by Burp-style request files, MIT licensed, ~3.6k stars, Python 3.12+ |
| Category | Web exploitation / SSRF fuzzing framework |
| Primary Use | Validating whether a parameter such as url in a saved request triggers server-side requests, then testing adjacent internal services (redis, fastcgi, cloud metadata) in scope-controlled environments |
| Safe Use | Intended for authorized penetration tests, CTF challenges, and local lab reproduction using the bundled examples/example.py Flask service; never point it at systems you do not own or have written permission to test |
| Telemetry Note | Every module causes the vulnerable server itself to originate requests — outbound connection logs, DNS queries, metadata endpoint access logs, and unusual User-Agent strings (settable via --uagent) are the primary defensive signals |
SSRFmap, maintained by swisskyrepo of PayloadsAllTheThings fame, attacks a very specific workflow problem in web application testing: you have found a parameter that might fetch a URL on the server's behalf, and manually enumerating what that primitive can reach — localhost services, cloud metadata, internal ports — is tedious and error-prone. The tool takes a raw request file, typically exported from Burp Suite, plus the name of the parameter to fuzz, and systematically replaces that parameter's value with payloads designed to probe the server-side network. At around 3,600 stars with an active CI pipeline running pytest and ruff, it is one of the more mature entries in the SSRF tooling niche, and it explicitly targets Python 3.12+ with a uv-managed environment.
The invocation model is deliberately minimal: ssrfmap.py -r request.txt -p url -m module covers the majority of use cases. The -r flag points at the saved request, -p selects the injection point, and -m chains one or more of the twenty-plus modules separated by commas. What is notably flexible is where the parameter can live — the README demonstrates injection into GET, POST, and PUT parameters, custom headers such as X-Custom-Header, and structured bodies including JSON, XML, and multipart/form-data fields. This matters because SSRF bugs in the wild frequently hide in non-obvious sinks like a JSON property or a header value, and tools that only handle simple form parameters miss them.
A recent refinement documented in the README is the *FUZZ* marker. By default SSRFmap replaces the entire parameter value, which breaks requests where the URL is embedded in a larger structured string. Placing *FUZZ* inside a value like url=test;*FUZZ*;end preserves the surrounding syntax and swaps only the marker, which the README notes works across all supported body types. This is a small feature with outsized practical value, since template strings, delimited configs, and concatenated API paths are common real-world SSRF sinks that defeat naive value substitution.
The module list is where the framework shows its depth. On the reconnaissance side, portscan sweeps the top 8000 ports on a host, networkscan performs an HTTP ping sweep across a subnet, and readfiles attempts local file disclosure of paths such as /etc/passwd (or arbitrary paths given via --rfiles). On the infrastructure side there are provider-specific metadata modules for aws, gce, alibaba, and digitalocean, all fetching metadata and user-data endpoints — the classic SSRF-to-credential-pivot path that defenders know well. Retrieved data is written to a loot/<target>/ directory, which the project keeps out of Git precisely because it can contain sensitive material.
Beyond probing, several modules model post-exploitation primitives against internal services: redis and fastcgi for command execution, mysql and postgres for command execution via those daemons, github targeting GitHub Enterprise versions below 2.8.7, zabbix, docker for API infoleaks, and axfr for DNS zone transfers using --ldomain. There are also situational utilities like socksproxy to establish a SOCKS4 relay through the vulnerable host, smbhash to force an SMB authentication over a UNC path (a credential-capture technique relevant to internal AD environments), and custom for sending arbitrary data to a listening service. In an authorized engagement, these modules are how you answer the client's real question: not "is there an SSRF" but "what is the blast radius."
Handler and networking options follow Metasploit conventions. --lhost and --lport define callback coordinates for modules that build connect-back payloads, and -l starts an integrated listener on the specified port for receiving a reverse shell — the README's example chains redis with a listener on port 4242. Evasion is addressed through --level (1–5), which mutates payload encodings — the README cites transformations like 127.0.0.1 to [::] to 0000: — aimed at bypassing IDS/WAF filtering. From a defensive perspective, that same escalation ladder is a useful checklist: if your egress filters only match literal loopback literals and common IP notation, you are filtering the easiest level.
Operational hygiene features are present and worth calling out. --proxy routes traffic through an intercepting proxy such as http://localhost:8080, which is exactly what you want when validating behavior in Burp during an assessment — you see every mutated request the framework generates. --uagent controls the User-Agent, --ssl enables HTTPS with relaxed verification, and --logfile captures output for the report. For consultants, the proxy integration and logging are arguably as important as the modules themselves, since reproducible evidence is what turns a finding into a documented one.
The project ships with a self-contained lab, which is the correct way to learn this tool. examples/example.py is a small Flask service that exhibits an SSRF condition, and the README walks through running it locally with uv run flask --app examples/example.py run and then exercising SSRFmap against request fixtures covering POST bodies, PUT requests, JSON payloads, multipart forms, and header injection. Ten numbered example request files let you reproduce each variation deterministically, and the Docker path — building the image and running the example service in a named container with the loot/ directory volume-mounted — gives training environments a clean isolation boundary.
Quality signals are decent for this category of tool: continuous integration badge, unit tests runnable via uv run pytest, lint gates through ruff check and ruff format --check, an MIT license, and an open roadmap that names hacktoberfest among its topics. The README credits its intellectual lineage honestly — Gopherus by tarunkant, Orange Tsai's GitHub Enterprise SSRF-to-RCE chain writeup, and cujanovic's SSRF-Testing payload corpus — which tells you the framework is essentially an automation shell around techniques the community developed manually between 2015 and 2018.
For defenders, SSRFmap's existence is a planning input rather than a threat in itself. The traffic pattern it generates is distinctive: a single client machine submitting repeated requests where one parameter cycles through loopback variants, private CIDR addresses, gopher:// and file:// style payloads, and metadata IPs such as 169.254.169.254, all in rapid succession. Monitoring for repeated outbound fetches initiated by your application tier toward link-local ranges, unusual internal ports, and DNS zone-transfer attempts will catch both this tool and the manual techniques it automates. Egress restrictions at the application layer — allowlists rather than blocklists, and disabling unnecessary URL schemes — remain the most effective structural mitigation.
In summary, SSRFmap occupies a well-defined niche: it is not a scanner that finds parameters for you, but a force multiplier once you have a candidate request in hand. Its strengths are the breadth of injection contexts it supports, the module library covering everything from file reads to cloud metadata to internal RCE primitives, and a genuinely reproducible local test harness. Run it against your own lab first, route it through a proxy so you understand every payload it sends, and keep it firmly inside engagements with signed scope — the same properties that make it efficient for authorized testers make it trivially detectable and plainly illegitimate anywhere else.
swisskyrepo/SSRFmap.Educational analysis for authorized security professionals. Use only in controlled, authorized environments.
0 comentários:
Post a Comment
Note: Only a member of this blog may post a comment.