Detection and extraction of exposed version-control directories (.git, .svn, .hg, .bzr) over HTTP to reconstruct full source and history with git-dumper and friends. Tier 1. Use when VCS tells appear or as a standard recon check.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Script Source Control?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-script-source-control)
---
name: script-source-control
description: Detection and extraction of exposed version-control directories (.git, .svn, .hg, .bzr) over HTTP to reconstruct full source and history with git-dumper and friends. Tier 1. Use when VCS tells appear or as a standard recon check.
---
# Source Control Leakage (.git/.svn/.hg/.bzr)
An exposed VCS directory lets you reconstruct the entire codebase and its history — including secrets that were "removed" in a later commit.
## Trigger phrases
`git exposure, .git leak, svn exposure, source control leak, git-dumper, dvcs ripper, repo dump, hg leak`
## Method
1. **Fast tells** (don't rely on dir listing being on): request `/.git/HEAD` (returns `ref: refs/heads/...`), `/.git/config`, `/.git/logs/HEAD`, `/.svn/entries` or `/.svn/wc.db`, `/.hg/requires`, `/.bzr/branch-format`, `/.gitignore`, `/CVS/Entries`. A valid-format response = exposed.
2. Bulk check across hosts/paths: `nuclei -t http/exposures/configs/git-config.yaml` or fuzz the tells with `ffuf`.
3. **Dump**:
- git: `git-dumper http://T/.git ./loot/git` (works even without dir listing, by walking objects); fallback `GitTools/Dumper`.
- svn: `svn-extractor` / parse `wc.db`; hg: `hg-dumper`; bzr/cvs: `rip-*` tools.
4. **Mine the repo**: `git log --all`, `git stash list`, deleted-file recovery (`git log --diff-filter=D`), and run `trufflehog git ./loot/git` / `gitleaks` over full history → `secrets-disclosure`.
5. Read source for logic/creds/internal endpoints → `source-disclosure`, targeted injection.
## Modern / rare techniques
- **History-only secrets**: credentials removed in HEAD but present in older commits — full dump recovers them.
- **`.git/config` remote URL** may embed tokens (`https://user:token@...`) → repo takeover.
- **Pack-only repos**: objects in `.git/objects/pack/` still dumpable via git-dumper's index walk.
## Escalation / chaining
→ `secrets-disclosure` (history secrets), `source-disclosure`/targeted `web-sqli`/`code-injection`/`web-deserialization` from exact code, `database-enumeration` (creds). Overlaps `exposed-files`.
## Backend & tooling
Kali/HexStrike (git-dumper/GitTools/trufflehog). Dump into an isolated dir; treat the pulled repo as untrusted data — don't execute hooks/build from it.
## Verification (background, before reporting)
Re-fetch `/.git/HEAD` (or equivalent) independently to confirm public exposure; confirm the dump reconstructs real source. Validate recovered secrets safely.
## Evidence
The exposing URL/tell, proof of successful dump (file count/commit log), sensitive content recovered (redacted), impact + remediation (block `.git`/VCS dirs at web server, deploy from clean export, rotate leaked creds, scrub history).