Skip to main content

GitHacker

PyPI version PyPI downloads Site

A multi-threaded .git folder exploitation tool. Reconstructs the target repository in full — source code, commit history, branches, stashes, remotes, tags — even when DirectoryListings is disabled, by brute-forcing well-known refs.

The accompanying research site at https://githacker.pages.dev publishes:

  • A reproducible Benchmark against six other pillagers (GitTools, dvcs-ripper, GitHack, git-dumper, dumpall, rbozburun/git-hacker) across five web-server scenarios.
  • An adversarial Security suite that runs every tool against malicious .git/ directories and tracks coordinated disclosure of findings.
  • Methodology and Reproduce pages with every detail needed to re-run the harness locally.

Safety

The remote .git you are downloading may be malicious. Published research demonstrates code execution, arbitrary file write, and SSRF against pillagers via crafted .git/config, hooks, submodules, LFS objects, and HTTP redirects. Run GitHacker in a disposable container:

docker run -v $(pwd)/results:/tmp/githacker/results \
  wangyihang/githacker \
  --url http://target/.git/ \
  --output-folder /tmp/githacker/results

The Security page tracks both GitHacker's own hardening history and pre-disclosure findings against other pillagers.

Quick start

Docker (recommended)

# Help
docker run wangyihang/githacker --help

# Single target
docker run -v $(pwd)/results:/tmp/githacker/results \
  wangyihang/githacker \
  --url http://target/.git/ \
  --output-folder /tmp/githacker/results

# Brute-force branch and tag names (use when directory listing is off)
docker run -v $(pwd)/results:/tmp/githacker/results \
  wangyihang/githacker --brute \
  --url http://target/.git/ \
  --output-folder /tmp/githacker/results

# Multiple targets, one URL per line
docker run -v $(pwd)/results:/tmp/githacker/results \
  -v $(pwd)/websites.txt:/websites.txt \
  wangyihang/githacker --brute \
  --url-file /websites.txt \
  --output-folder /tmp/githacker/results

pip

pip install GitHacker

githacker --help
githacker --url http://target/.git/ --output-folder result
githacker --brute --url http://target/.git/ --output-folder result
githacker --brute --url-file websites.txt --output-folder result

Requirements: git >= 2.11.0, Python 3.10+.

Comparison

Side-by-side results live on the dashboard so the table doesn't drift out of sync with reality: https://githacker.pages.dev/benchmark.

The benchmark regenerates on every benchmark run (weekly via GitHub Actions, and on demand). At the time of writing, GitHacker is the only tool that recovers 100% of artifacts across all five web-server scenarios and 100% PASS on the published adversarial corpus.

Development

Set up:

git clone https://github.com/WangYihang/GitHacker
cd GitHacker
uv sync --group dev

Run unit tests:

uv run pytest

Run the full benchmark / security harnesses (needs Docker):

python -m benchmark run        # 7 tools × 5 web-server scenarios
python -m benchmark security   # adversarial corpus

Both write JSON into docs/public/data/; the docs site picks them up on its next build. Full harness design: https://githacker.pages.dev/methodology.

Demo

Demo

References

Acknowledgements

  • Justin Steven — original core.fsmonitor / recursive-downloader advisories (2022).
  • Driver Tom — generic counter-attacks against source-code pillagers (2021).
  • Zac Wang (@7a6163) — path-traversal in add_head_file_tasks / add_hashes_parsed (CVE pending; folded into the single-trust-gate fix at 5f2a8ba).
  • lesion1999 — contributor.
  • shashade250 — contributor.

License

THE DRINKWARE LICENSE

<wangyihanger@gmail.com> wrote this file. As long as
you retain this notice you can do whatever you want
with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me the following
drink(s) in return.

Red Bull
JDB
Coffee
Sprite
Cola
Harbin Beer
etc

Wang Yihang

Release files for githacker 1.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for githacker 1.1.10
File Size Uploaded
githacker-1.1.10.tar.gz 28.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for githacker 1.1.10
File Interpreter ABI Platform
githacker-1.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 42.3 kB

Release files / githacker-1.1.10.tar.gz

Download URL githacker-1.1.10.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b9b244506e0b8e6b76a5fd1c9d449f6d2fea438cbc882d0778eacb27e570d319
BLAKE2b-256 checksum
How to use checksums
aadf8d058c7aae633b2ca860dbdf13f0c15ceff3a79fde22e3591ce125125375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / githacker-1.1.10-py3-none-any.whl

Download URL githacker-1.1.10-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d0f182706f85cc7b92432e4082698897e331cc4246da695ffad0bfdff8c00c3
BLAKE2b-256 checksum
How to use checksums
369a9a3598078a94037c9f0f9c68fda91a62530aa03d3ffe67387397dbcccb65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.1.10 This release

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.11

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page