Git Tools
Git Commands
# Move within the .git directory
cd .git
# List commits
git log
# Write commits to a file
git log | grep commit | cut -d " " -f2 | xargs git show > commits# Show the specified commit's content
git show <commit-id># extract author name and email
git log --pretty-format:"%an %ae" | sort -u
git log | grep Author | grep -oP '(?<=Author: ).*' | sort -u | tr -d '<>'Tools
Git-Dumper is a tool designed to dump Git repositories exposed on websites.
git-dumper <URL>/.git/ <output-dir>For an example see here.
Gitjacker is a tool that downloads and extracts Git repositories from websites where the .git directory is unintentionally exposed, even when directory listings are disabled.
sudo gitjacker <URL> -o <output-dir>GitTools includes three lightweight Python and Bash scripts for Git repository analysis:
gitfinderdetects websites with exposed.gitdirectories by checking for a valid.git/HEAD.gitdumperattempts to recover as much data as possible from those repositories, even without directory listing.extractortries to reconstruct incomplete Git commits and their contents by iterating through commit objects.
# Identify websites with publicly accessible .git repos
$ ./gitfinder.py -i <input-file> -o <output-file>
# Download the files found in the .git repo
$ ./gitdumber.sh <URL>/.git/ <output-dir>
# Extract commits from a broken repo (can be used after gitdumber.sh)
$ ./extractor.sh <.git-directory> <output-dir>For an example see here.
Last updated
Was this helpful?