Repository navigation
GitHub Secret Hunting
📖 Canonical version: read this page on the official docs site — https://www.redamon.org/docs/github-secret-hunting. The GitHub wiki is a mirror.
RedAmon includes a GitHub Secret Hunter module that searches GitHub repositories for exposed secrets, API keys, and credentials related to your target. It runs as an independent module (separate from the recon pipeline), triggered from the Red Zone toolbar.
The scanner uses 40+ regex patterns and Shannon entropy analysis to detect:
- AWS access keys and secret keys
- Google Cloud credentials and service account keys
- Database connection strings (MongoDB, PostgreSQL, MySQL, Redis)
- JWT tokens and session secrets
- Private RSA/SSH keys
- Slack, Discord, Stripe, Twilio, Sendgrid tokens
- Generic API keys and passwords in code
- And many more credential patterns
The scanner requires a Personal Access Token (PAT) for API access. The token is used exclusively for read-only scanning — it never creates, modifies, or deletes anything on GitHub.
- Go to GitHub.com and click your profile picture (top-right) then Settings
- In the left sidebar, scroll down and click Developer settings
- Click Personal access tokens then Tokens (classic)
- Click Generate new token then Generate new token (classic)
- Give it a descriptive name (e.g.,
redamon-secret-scan) - Set an expiration (recommended: 30 or 90 days)
- Select these scopes:
| Scope | Required? | Purpose |
|---|---|---|
repo |
Yes | Full access to public and private repositories. Without this scope, only public repos are scanned. |
read:org |
If scanning orgs | List organization repositories and members |
gist |
If scanning gists | Access public and private gists |
Private repos: The
reposcope grants access to all private repositories the token owner can see. To scan only specific private repos, use a fine-grained personal access token and grant access to individual repositories — this is the most secure option.
- Click Generate token and copy the token immediately (starts with
ghp_). You won't see it again.
- Go to your project settings (Projects page > click project card)
- Navigate to the Integrations tab (Tab 9)
- Enter your settings:
| Field | Description |
|---|---|
| GitHub Access Token | Paste your ghp_... token. All other fields are disabled until this is set. Supply Chain has its own token; setting one does not set the other |
| Target Organization | The GitHub org name or username to scan (e.g., example-inc or johndoe) |
| Target Repositories | Comma-separated repo names to limit scope (e.g., webapp, api-server). Leave empty to scan all |
| Scan Member Repositories | Also scan repos of individual org members (significantly increases scope) |
| Scan Gists | Search gists for leaked secrets |
| Scan Commits | Examine commit history (catches secrets committed and later removed). Most expensive — disabling saves 50%+ time |
| Max Commits to Scan | Maximum commits per repo (default: 100). Scales linearly: 500 = ~5x time |
| Output as JSON | Save complete results as a downloadable JSON file |
- Click Save
- On the Red Zone, click Other Scans (blue, GitHub icon) in the toolbar
- In the modal, find the GitHub Secret Hunt card and click Start

- Click the Logs button to watch real-time progress
- Pause / Resume suspend and continue the run; Stop ends it
- When complete, click the Download button to save results as JSON
The modal also holds the Secret Multiscanner and the Supply Chain Scanner. Each card is independent: starting one does not block the others.
GitHub Hunt findings are stored in the Neo4j graph:
- GithubHunt → Repository → Secret / SensitiveFile nodes
- Each secret includes: file path, matched pattern name, how many times it matched in that file, and a redacted sample of the first match: its first six and last four characters (
AKIAQ7...B3V6), as JS Recon shows a secret. For a keyword pattern the sample is taken from the whole match (passwo...Z8w"), never just the keyword. The graph never holds the full value; the downloadable JSON keeps it, in each finding'svalue, and the scan log prints it as[REDACTED]. - A secret recorded by an earlier release may still hold the raw match, or for a keyword pattern only the word
password, until the next hunt rewrites it. The Red Zone shows every sample redacted either way. - The hunt shares JS Recon's patterns, including the bounded keyword patterns and the stricter Azure AD client secret (details). A key that is public by design (a publishable or browser key, a DSN) committed to a repo is shown at info in the Red Zone and counted apart in the report and Insights.
The AI agent can access these findings through graph queries and incorporate them into its attack analysis.
| Parameter | Default | Description |
|---|---|---|
| GitHub Access Token | — | PAT for GitHub API access (ghp_...) |
| Target Organization | — | GitHub org or username to scan |
| Target Repositories | (all) | Comma-separated repo names to limit scope |
| Scan Member Repositories | false | Include individual member repos |
| Scan Gists | false | Search gists for secrets |
| Scan Commits | false | Examine git history for removed secrets |
| Max Commits to Scan | 100 | Max commits per repo (1-1000) |
| Output as JSON | false | Save results as downloadable JSON |
- Secret Multiscanner - the deep companion to this scanner. GitHub Hunting is the public-internet sweep over the code search index; the Secret Multiscanner clones a known repo or org and walks every commit (including deleted and force-pushed ones), and reaches 13 other kinds of target besides GitHub. It also verifies a credential against the owning API. It has its own GitHub token, separate from this one
- AI Agent Guide — use the AI agent to analyze all findings including leaked secrets
Getting Started
- Getting Started
- Deploying to a Server
- Identity & Access Management
- Creating a Project
- Recon Presets
- Global Settings
Core Workflow
- Red Zone
- Recon Pipeline Workflow
- Running Reconnaissance
- Scan Timeline
- AI Agent Guide
- Fireteam — Parallel Specialists
- Exploit-Path Search (LATS)
- Agent Workspace
- Wordlist Catalog
- Reverse Shells
Scanning & OSINT
- AI in the Recon Pipeline
- Adversarial AI Recon
- AI Gauntlet
- JS Reconnaissance
- GraphQL Security Testing
- Subdomain Takeover Detection
- VHost & SNI Enumeration
- TLS Certificate Grab
- Web Cache Poisoning
- Serialized Object Detection
- Route Exposure Scan
- Origin Discovery
- GVM Vulnerability Scanning
- GitHub Secret Hunting
- Secret Multiscanner
- Supply-Chain Scanning
AI & Automation
- AI Navigator
- AI Model Providers
- MCP Tool Plugins
- MCP Server
- Knowledge Base & Web Search
- Agent Skills
- Chat Skills
- White-Box Mode
- Tradecraft Library
- CVE Intel
- Playwright Browser Automation
- CypherFix — Automated Remediation
- Priority Board
- Rules of Engagement (RoE)
Plugins
HackLab
Analysis & Reporting
- Insights Dashboard
- TrafficMind
- Authenticated Session Recording
- proxy_brain — web hacking in code
- Pentest Reports
- Attack Surface Graph
- Surface Shaper
- EvoGraph — Attack Chain Evolution
- Data Export & Import
- Logs
Contributing
Reference & Help