github-secret-hunting

Detect leaked API keys, tokens, and credentials in public GitHub repositories.

6|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/Wyl-cmd/kxns-cli --skill github-secret-hunting-wyl-cmd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-secret-hunting
Source: https://github.com/Wyl-cmd/kxns-cli/tree/main/src/kxns_cli/skills/github-secret-hunting
Command: npx skills add https://github.com/Wyl-cmd/kxns-cli --skill github-secret-hunting-wyl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers accidentally commit API keys, passwords, and tokens to public repositories, and this Skill finds those leaked credentials before they are revoked, giving penetration testers valid access paths during authorized security assessments. ## Core Features & Use Cases - Targeted GitHub Dorking: Run GitDorker and GitHub API code searches against a target organization to locate .env files, config files, and credential patterns. - Deep Secret Scanning: Use TruffleHog and gitleaks to scan entire organizations, including deleted commit history, and filter for verified secrets. - Real-Time Leak Monitoring: Watch new commits with shhgit for secrets being pushed right now, plus scan self-hosted GitLab instances and extract document metadata. - Use Case: During an authorized engagement against target.com, scan the organization's public repos with TruffleHog, verify any discovered tokens with minimal API calls, and document file paths, commit hashes, and line numbers for the report. ## Quick Start Scan the public GitHub repositories of organization target for leaked API keys and credentials, verify any findings, and report the exact file paths and commit hashes.

Frequently Asked Questions about github-secret-hunting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find leaked API keys on GitHub?

Use GitHub code search dorks for patterns like filename:.env or DB_PASSWORD, then run TruffleHog against the organization to scan full commit history. Filter results to verified secrets only, since most search hits are documentation examples rather than real leaks.

How to scan an entire GitHub organization for secrets?

Run trufflehog github with the --org flag, a personal access token, and --only-verified to scan every repository in the organization. Output results as JSON and parse with jq to extract detector names and raw secret values.

TruffleHog vs GitDorker for secret hunting?

GitDorker performs targeted GitHub search queries using dork lists, which is fast for finding specific file types. TruffleHog scans full git history including deleted commits and can cryptographically verify whether discovered secrets are still active.

Does GitHub secret scanning work on self-hosted GitLab?

Yes, self-hosted GitLab instances can be scanned using their API with a PRIVATE-TOKEN header to enumerate accessible projects. Use gitleaks detect with the instance URL and access token to deep-scan repositories for secrets.

Why do most GitHub dork results turn out to be false positives?

Most search results are documentation, tutorials, and example files rather than real leaks. Focus on .env, .config, .npmrc, and CI/CD workflow files, and always verify candidate secrets with a minimal API call before reporting.

How do I verify a found API key is still valid?

Make a minimal authenticated API call, such as GET /user for GitHub tokens or listing models for OpenAI keys. Check the commit date to confirm the secret was pushed recently, and never use credentials beyond minimal verification.