SSRF — Server Side Request Forgery (Types and ways to exploit it) Part-2

We discussed Basic SSRF in Part -1, now we will continue with Blind

ii. Blind -

Not all SSRF vulnerabilities return the response to the attacker. This type of SSRF is known as blind SSRF

Exploiting Blind SSRF -

DEMO (using Ruby)

The above code runs a server on port 4567 which on getting request does the following:
> make request to URL mentioned by user
> send reponse “OK” back to user instead of content(CANT SEE RESPONSE)

http://localhost:4567/?url= will request but does not show the response from google to attacker

To demonstrate impact with this kind of SSRF is to run an Internal IP and PORT scan

Here’s a list of private IPv4 networks that you could scan for services:


We can determine whether the specified PORT is Open/Closed by observing the Response Status and Response Time

Below is the example table of response status and time

Send Spam mails -

In some case if the server supports Gopher we use it to send spam mails from server IP

To demonstrate we will use testing server.

Let’s craft a malicious php page :

This code concats our SMTP command into one line delimited by %0A and forces server to send a ‘GOPHER’ request to a SMTP server while actually sending a valid SMTP request

Performing Denial of service -

An attacker can use iptables TARPIT target to block requests for a prolonged time and CURL’s FTP:// protocol which never timeouts.

An attacker can send all TCP traffic to port 12345 to TARPIT and the request

2. Test Cases -

Places to look for SSRF

End points which fetch external/internal resources -

Case I-

Refer - Link

Case -II

Try changing urls in POST request

Refer - #411865, Link

PDF generators -

There are some cases where server converts uploaded file to a pdf

Try injecting <iframe>, <img>, <base> or <script> elements or CSS url() functions pointing to internal services.

You can read internal files using this

Refer - Link

File uploads -

Instead of uploading try changing input type to URL and check if the server sends a request to it


and Pass the URL

Here’s an example.

Video Conversion -

There are many applications using outdated version ffmpeg to convert videos from one format to other

There is know SSRF vulnerability in this

Clone neex repo and generate an avi using below command

./ file://<filename> file_read.avi

and upload it in the vulnerable server and try converting it from avi to mp4

this reads can be used to read internal file and write in to the video

Refer - #237381 , #226756

Know SSRF vulnerabilities in CMS ,Plugins, Themes..

This is limited to your search knowledge

3. Bypass Whitelisting and Blacklisting -

Lets talk about whitelisting and blacklisting first

whitelisting - Allowing specific URL’s (Allowed Hosts)

Lets say if a server whitelist and u can fetch only using SSRF and rest all other domains get rejected

The only way to bypass whitelisting is find an open redirect in the whitelisted domain. Lets look in to example

Case - 1 whitelisted and you found SSRF in -Fails to fetch as it is not whitelisted - Successfully fetches

Case - 2 whitelisted * and you found SSRF in -Fails to fetch as it is not whitelisted

This can be bypassed if you get any subdomain takeover on *

and use it to iframe or redirect it to desired site — Successfully fetches

blacklisting - Blocking specific URL’s (Disallowed Hosts)

In the same way if a server blacklist and when you ask the server to fetch it blocks

Blacklisting can be bypassed in many ways

Converting IP to hexadecimal -

example - converting to doted hex - http://c0.a8.00.01 and dot less hex http://0xc0a80001

Converting IP to Decimal -

Use any online convertors ( Link )

Converting IP to Octal -

example — converting to doted octal http://0300.0250.0000.0001 and dot less http://030052000001

Refer - #288250

Using wildcard DNS -

There are many sites online provide wildcard DNS, some of them are

U can simply use them to point it to a specific IP

Or you can use your own domain to do this

Make a subdomain and point to with DNS A record

Refer:- #288193 , #288183

Using enclosed alphanumerics -

./End of Part -2



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store