EnvHunter ๐Ÿ”

EnvHunter is a Ruby-based CLI tool that searches GitHub repositories or gists for .env files containing potentially sensitive high-entropy secrets like API keys or tokens.

โš™๏ธ Features

  • ๐Ÿ”Ž Searches GitHub repos or gists for .env files
  • ๐Ÿงช Detects .env variables with names containing KEY or TOKEN
  • ๐Ÿ“ˆ Filters secrets based on entropy (Shannon entropy)
  • ๐Ÿ’ฌ Outputs results in terminal, json, or csv formats
  • ๐Ÿ” Uses GitHub API (requires a Personal Access Token)

๐Ÿงฐ Installation

As a Ruby Gem

gem install envhunter

Or clone and build locally:

git clone https://github.com/yourusername/envhunter.git
cd envhunter
gem build envhunter.gemspec
gem install envhunter-1.0.0.gem

๐Ÿณ Docker

docker build -t envhunter .
docker run --rm -e GITHUB_TOKEN=your_token_here envhunter scan --mode gists --format json

๐Ÿš€ Usage

envhunter scan [options]

Options

Option Description
--mode repos (default) or gists
--format terminal, json, or csv

๐Ÿ” Authentication

Set your GitHub token:

export GITHUB_TOKEN=your_token_here

๐Ÿ“Š Output Example

=== High Entropy Keys Found ===

User: johndoe
Repo/Gist: johndoe/myrepo
File: .env
Match:
  API_TOKEN=abcd123...
----------------------------------------

๐Ÿ“ License

MIT License ยฉ 2025 Dave Williams [email protected]