Git-Hound : PinPoints Exposed API Keys On GitHub Using Pattern Matching

A batch-catching, pattern-matching, patch-attacking secret snatcher. GitHound pinpoints exposed API keys on GitHub using pattern matching, commit history searching, and a unique result scoring system. A batch-catching, pattern-matching, patch-attacking secret snatcher.

Features

  • GitHub/Gist code searching. This enables GitHound to locate sensitive information exposed across all of GitHub, uploaded by any user.
  • Generic API key detection using pattern matching, context, and Shannon entropy.
  • Commit history digging to find improperly deleted sensitive information (for repositories with <6 stars)..
  • Scoring system to emphasize confident results, filter out common false positives, and to optimize intensive repo digging.
  • Base64 detection and decoding
  • Options to build GitHound into your workflow, like custom regexes and results-only output mode.

Usage

echo “tillsongalloway.com” | git-hound or git-hound –subdomain-file subdomains.txt

Setup

  • Download the latest release of GitHound
  • Create a ./config.yml or ~/.githound/config.yml with your GitHub username and password (2FA accounts are not supported). See config.example.yml.
    1. If it’s your first time using the account on the system, you may receieve an account verification email.
  • echo "tillsongalloway.com" | git-hound

Use Cases

  • Corporate: Searching for exposed customer API keys

Knowing the pattern for a specific service’s API keys enables you to search GitHub for these keys. You can then pipe matches for your custom key regex into your own script to test the API key against the service and to identify the at-risk account.

echo “api.halcorp.biz” | githound –dig –many-results –regex-file halcorp-api-regexes.txt –results-only | python halapitester.py

For detecting future API key leaks, GitHub offers Push Token Scanning to immediately detect API keys as they are posted.

  • Bug Bounty Hunters: Searching for leaked employee API tokens

My primary use for GitHound is for finding sensitive information for Bug Bounty programs. For high-profile targets, the --many-results hack and --languages flag are useful for scraping >100 pages of results.

echo “uberinternal.com” | githound –dig –many-results –languages common-languages.txt –threads 100

Also Read – MSSQLi-DUET : MSSQL Injection-based Domain User Enumeration Tool

Flags

  • --subdomain-file – The file with the subdomains
  • --dig-files – Clone and search the repo’s files for results
  • --dig-commits – Clone and search the repo’s commit history for results
  • --many-results – Use result sorting and filtering hack to scrape more than 100 pages of results
  • --results-only – Print only regexed results to stdout. Useful for piping custom regex matches into another script
  • --no-repos – Don’t search repos
  • --no-gists – Don’t search Gists
  • --threads – Specify max number of threads for the commit digger to use.
  • --regex-file – Supply a custom regex file
  • --language-file – Supply a custom file with languages to search.
  • --config-file – Custom config file (default is config.yml)
  • --pages – Max pages to search (default is 100, the page maximum)
  • --no-scoring – Don’t use scoring to filter out false positives
  • --no-api-keys – Don’t perform generic API key searching. GitHound uses common API key patterns, context clues, and a Shannon entropy filter to find potential exposed API keys.
  • --no-files – Don’t flag interesting file extensions
  • --only-filtered – Only search filtered queries (languages)
  • --debug – Print verbose debug messages.

Related Tools

  • GitRob is an excellent tool that specifically targets an organization or user’s repositories for exposed credentials and displays them on a beautiful web interface.
R K

Recent Posts

Pyxel : A Complete Guide To The Python-Based Game Engine

With simple specifications inspired by retro gaming consoles, such as displaying only 16 colors and…

21 minutes ago

Shadowsocks : The Ultimate Guide To Features, Installation, And Configuration

hickory-dns - Uses hickory-resolver as DNS resolver instead of tokio's builtin. local-http - Allow using…

26 minutes ago

Syscall Tables : Evolution From NT5 To NT11

Syscall tables are critical components of operating systems, mapping system calls to their respective kernel…

31 minutes ago

GitButler : Revolutionizing Branch Management With Virtual Branches

GitButler is a git client that lets you work on multiple branches at the same…

1 day ago

Minegrief : Unpacking A Crafty Minecraft Malware

Self-spreading to other Minecraft servers using an extendable, module-based lateral movement system. Crafty Controller Auth'd…

1 day ago

ModTask – Task Scheduler Attack Tool

ModTask is an advanced C# tool designed for red teaming operations, focusing on manipulating scheduled…

3 days ago