Updated Jul 14, 2026

Misconfiguration

Rebuild a working tree from a public .git leak

gitjacker is a source-recovery tool that downloads git repositories exposed by sites where the .git directory was mistakenly uploaded and extracts their contents, retrieving a significant portion of the source even when directory listing is disabled.

installcurl -s https://raw.githubusercontent.com/liamg/gitjacker/master/scripts/install.sh | bash

Go · Unlicense license

Agent

overview

What gitjacker does

gitjacker downloads git objects from a site that shipped /.git/ in the web root, then rebuilds a working copy. Pass the target URL; turn on --verbose when you need per-step retrieval logs.

Partial recovery is the point. When directory listing returns 403, it still walks objects by hash and often recovers most of the tree, including config and committed credentials the app never meant to publish.

Run it after a finder flags a reachable .git. Prefer gitjacker for one-pass rebuild; use gittools-dumper plus extractor when you want the raw dump kept separate. Feed the folder into gitleaks next.

source github.com/liamg/gitjacker

use cases

Where gitjacker fits

Reconstruct source from an exposed .git

Point gitjacker at a URL whose .git directory is reachable and it rebuilds the repository, recovering code and config the site never meant to publish.

Recover repos with directory listing disabled

gitjacker walks git objects by hash, so it still pulls back a large share of the repository even when the server hides the folder contents.

Scan the recovered code for committed secrets

Hand the reconstructed repository to a tool like gitleaks so committed keys, tokens, and passwords in the git history surface as triaged findings.

Triage a .git exposure during a pentest

Confirm the impact of an exposed .git finding by recovering the real source, then report exactly which files, credentials, and internal logic were reachable.

reference

gitjacker inputs and flags

2 inputs
NameTypeFlagDescription
urlSTRING·Target URL of the site with an exposed .git directory.
verboseBOOLEAN--verboseEnable verbose logging of each retrieval and recovery step.

Showing key inputs. gitjacker exposes 2 inputs in total.

example

Run gitjacker

gitjacker · command
# download and rebuild the repo from an exposed .git directory
gitjacker --verbose https://example.com/
sample output
gitjacker v0.1.0
Retrieving .git/config from https://example.com/ ...
Walking loose and packed objects by hash...
Summary
=======
Status:            partial success
Objects retrieved: 318 (repo ~89% recovered)
Remote origin:     git@github.com:example/webapp.git
Secrets found:     .env, config/database.yml
Output written to: ./example.com

guidance

Choosing gitjacker

Use gitjacker when a host serves /.git/ and you need the source back in one step. Prefer the GitTools dumper/extractor chain when you want the raw dump preserved; always follow recovery with a secret scan.

gittools-dumper

Downloads the exposed .git only; pair with gittools-extractor to rebuild the tree.

gittools-dumper-extractor

GitTools dump and extract in one node; closest one-shot peer.

gitleaks

Secret scanner for the recovered repo; not a downloader.

faq

gitjacker questions

Yes. It follows git objects by hash instead of browsing the folder, so it can recover a large share of the repo even when the server returns 403 or 404 for directory indexes.

gittools-dumper downloads the raw .git, then gittools-extractor rebuilds the working tree. gitjacker does download and rebuild in one pass and is aimed at partial recovery when listing is disabled. Use gitjacker for a single rebuild node; keep the GitTools pair when you want the dumped .git preserved separately.

Point a secret scanner at the output folder. Feed it into gitleaks or trufflehog to walk commits for keys, tokens, and passwords.

Loose and packed objects, refs, and config, then blobs and trees reassembled into a working copy. Expect source, remotes in .git/config, env files, and deploy scripts. Recovery is often partial, not a guaranteed full clone.

Run a finder such as gittools-finder over a host list, then set gitjacker url to the hits. gitjacker recovers; it does not scan ranges for exposure.

Run gitjacker yourself

A target URL feeds gitjacker, which reconstructs the exposed repository and hands it to gitleaks so any committed secrets land as output.

Facts on this page come from the live Trickest tool library.