This is a Host-header based SSRF example. In this type of SSRF, any IP/Hostname entered in the host header is parsed by the vulnerable server. The vunerable server ends up routing the request to the specified domain/IP and retrieves the contents, returning them in the HTTP response. This type of misconfiguration can easily be exploited to exfiltrate data from sensitive locations (e.g. Internal locations, AWS metadata, local files, etc.)
This misconfiguration is usually seen in web servers that act like a proxy, such as Squid proxy, Nginx and Apache.
apt-get install nginx
2. Replace the content of below mentioned file with this NGINX web server Default file:
/etc/nginx/site-available/default
service nginx reload
In Burp suite, send request to repeater tab and click Send
button:
Now, when we change the value of Host
header with some other hostname/IP (192.168.56.104 in this case), web proxy server makes HTTP request to that host and returns HTTP response from that host:
./init 0