Lion Cipher Lab

Recover source and secrets from an exposed .git directory, then lock it down

Why it matters

This is one of those findings that sounds obscure and turns out to be everywhere. A team sets up a server, they `git clone` the project straight into the web directory to deploy it, and they never think about the hidden `.git` folder that came along for the ride. That folder is now served to the whole internet -- and because git keeps the complete history of the project inside it, an attacker does not get one leaked file, they get the entire source code, every configuration file, and crucially every secret that was ever committed, including ones a developer thought they had deleted. Scanners…

What you'll learn

Steps in this lab

  1. The problem in one breath, and why history is the sting
  2. Build the vulnerable target: a repo with a 'deleted' secret
  3. Serve it like a misconfigured deploy
  4. Discovery — the one request that confirms it
  5. Reconstruct it the fast way — git-dumper
  6. Reconstruct it by hand — so you know what the tool did
  7. The payoff — recover the 'deleted' secret from history
  8. HARDEN — block .git at the web server, then re-measure
  9. The remediation in the RIGHT order — and the honest limits

Open the full interactive lab →