( NgorbIT #03 ) Ngobrol Soal IT: Mitos Framework Modern Aman dari Git Exposed : Bedah Celah, Git Internals dan Kasus Web Pemda
Many government websites expose their .git directory, allowing attackers to reconstruct source code and commit history. The author scanned 387 domains and found 355 with exposed .git, including some Laravel and Vue.js sites, and explains how deleted secrets can be recovered from git history.
Published on goodnightdev.medium.com
Halo semuanya,, balik lagi di seri Ngorbit ( Ngobrol Soal IT). Kenapa sih update NgorbIT terus, AVD ( Attacker vs Developer ) kapan update ? sabar masih riset bro, kalau NgorbIT kan mentahan bisa, dan satu arah.
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's document root points to the project root instead of the public folder, or deployment via git pull leaves the .git directory in a publicly accessible location.
Impact
Attackers could reconstruct the full source code and history, recovering secrets such as database passwords and API keys that were deleted but remain in git history; the text does not claim active exploitation beyond exposure.
What the attacker needed
Web server serves .git directory; no authentication required
The fix
The text recommends denying access to .git in the web server configuration, deploying via CI/CD artifacts or git archive instead of git pull, and rotating all credentials that were ever in the repository.
How it was found
- Read the .git/HEAD and .git/index files to get the latest commit hash.
- Recursively download objects from .git/objects/.
- Follow parent hashes back to the first commit.
- Check out the repository locally to reconstruct the full source code.
- Run git log on a deleted file such as .env to recover its contents.
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.
When developers use Git to track code changes, a hidden folder called .git stores the entire history of the project. If a web server is misconfigured and lets anyone browse that folder, an attacker can download it and rebuild all the source code, including old files that were deleted but still exist in history. This can reveal passwords and API keys that were committed by mistake.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.