Virtual hosting
Single web server hosts multiple websites or applications.
Although each of these distinct websites will have a different domain name, they all share a common IP address with the server.
Websites hosted in this way on a single server are known as “virtual hosts”.
Routing traffic via an intermediary
Websites are hosted on distinct back-end servers, but all traffic between the client and servers is routed through an intermediary system.
This could be a simple load balancer or a reverse proxy server of some kind.
HTTP Host header
Http host header refers to the Host header to determine the intended back-end
GET /web-security HTTP/1.1
Host: portswigger.net
Warning: Some intercepting proxies use the Host header to determine the target IP address, making testing difficult. Burp Suite keeps the Host header and target IP address separate, which is crucial.
Start by testing the effect of providing an arbitrary domain name in the Host header
https://normal-website.com/reset?token=0a1b2c3d4e5f6g7h8i9j.Admin panel with host: Host: localhost
Bruteforce subdomain
If load balancers and reverse proxies are misconfigured to forward requests based on an invalid Host header, you can exploit this to reroute requests to any system you choose -> exploit this to have access internal-only systems.
Detection
In the host header add your attacker.com website. If
it doesn’t work try to identify private IP addresses anyway.
You can also brute force 192.168.0.0/16 ,
10.0.0.0/8, etc.
You may encounter servers that only perform thorough validation on the first request they receive over a new connection. So, you can potentially bypass this validation by sending an innocent-looking initial request then following up with your malicious one down the same connection.
Note: You need to set up a single connection.
E.g. SQLi, etc.
Parsing flaws
Host: vulnerable-website.com:bad-stuff-here
Host: notvulnerable-website.com
Host: hacked-subdomain.vulnerable-website.comOverride headers (X-Host,
X-Forwarded-Server, Forwarded, etc.). You
can also find with param miner -> guess headers
GET /example HTTP/1.1
Host: vulnerable-website.com
X-Forwarded-Host: bad-stuff-hereInject duplicate Host headers
GET /example HTTP/1.1
Host: vulnerable-website.com
Host: bad-stuff-hereSupply an absolute URL (many servers are also configured to understand requests for absolute URLs).
HTTP,
HTTPSGET https://vulnerable-website.com/ HTTP/1.1
Host: bad-stuff-hereAdd line wrapping
GET /example HTTP/1.1
Host: bad-stuff-here
Host: vulnerable-website.comOther techniques you can find on the web “common domain-validation flaws”