How I found Misconfigured Server Exposed Git Repository and Inter
An exposed .git directory on a subdomain allowed the attacker to dump the repository contents, revealing internal files and objects. The attacker could access sensitive source code and potentially other secrets.
Today, I want to share my experience of discovering sensitive data exposure. Let’s dive right in!
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 was misconfigured to serve the .git directory, which should have been blocked or removed from the public web root.
Impact
The exposed repository could reveal internal files and objects, potentially leading to sensitive information disclosure.
What the attacker needed
None
How it was found
- Enumerate subdomains and check their status codes and titles using httpx.
- Notice a subdomain showing the default Nginx welcome page.
- Fuzz the subdomain with Dirsearch to find hidden paths.
- Discover an exposed .git/ directory.
- Dump the repository contents using a git-dump tool.
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 .git directory is a hidden folder that stores the version history of a website's code. If it is left publicly accessible, anyone can download it and see the source code, which may contain passwords or other secrets. Here, the attacker found such a folder and used a tool to copy its contents.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.