Hunt hardcoded credentials in source code and git history: detection regexes, gitleaks/trufflehog/noseyparker commands, Shannon entropy, cloud-key signatures, and the files where secrets actually leak. (47 payloads)
AKIA[0-9A-Z]{16}(?i)aws_secret_access_key\s*[=:]\s*["']?([A-Za-z0-9/+=]{40})ghp_[0-9A-Za-z]{36}(sk|rk)_(live|test)_[0-9a-zA-Z]{24,99}AIza[0-9A-Za-z\-_]{35}xox[baprs]-[0-9A-Za-z-]{10,72}eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}-----BEGIN (RSA |EC |OPENSSH |DSA |PGP )?PRIVATE KEY-----(?i)(api[_-]?key|secret|token|passwd|password|pwd|auth)\s*[=:]\s*["']([^"'\s]{8,})["'](?i)(?:bearer)\s+[a-z0-9._\-]{20,}(?i)(postgres|postgresql|mysql|mongodb(\+srv)?|redis|amqp)://[^:@\s]+:[^@\s]+@[^/\s]+(?i)-p\s*['\"]?[^\s'\"]{6,}|--password[= ]['\"]?[^\s'\"]{6,}[A-Za-z0-9+/]{40,}={0,2}(?i)(slack|discord|telegram)\.com/(api/webhooks|services)/[A-Za-z0-9_/-]+(?i)(twilio|sendgrid|mailgun|datadog|npm|figma|heroku|do)[_-]?(api[_-]?)?(key|token|secret)H = -Σ p(x) · log2 p(x) (bits/char)base64 threshold ≈ 4.5 bits/char · hex ≈ 3.0 bits/charpython3 -c "import math,sys;s=sys.argv[1];print(round(-sum((s.count(c)/len(s))*math.log2(s.count(c)/len(s)) for c in set(s)),2))" "AKIAIOSFODNN7EXAMPLE"trufflehog filesystem . --no-verification --results=verified,unknownWhy entropy alone fails: minified JS, UUIDs, hashes, git SHAs, and base64 assets all score high.Combine entropy + keyword proximity: a high-entropy value within ~20 chars of 'key/token/secret' is a strong hit.gitleaks detect --source . --redact -vgitleaks detect --source . --log-opts="--all --since=2024-01-01"gitleaks dir . --report-format json --report-path leaks.jsongitleaks git --log-opts="-p" --baseline-path baseline.jsongitleaks protect --staged -v# .gitleaks.toml → [[rules]] id, regex, keywords + [allowlist] paths/regexestrufflehog git https://github.com/org/repo --only-verifiedtrufflehog github --org=acme --only-verified --include-memberstrufflehog filesystem /path/to/code --json | jq '.SourceMetadata'trufflehog docker --image=org/app:latest --only-verifiednoseyparker scan --git-history full ./repo && noseyparker reportnoseyparker scan --enumerator git-history=full --rules-path custom.yaml ./targetsgit log -p -S 'AKIA' --allgit log --all --full-history -- '*.env' '*.pem' '*id_rsa*'git show <commit>:path/to/.envgit rev-list --all | xargs -I{} git grep -I -i -e 'password' -e 'secret' {} 2>/dev/nullgit fsck --lost-found && git cat-file -p <sha>Remediation: rotate the secret FIRST, then rewrite history (git-filter-repo / BFG)..env .env.local .env.production .envrcFrontend bundles: main.*.js, chunk-*.js, source maps (.map)CI/CD: .github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile, circle configContainers: Dockerfile (ARG/ENV), docker-compose.yml, image layersConfigs & infra: settings.py, application.properties, *.tfstate, *.tfvars, k8s manifestsMobile: APK/IPA — strings, res/values/strings.xml, BuildConfig, decompiled smaliLogs, notebooks & exports: *.log, *.ipynb outputs, *.har, Postman/Insomnia collectionsGitHub side-channels: gists, issues/PR comments, wiki, Actions logs, commit messagesLevel up your security testing
Install the CLI
npx payload-playgroundExplore All Tools
Encoding, hashing, JWT & more
Browse Cheat Sheets
Quick-reference payload guides
It's a quick-reference collection of 47 Secrets in Code payloads for testing Finding Secrets in Code vulnerabilities during authorized penetration testing, bug bounties, and CTFs. Every payload is copy-ready and grouped by attack context.
Copy any payload straight into your authorized test, or use the Secret Scanner to apply them interactively. Only test systems you have explicit permission to assess.
Yes — this cheat sheet and all Secrets in Code payloads are completely free, with no account required. Everything runs in your browser.