Server Side Request Forgery: Methodology

Server-side request forgery (SSRF)Exploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

SSRF is a security vulnerability that occurs when an attacker manipulates a server to make HTTP requests to an unintended location. This happens when the server processes user-provided URLs or IP addresses without proper validation.

Common exploitation paths:

  • Accessing Cloud metadata

  • Leaking files on the server

  • Network discovery, port scanning with the SSRF

  • Sending packets to specific services on the network, usually to achieve a Remote Command Execution on another server

Example: A server accepts user input to fetch a URL.

py
url = input("Enter URL:")
response = requests.get(url)
return response

An attacker supplies a malicious input:

ps1
http://169.254.169.254/latest/meta-data/

This fetches sensitive information from the AWS EC2 metadata service.

Comments

No comments yet.