repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
index.mdMarkdown103 lines3.8 KiBsource raw download

title: "Virtual Host" topic: "Virtual Hosts" topicSlug: "virtual-hosts" sourcePath: "Virtual Hosts/README.md" sourceUrl: "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/3ac27901c711/Virtual%20Hosts/README.md" sha: "3ac27901c711" isReadme: true#

Virtual Host#

A Virtual Host (VHOST) is a mechanism used by web servers (e.g., Apache, Nginx, IIS) to host multiple domains or subdomains on a single IP address. When enumerating a webserver, default requests often target the primary or default VHOST only. Hidden hosts may expose extra functionality or vulnerabilities.

Summary#

Tools#

Methodology#

When a web server hosts multiple websites on the same IP address, it uses Virtual Hosting to decide which site to serve when a request comes in.

In HTTP/1.1 and above, every request must contain a Host header:

GET / HTTP/1.1
Host: example.com

This header tells the server which domain the client is trying to reach.

Suppose the server is configured like:

<VirtualHost *:80>
    ServerName site-a.com
    DocumentRoot /var/www/a
</VirtualHost>

<VirtualHost *:80>
    ServerName site-b.com
    DocumentRoot /var/www/b
</VirtualHost>

A request with the default host ("site-a.com") returns the content for Site A.

GET / HTTP/1.1
Host: site-a.com

A request with an altered host ("site-b.com") returns content for Site B (possibly revealing something new).

GET / HTTP/1.1
Host: site-b.com

Fingerprinting VHOSTs#

Setting Host to other known or guessed domains may give different responses.

curl -H "Host: admin.example.com" http://10.10.10.10/

Common indicators that you're hitting a different VHOST:

NOTE: Leverage DNS history records to identify old IP addresses previously associated with your target’s domains. Then test (or "spray") the current domain names against those IPs. If successful, this can reveal the server’s real address, allowing you to bypass protections like Cloudflare or other WAFs by interacting directly with the origin server.

References#