Security Notes
  • Whoami
  • Pentesting
    • WEP-Pen
      • Reconnaissance
      • Enumeration
      • OWSAP TOP 10
        • Injection
          • Cross Site Scripting
            • Cross Site Scripting
            • Exploitation
            • Protections
          • SQL Injection
            • SQL Injection Overview
          • NoSQL Injection
          • CRLF Injection
          • XML Injection
        • Broken Access Control
          • Path Traversal
          • Sensitive Cookie with Improper SameSite Attribute
          • Link Following
          • Incorrect Default Permissions
          • Information disclosure
          • CSRF
            • csrf checklist
          • 403 bypass
          • Exposure of WSDL File Containing Sensitive Information
          • bussiness logic checklist
          • 2FA bypass checklist
          • admin panal checklist
          • idor checklist
          • Authentication checklist
          • reset_password_checklist
          • ATO
        • Cryptographic Failures
          • Cryptographic Failure
          • Weak Encoding for Password
          • Improper Following of a Certificate's Chain of Trust
            • Understanding Digital Certificates : Self-Signed and CA-Signed Certificate **
            • Transport Layer Security (TLS) and SSL **
          • Clear Text Transmission Of Sensitive Data
            • SSLStripping **
        • Insecure Design
        • Security Misconfiguration
          • CORS Miscofigration
          • Mail Server Misconfiguration
        • Vulnerable and Outdated Components
          • Using Components with Known Vulnerabilities
        • Identification and Authentication Failures
          • JWT Hacking
          • SAML Authentication bypass
        • Software and Data Integrity Failures
          • mass assignment
          • PostMessage Vulnerabilities
            • PostMessage Vulnerabilities
            • Blocking main page to steal postmessage
            • Bypassing SOP with Iframes - part 1
            • Bypassing SOP with Iframes - part 2
            • Steal postmessage modifying iframe location
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery (SSRF)
          • SSRF
      • Checklists
        • aem misconfiguration
        • exif_geo
        • xss
        • Session Management
        • Authorization
        • cookie
        • Django
        • Symfony
        • json
        • bypass rate limit
        • Rce
        • Register Page
      • eWPTXv2 Preparation
        • Encoding & Filtering
        • Evasion Basics
        • Cross-site scripting (XSS)
        • XSS Filter Evasion
        • Cross-site request forgery (CSRF
        • HTML5
      • API-Pen
        • API Discovry
        • Reverse Engineering API Documentation
        • Excessive Data Exposure
        • Vulnerability Scanning
        • API Authentication Attacks
          • Classic Authentication Attacks
          • API Token Attacks
        • API Authorization Attacks
          • Broken Object Level Authorization (BOLA)
          • Broken Function Level Authorization
        • Improper Assets Management
        • Mass Assignment
        • SSRF
        • Injection Attacks in API
        • Evasive Maneuvers
        • GraphQL Vulnerabilities
    • NET-Pen
      • Active Directory Pentesting
        • Active Directory Components
        • Initial Attack Vectors
          • LLMNR Poisoning
          • SMB Relay Attacks
          • IPv6 Attacks ( IPv6 DNS Takeover )
          • Printer Hacking
          • Methodology
          • Some Other Attacks
            • Zerologon (CVE-2020-1472)
            • PrintNightmare (CVE-2021-1675)
        • Post-Compromise Attacks
          • Pass Attacks
          • Kerberoasting Attack
          • Token Impersonation Attack
          • LNK File Attack
          • GPP / cPassword Attacks
          • Mimikatz
          • Methodology
        • We've Compromised the Domain
          • Dumping the NTDS.dit
          • Golden Ticket Attacks
          • Methodology
        • Case Study
        • Password Attacks
      • Attack Vectors by Port
        • FTP 21
        • SSH 22
        • Telnet 23 - 2323
        • SMTP 25
        • DNS 53
        • Kerberos 88
        • POP 110-995
        • RPC 111
        • Ident 113
        • NNTP 119
        • NetBIOS 137-138
        • SMB / Samba 135-139, 445
        • MSRPC 135
        • SNMP 161
        • LDAP 389,636
        • Modbus 502
        • OpenSSL 1337
        • Ms-SQL 1433
        • Oracle Listener 1521 1522 1529
        • NFS 2049
        • MySql 3306
        • RDP 3389
        • ADB Android Debug Bridge 5555
        • WinRM 5985 5986
        • VNC 5800 5900
        • Redis 6379
        • Unreal IRC 6667
        • Tomcat 8080
        • MongoDB 27017
        • http 80
      • Network basics
      • Information Gathering
      • Privilege Escalation
        • Windows Privilege Escalation
        • Linux Privilege Escalation
    • write-ups
      • How i found a Privilege Escalation via Impersonation Features feature
      • How I was able to discover ATO Via IDOR vulnerability
      • Easy full Account Takeover via Facebook OAuth Misconfiguration
Powered by GitBook
On this page
  1. Pentesting
  2. WEP-Pen
  3. API-Pen

SSRF

Introduction to Server-Side Request Forgery (SSRF)

Server-Side Request Forgery (SSRF) is a vulnerability that occurs when an application retrieves remote resources without validating user input. This flaw allows an attacker to control the resources requested by the server, often through a user-supplied URL. With control over these requests, attackers can gain access to sensitive data or potentially compromise a vulnerable host. SSRF is listed as #10 on the 2021 OWASP Top 10 and is a rising threat, especially to APIs.

SSRF Impact

The impact of SSRF can be significant:

  • Data Exposure: An attacker may retrieve private data from internal services.

  • Network Scanning: SSRF can enable attackers to scan the target’s internal network.

  • Remote Code Execution: In some cases, SSRF can lead to remote code execution.

Types of SSRF

  1. In-Band SSRF: The server responds with information from the specified URL, which can reveal data to the attacker directly.

  2. Blind SSRF: The server makes the request but does not send the response back to the attacker. The attacker can verify the request by monitoring a server they control.

Example of In-Band SSRF

  • Intercepted Request:

    POST /api/v1/store/products
    { "inventory": "http://store.com/api/v3/inventory/item/12345" }
  • Attack:

    POST /api/v1/store/products
    { "inventory": "http://localhost/secrets" }
  • Response:

    { "secret_token": "crapi-admin" }

Example of Blind SSRF

  • Attack:

    POST /api/v1/store/products
    { "inventory": "https://webhook.site/<random-URL>" }

Check webhook.site for request logs instead of relying on the application response.

Ingredients for SSRF

When hunting for SSRF vulnerabilities in an API, look for:

  • Full URLs or URL paths in POST bodies or parameters.

  • Headers that may contain URLs (e.g., Referer).

  • Any form of user input that the server might process as a URL.

Testing SSRF in crAPI

Identify requests involving URLs, such as:

  • POST /community/api/v2/community/posts

  • POST /workshop/api/shop/orders/return_order?order_id=4000

  • POST /workshop/api/merchant/contact_mechanic

Testing for SSRF

Either using Postman or the web browser, proxy the requests that you are targeting to Burp Suite.

Next, send the request over to Repeater to get an idea of a typical response.

In the case of the return_order request, we are able to return an item once. If we attempt to return the item twice then we will receive a response that the item has already been returned.

To test SSRF on the return_order endpoint, you’ll need several valid order_ids. Use the POST /workshop/api/shop/orders endpoint to purchase multiple items, allowing you to generate distinct order_ids for the attack.

Use Burp Intruder with Pitchfork Attack Mode: The Pitchfork mode in Burp Intruder pairs separate payloads, which is ideal here as it allows you to pair each valid order_id with different SSRF payloads (target URLs).

Payload 1: Use valid order_ids generated in the previous step.

Analyze Responses: Send the requests and carefully observe the response codes, lengths, and any indicators of unusual behavior.

Look for SSRF Evidence: If you control the resources (e.g., via webhook.site), check there for incoming requests. An incoming request from the server can confirm SSRF exploitation even when responses don’t reveal server interaction directly. Again, the URL was not requested and this request does not appear to be vulnerable. Notice the requests shows 0/500 and the message "Waiting for first request...".

Let's try this out on the contact_mechanic request. Set the attack position, copy and paste the payloads you previously used for URLs, and send the attack. Review the results and see if there is anything interesting.

Sure enough, the localhost requests fail, but the other URLs provided are successful. As far as reviewing for anomalies, we can see that there are a variety of status codes and response lengths. Upon reviewing the responses from the successful requests, we can see that the remote resources we requested were sent back over the API request.

We can also verify that a request was made from the server by visiting our webhook.site page.

Congratulations, you have successfully exploited an SSRF vulnerability!

PreviousMass AssignmentNextInjection Attacks in API

Last updated 1 month ago

For Blind SSRF, you can use a service like to confirm the server’s request:

Payload 2: Set the second payload to potentially interesting URLs including your webhook.site URL. For additional SSRF payload ideas check out .

webhook.site
PayloadAllTheThings SSRF List