pentest-secrets-exposure
Discover hardcoded credentials, leaked API keys, exposed configuration files, sensitive data in artifacts, and information disclosure via error handling.
Works with
--- name: pentest-secrets-exposure description: Discover hardcoded credentials, leaked API keys, exposed configuration files, sensitive data in artifacts, and information disclosure via error handling. license: Apache-2.0 --- # Pentest Secrets Exposure ## Purpose Spans multiple unchecked WSTG categories — CONF-03/04 (sensitive files, backups), INFO-05 (info leakage), ERRH-01/02 (error handling, stack traces). Shannon's pre-recon focuses on architecture, not systematic secrets discovery. ## Prerequisites ### Authorization Requirements - **Written authorization** with source code access scope (if white-box) - **Git repository access** for history mining (if applicable) - **Target URL list** for exposed file probing ### Environment Setup - TruffleHog for git history secret scanning - GitLeaks for pattern-based secret detection - Semgrep with secrets ruleset - nuclei with exposure templates ## Core Workflow 1. **Source Code Secrets**: Scan for hardcoded API keys, DB credentials, JWT signing keys, encryption keys using pattern + entropy detection. 2. **Git History Mining**: Search all commits for secrets added then removed. Check force-pushed branches. Analyze .gitignore for sensitive patterns. 3. **Exposed Config Files**: Probe for .env, .git/config, .DS_Store, wp-config.php, application.yml, docker-compose.yml with credentials (WSTG-CONF-03/04). 4. **Error Handling Disclosure**: Trigger stack traces, debug pages, verbose errors revealing internal paths, DB schemas, framework versions (WSTG-ERRH-01/02). 5. **Backup & Unreferenced Files**: .bak, .old, .swp, ~files, editor temp files, DB dumps, log files with sensitive data. 6. **Client-Side Bundle Analysis**: Extract API keys from JS bundles, source maps exposing server code, hardcoded tokens in mobile packages. 7. **Secret Validation**: Test each discovered credential for active access, document scope, assess blast radius. ## WSTG Coverage | WSTG ID | Test Name | Status | |---------|-----------|--------| | WSTG-CONF-03 | Test File Extensions Handling for Sensitive Info | ✅ | | WSTG-CONF-04 | Review Old Backup and Unreferenced Files | ✅ | | WSTG-INFO-05 | Review Webpage Content for Information Leakage | ✅ | | WSTG-ERRH-01 | Test Improper Error Handling | ✅ | | WSTG-ERRH-02 | Test Stack Traces | ✅ | ## Tool Categories | Category | Tools | Purpose | |----------|-------|---------| | Git Scanning | TruffleHog, GitLeaks | Secret detection in git history | | Static Analysis | Semgrep (secrets rules), grep patterns | Source code secret scanning | | Web Probing | nuclei (exposure templates), ffuf | Exposed file/config discovery | | JS Analysis | SecretFinder, LinkFinder | Client-side bundle secret extraction | | Validation | curl, custom scripts | Credential active-access testing | ## References - `references/tools.md` - Tool function signatures and parameters - `references/workflows.md` - Attack pattern definitions and test vectors
More Security skills
azure-cost
microsoft/azure-skills
Azure cost management: query costs, forecast spending, optimize to reduce waste. WHEN: \"Azure costs\", \"Azure bill\", \"cost breakdown\", \"how much am I spending\", \"forecast spending\", \"optimize costs\", \"reduce spending\", \"orphaned resources\", \"rightsize VMs\", \"cost spike\", \"reduce storage costs\", \"AKS cost\". DO NOT USE FOR: deploying resources, provisioning, diagnostics, or security audits.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
azure-messaging
microsoft/azure-skills
Troubleshoot and resolve issues with Azure Messaging SDKs for Event Hubs and Service Bus. Covers connection failures, authentication errors, message processing issues, and SDK configuration problems. WHEN: event hub SDK error, service bus SDK issue, messaging connection failure, AMQP error, event processor host issue, message lock lost, message lock expired, lock renewal, lock renewal batch, send timeout, receiver disconnected, SDK troubleshooting, azure messaging SDK, event hub consumer, service bus queue issue, topic subscription error, enable logging event hub, service bus logging, eventhub python, servicebus java, eventhub javascript, servicebus dotnet, event hub checkpoint, event hub not receiving messages, service bus dead letter, batch processing lock, session lock expired, idle timeout, connection inactive, link detach, slow reconnect, session error, duplicate events, offset reset, receive batch.

