🚩
Cyber Explained
  • WHOAMI
  • Technologies
    • Docker
      • Setup Docker
      • Terminology
      • Docker Hub
      • Docker Images
      • Docker Containers
      • Working with Containers
      • Virtualization vs Containerization
      • Nutshell
      • Troubleshoot
    • Android Application
      • Application File Structure
      • Layout and Resources for UI
      • Activities
      • Intents
      • Activity lifecycle and state
      • Implicit intents
    • Active Directory
      • Attacking Active Directory: 0 to 0.9
      • Resources
    • Kerberos
  • RED TEAMING
    • Attacking Kerberos
      • User Enum and Brute Force
      • AS-REP Roasting
      • Kerberoasting
    • MITRE ATT&CK
    • Resources
  • PenTesting
    • Android Pentesting
      • Re-Build App
      • Using Frida on Android without root
    • Web Pentesting
      • XSS
      • SQLi
      • Authentication Vulnerabilities
      • Session Security
      • CSRF
      • Path Traversal
      • File Inclusion
      • Business Logic Vulnerabilities
      • HTTP Host header attacks
      • SSRF
      • HTTP Request Smuggling
      • OS command injection
      • Access control vulnerabilities
    • OWASP Testing Guide
      • 1.0 Information Gathering
      • 2.0 Configuration and Deployment Management Testing
      • 3.0 Identity Management Testing
      • 4.0 Authentication Testing
      • 5.0 Authorization Testing
      • 6.0 Session Management Testing
      • 7.0 Input Validation Testing
      • 8.0 Testing for Error Handling
      • 9.0 Testing for Weak Cryptography
      • 10.0 Business Logic Testing
      • 11.0 Client-side Testing
      • 12.0 API Testing
  • Programming
    • Python
      • Hello World !
        • Variables and Data Types
        • Lists, Tuple, Sets and Dictionaries
        • If Statement
        • While Loops
        • For Loops
        • Functions
        • Classes and Objects
        • Creating Modules
        • Creating Packages
        • Exception Handling
      • System Pogramming
        • File Handling
        • OS Interaction with OS Library
        • Multithreading
        • Signals
        • Subprocess
        • Code Examples
      • Network Programming
        • Socket Programming
        • Packet Injection with Raw Sockets
        • SocketServer Framework
        • Packet Sniffing with Scapy
        • Creating a Web Server
        • Packet Injection with Scapy
        • Packet Sniffing with Raw Sockets
        • Programming with Scapy
  • Operating Systems
    • Windows*
    • Linux
      • System Structure
      • VI Text Editor
      • Working with the Linux Shell
      • Managing Users and Groups
      • Managing Files and Directories
  • Networks
    • Page 1
Powered by GitBook
On this page
  1. PenTesting
  2. Web Pentesting

SSRF

Server-Side Request Forgery

any url parameter try ssrf

cause the server to make a connection to internal-only services within the organization's infrastructure

  • SSRF attacks against the server itself

    alter url parameter to http://localhost this may allow functions only allowed for normal user

  • SSRF attacks against other back-end systems

    alter url parameter to http://192.168.0.x using intruder to scan back-end systems that are not reachable by user These systems often have non-routable private IP addresses

  • SSRF with blacklist-based input filters

    • alter ip representation to

      hex IPoctal IP127.1 127.0.0.10177.0.0.10x7f.0.0.1127.0.1127.121307064330177000000010x7f000001

      this work because of : inet_ntop, inet_pton - convert IPv4 and IPv6 addresses between binary and text form

    • Registering your own domain name that resolves to 127.0.0.1. You can use spoofed.burpcollaborator.net for this purpose.

    • Obfuscating blocked strings using URL encoding or case variation like encode first letter from admin

  • SSRF with whitelist-based input filters

    • embed credentials in a URL before the hostname https://expected-host@evil-host

    • use the # character to indicate a URL fragment https://expected-host#evil-host orhttps://expected-host#@evil-host

    • leverage the DNS naming hierarchy https://expected-host.evil-host

    • URL-encode characters to confuse the URL-parsing code

    • MIX ALL ABOVE TOGETHER

  • Bypassing SSRF filters via open redirection

    /product/nextProduct?currentProductId=6&path=http://evil-user.net

    returns a redirection to:

    http://evil-user.net

    You can leverage the open redirection vulnerability to bypass the URL filter, and exploit the SSRF vulnerability as follows:

    POST /product/stock HTTP/1.0Content-Type: application/x-www-form-urlencodedContent-Length: 118​stockApi=http://weliketoshop.net/product/nextProduct?currentProductId=6&path=http://192.168.0.68/admin

    This SSRF exploit works because the application first validates that the supplied stockAPI URL is on an allowed domain, which it is. The application then requests the supplied URL, which triggers the open redirection. It follows the redirection, and makes a request to the internal URL of the attacker's choosing.


ssrf to local file disclosure

PreviousHTTP Host header attacksNextHTTP Request Smuggling

Last updated 3 years ago