Ghemex is a CTI and OSINT tool designed to analyze public GitHub repositories and commit history to identify email addresses exposed through commit metadata.
Unlike basic API checks, it uses advanced techniques such as exhaustive branch/tag scraping and deep extraction via raw .patch files to recover identities that are often hidden from the standard web interface.
-
Automated Enumeration Full mapping of a target's public repositories using efficient API pagination.
-
Multithreaded Analysis Uses
ThreadPoolExecutorto speed up scanning across large datasets. -
Obfuscation Bypass Extracts emails from
From:headers inside raw commit.patchfiles. -
Rate Limit Handling Detects GitHub API limits (403/401) and applies automatic backoff to avoid bans.
-
Deduplication Filters out generic GitHub emails (e.g.
noreply.github.com) and keeps only unique results.
Clone the repository:
git clone https://github.com/intelshadow/ghemex.git
cd ghemexInstall dependencies:
pip install requests- Python 3.6+
- requests>=2.28.0
- A GitHub Personal Access Token (PAT) is optional for small targets
python ghemex.py <username> [options]| Flag | Description |
|---|---|
username |
Target GitHub username (required) |
-t, --token |
GitHub Personal Access Token |
-w, --workers |
Number of threads (default: 10) |
--full |
Scan all branches and tags |
--deep |
Deep scraping via raw .patch headers |
-r, --repo |
Limit the scan to a single repository (skips listing/scanning the rest of the user's repos) |
--skip-forks |
Skip forks when scanning all repos — forks share commit history with the original, so scanning them rarely turns up new emails and just burns API quota |
A token is not required for targets with few repositories when running without
--fullor--deep. For larger targets or intensive scans, a token is strongly recommended to avoid hitting the unauthenticated API rate limit (60 req/hour).
Basic scan (no token needed for small targets):
python ghemex.py targetuserAuthenticated scan with full branch and tag coverage:
python ghemex.py targetuser -t ghp_yourtoken --fullFull deep scan:
python ghemex.py targetuser -t ghp_yourtoken --full --deep -w 15Scan only one repository (cheapest option on API quota):
python ghemex.py targetuser -r some-repo -t ghp_yourtokenFull scan skipping forks (avoids re-scanning commits already covered by the original repo):
python ghemex.py targetuser -t ghp_yourtoken --skip-forks --fullThis tool is intended for educational purposes. Use it only on accounts you own or have explicit written permission to analyze. The author is not responsible for any misuse or damage caused by this tool. Always comply with GitHub's Terms of Service and applicable laws.