Introduction To SSRF
Introduction To SSRF
Types of SSRF?
1) Full Response SSRF
In this type of SSRF attack the attacker can receive the output in
response.
The attacker abuses the trust relationship between the systems that
means usually the firewall allows only certain [IP:Port] if it is on the
same local network or it is explicitly trusted but SSRF attack breaks
the trust.
It can again be categorized into two types
i) SSRF targeting the server:
In this type of attack the adversary changes the URL to the
127.0.0.1 or localhost especially to access the confidential data of
web server internal system files.
For example, a website uses api to update scores of players during
live cricket.
GET /Cricket /Scores HTTP/1.0
Api=http://data.cricbuzz.com:8080/Cricket/Score/check?matchID=
12
Now attacker modifies it as
GET /Cricket /Scores HTTP/1.0
Api= http://localhost/admin
ii) SSRF targeting the back-end server:
In this type of attack the adversary tries to exploit backed
components connecting to the vulnerable web server.
Considering above example, the attacker able to discover a backend
server say 192.168.04 is alive with port 80 as open, now attacker
modifies the URL as http:// 192.168.04 :80 to access it.
2) Blind SSRF:
In this type of attack, the attacker does not find any output in the
response from the server this make difficult to exploit but not
impossible.
Example:
i) Xmlrpc enabled SSRF:
XML-RPC is a feature that allows external applications to interact
with the WordPress site's core functionality.
Step-1: Identify the Wordpress website with the access to xmlrpc.php
While accessing www.mainsite.com/xmlrpc.php if we get
error change the
request to POST using Burpsuite
Step-2: List all the methods that are allowed by wordpress website
using following script
Capture the request and add the following script using Burpsuite
proxy.
Step-3: Check for pingback.ping method in the response.
Method name
Using this the website send back response to the Burp Collaborator
Client and we will get private IP of internal server.
Step-5: Check for the IP in response of the collaborator client
Finding an SSRF?
1) When an URL is used as parameter in the address bar
Countermeasures:
1) Network isolation: Place the server that is vulnerable to SSRF in a
restricted network zone that is isolated from the rest of the
network, limiting the access that attackers can gain.
3) Input filtering: Filter out any input parameters that may be used to
modify the URL such as redirect parameters, to prevent attackers
from manipulating the URL