Google Dork Leads To Lfi
A subdomain exposed a directory that returned the contents of sensitive system files such as the password file and the shadow file instead of blocking access. An attacker could read those files to learn about the server's users and, if the shadow file was readable, password hashes.
Published on systemweakness.com
Like every bug hunter I began collecting subdomains of a target. While doing so, I came across a subdomain that seemed unusual to me, prompting me to think about it more deeply.
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 the web server served files from a directory that contained or exposed operating system files, with no access control on those paths.
Impact
An attacker could read sensitive system files, including the shadow file holding password hashes, though code execution was not achieved.
What the attacker needed
Target subdomain indexed by a search engine; no authentication needed
How it was found
- Search a search engine for the subdomain together with a system path to find indexed results.
- Open the result and find a directory named passwd.
- Request the password file path and observe its contents returned.
- Try further system file paths, of which only the shadow file returned content.
- Test for remote code execution, which did not succeed, then report.
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.
Some web servers keep files that belong to the operating system, such as the list of user accounts, in a folder the website can reach. If the site does not block requests for those files, anyone who guesses the path can download them. Here a search engine had already indexed one such path, so the hunter found it without any special tools.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.