Kali Linux

Gitbleed_Tools : For Extracting Data From Mirrorred Git Repositories

Gitbleed_Tools, this repo contains shell scripts that can be used to download and analyze differences between cloned and mirror Git repositories. For more information about the underlying quirk in Git behavior, please visit read our blog post.

What Do These Scripts Do?

These scripts will clone a copy of the given Git repository, both as regular clone and mirrored (“–mirror”) option. It will then create a delta between the two, seeking to find the parts of the repository that are only available in mirror mode. Last, gitleaks will be run to see if any secrets are present in the delta portion, and “git log” will be used to create a single file containing the bodies of the commits so they can be analyzed easier.

Please note that since this script creates three copies of the repository, it may consume a lot of disk space.

Example repositories

You can test these tools on the following two example repositories:

  • gb_testrepo_delete – repository hiding secrets via deleted commits
  • gb_testrepo_reset – repository hiding secrets via “git reset”

Requirements

You will need Git, Python 3. GitLeaks and git-filter-repo to be installed. Here is an example of installing these on MacOS:

brew install git python3 gitleaks git-filter-repo

How to Install and Run

You can run this againt a repository as follows:

git clone https://github.com/nightwatchcybersecurity/gitbleed_tools.git
cd gitbleed_tools
./gitbleed.sh https://github.com/nightwatchcybersecurity/gitbleed_tools.git example

This will create an example folder containing three subfolders:

  • clone – contains the cloned repository
  • delta – contains the mirrrored repository minus all of the commits in the “clone”
  • mirror – contains the mirrored repository cloned with the “–mirror” option

There are also three files created:

  • clone_hashes.done.txt – list of hashes in the cloned repository
  • gitleaks.json – results from running gitleaks
  • gitlog.txt – all commits from the delta folder concatenated into a single file
R K

Recent Posts

JBDev : A Tool For Jailbreak And TrollStore Development

JBDev is a specialized development tool designed to streamline the creation and debugging of jailbreak…

3 hours ago

Kereva LLM Code Scanner : A Revolutionary Tool For Python Applications Using LLMs

The Kereva LLM Code Scanner is an innovative static analysis tool tailored for Python applications…

5 hours ago

Nuclei-Templates-Labs : A Hands-On Security Testing Playground

Nuclei-Templates-Labs is a dynamic and comprehensive repository designed for security researchers, learners, and organizations to…

6 hours ago

SSH-Stealer : The Stealthy Threat Of Advanced Credential Theft

SSH-Stealer and RunAs-Stealer are malicious tools designed to stealthily harvest SSH credentials, enabling attackers to…

6 hours ago

ollvm-unflattener : A Tool For Reversing Control Flow Flattening In OLLVM

Control flow flattening is a common obfuscation technique used by OLLVM (Obfuscator-LLVM) to transform executable…

6 hours ago

Cybersecurity – Tools And Their Function

Cybersecurity tools play a critical role in safeguarding digital assets, systems, and networks from malicious…

1 day ago