How I accessed the/etc/folder from .git Folder misconfiguration
A publicly reachable .git directory exposed source code and a development folder containing an RSA private key. The author claims the key allowed a remote SSH connection and access to the system's password and shadow files.
Published on medium.com
you can see this files its git and already information about authors and project
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 and a development folder containing an RSA private key.
Impact
The exposed private key could allow an attacker to log in to the server over SSH and read sensitive system files such as the password and shadow files.
What the attacker needed
Publicly reachable .git directory; private key stored in the repository
How it was found
- Run a port scan to gather information.
- Use a content discovery tool to find the .git folder.
- Use a git extraction tool to download the exposed files and folders.
- Inspect the repository and find a dev folder.
- Find an RSA private key in the dev folder.
- Change file permissions and use the key to connect over SSH and read the shadow file.
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 folder is the hidden storage a developer tool uses to track code changes; if a website serves it publicly, anyone can download the project's history. Here that history included a development folder with a private key, which is like a password for logging into a server. The author says that key let them log in and read sensitive system files.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.