Accessing Localhost via Vhost
A virtual host named 'localhost' was accessible and had directory listing enabled, exposing sensitive configuration files. An attacker could download these files and obtain credentials, API keys, and other secrets.
Published on blog.securitybreached.org
So! Last night i was testing a Bug Bounty Program, so I get to the Vhosts enumeration part I uses some basic tools and Common names of Vhosts manually to get a Positive response.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a misconfiguration where a virtual host intended for internal use was exposed publicly with directory listing enabled, and sensitive files were stored in its web root.
Impact
An attacker could obtain credentials, API keys, and other sensitive information, potentially leading to further compromise of the server or related systems.
What the attacker needed
The target server hosts multiple virtual hosts; A virtual host named 'localhost' is publicly accessible; Directory listing is enabled on that virtual host; Sensitive files are stored in the web root
The fix
The issue was resolved by the company after the report.
How it was found
- Enumerate virtual hosts using common names.
- Find a virtual host named 'localhost' that returns 200 OK.
- Observe directory listing enabled on that virtual host.
- Download files such as .yml, .php, .xml, .json.
- Extract sensitive information like passwords, API keys, and tokens.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A virtual host is like a separate website hosted on the same server, identified by its name. The tester found that a virtual host called 'localhost' was publicly accessible and showed a list of files. Those files contained passwords and keys, which could let someone break into the system.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.