TruffleHog
TruffleHog finds, classifies and can verify leaked credentials across git history, filesystems and other sources.
Legal & ethical use. Use this tool only on systems, networks and data that you own or have explicit written permission to test. Unauthorised access or scanning can break computer-misuse laws (for example Pakistan's Prevention of Electronic Crimes Act, 2016, and equivalents elsewhere). Practise in your own lab or in authorised environments such as CTFs.
What it is used for
- Find exposed credentials in your repositories
- Verify whether a found key is still active (when supported)
Key features
- Hundreds of detectors
- Credential verification
- Many source types
Installation
See the README for install scripts, Docker and packages.
Beginner usage guide
Scan a repository you own and immediately rotate any key reported as verified.
Example commands
Run these only against your own lab or authorised targets. Placeholder addresses such as 192.0.2.x are documentation ranges.
Scan a git repository
trufflehog git https://github.com/your-org/your-repo --only-verified--only-verified shows only credentials that the detector could confirm as active.
Keep learning
🚩 Practice challenge: Secrets in History easy
References
Source verification
Last reviewed: 2026-10-27
Links checked over HTTP: 2026-10-27 07:51 UTC — official: 200, docs: 200, repo: 200
Commands were written from the official documentation and have not been executed on this site; test them in your lab.
