A comprehensive penetration testing toolkit with multiple reconnaissance methods and security hardening.
FOR AUTHORIZED SECURITY TESTING ONLY
This tool is designed for legitimate security testing and educational purposes. Users must:
- Obtain written authorization before testing any systems
- Comply with all applicable laws and regulations
- Use responsibly and ethically
Unauthorized access to computer systems is illegal.
- Free Reconnaissance - DNS, WHOIS, HTTP headers (no API required)
- Shodan Integration - IP and host intelligence
- URLScan.io - Website analysis and technology detection
- Censys Integration - Certificate and host data
- FOFA Integration - Cyberspace search engine
- DNSDumpster - DNS reconnaissance
- Custom API Server - Build your own reconnaissance database
- Port Scanner - Nmap integration with service detection
- Subdomain Enumeration - Multi-source subdomain discovery
- Vulnerability Scanner - Web application testing
- XSS Detection - Cross-site scripting vulnerability detection
- SQL Injection Detection - Database vulnerability testing
β
Environment Variable Support - API keys loaded from .env (never committed)
β
Input Validation - Sanitization of user inputs to prevent injection
β
Secure Configuration - Gitignore protection for sensitive data
β
Port Validation - Range and format checking
β
Target Validation - Domain and IP address verification
- All API keys stored in environment variables
- Comprehensive .gitignore prevents credential exposure
- Input sanitization on all user-provided data
- Subprocess calls use validated parameters only
- No hardcoded credentials in source code
- Python 3.8+
- Nmap (for port scanning)
- Windows/Linux/MacOS
git clone https://github.com/yourusername/pentest-toolkit.git
cd pentest-toolkitpip install -r requirements.txt# Copy example files
Copy-Item .env.example .env
Copy-Item config.example.yaml config.yaml
# Edit .env with your API keys
notepad .envAdd your API keys to .env:
CENSYS_API_KEY=your_censys_key_here
SHODAN_API_KEY=your_shodan_key_here
FOFA_EMAIL[email protected]
FOFA_API_KEY=your_fofa_key_here
URLSCAN_API_KEY=your_urlscan_key_here
API_SERVER_KEYS=your_custom_key1,your_custom_key2python main.py --help# Free reconnaissance (no API required)
python main.py recon -t example.com -m free
# Shodan lookup
python main.py recon -t 8.8.8.8 -m shodan
# URLScan analysis
python main.py recon -t example.com -m urlscan
# Multiple methods
python main.py recon -t example.com -m free
python main.py recon -t example.com -m urlscan# Scan common ports
python main.py portscan -t example.com
# Custom port range
python main.py portscan -t example.com --ports 1-1000
# Specific ports
python main.py portscan -t example.com --ports 80,443,8080# Discover subdomains
python main.py subdomain -d example.com
# Use custom wordlist
python main.py subdomain -d example.com -w custom_wordlist.txt# Start API server
python api_server.py
# Test API (in another terminal)
curl -H "X-API-Key: your_custom_key" http://localhost:8000/healthpentest-toolkit/
βββ main.py # Main CLI entry point
βββ api_server.py # Custom reconnaissance API
βββ config.yaml # Configuration (gitignored)
βββ .env # Environment variables (gitignored)
βββ requirements.txt # Python dependencies
βββ SECURITY_REPORT.md # Security audit and recommendations
β
βββ src/
β βββ core/
β β βββ config.py # Configuration with env var support
β β βββ utils.py # Utilities with input validation
β β
β βββ modules/
β βββ reconnaissance/
β β βββ free_recon.py # Free DNS/WHOIS
β β βββ shodan_recon.py # Shodan integration
β β βββ censys_recon.py # Censys integration
β β βββ fofa_recon.py # FOFA integration
β β βββ urlscan_recon.py # URLScan.io
β β βββ dnsdumpster_recon.py # DNSDumpster
β β βββ subdomain_enum.py # Subdomain discovery
β β βββ port_scanner.py # Nmap integration
β β βββ custom_api_recon.py # Custom API client
β β
β βββ webapp/
β β βββ vulnerability_scanner.py
β β βββ xss_detector.py
β β βββ sqli_detector.py
β β
β βββ network/
β βββ password_attack.py
β βββ wireless.py
β
βββ data/
β βββ wordlists/
β βββ subdomains.txt
β
βββ output/ # Scan results (gitignored)
-
Shodan - https://account.shodan.io/
- Free tier: 100 query credits/month
- Provides IP intelligence and host data
-
URLScan.io - https://urlscan.io/user/signup
- Free tier: 1000 scans/day
- Website analysis and technology detection
-
Censys - https://search.censys.io/account/register
- Free tier: Limited searches
- Certificate and host intelligence
-
FOFA - https://en.fofa.info/
- Free tier available
- Cyberspace search engine
- NEVER commit
.envorconfig.yamlto git - Rotate keys regularly
- Use separate keys for testing and production
- Monitor API usage for anomalies
- Review
SECURITY_REPORT.mdfor detailed security audit - Ensure
.envis in.gitignore - Set strong, unique API keys
- Verify target authorization before scanning
- Config file uses environment variables for sensitive data
- Input validation on all user inputs
- Port ranges validated (1-65535)
- Domain/IP format verification
- No command injection vulnerabilities
- Use HTTPS for API server in production
- Implement rate limiting
- Enable audit logging
- Encrypt output files containing sensitive data
- Keep dependencies updated
DNS Records:
A: 93.184.216.34
MX: mail.example.com
WHOIS Info:
Registrar: Example Registrar
Creation Date: 1995-08-14
HTTP Headers:
Server: nginx
X-Frame-Options: DENY
Open Ports:
22/tcp - SSH (OpenSSH 8.0)
80/tcp - HTTP (nginx 1.18.0)
443/tcp - HTTPS (nginx 1.18.0)
- Verify API key in
.envfile - Check key format (no extra spaces)
- Ensure environment variables are loaded
- Ensure Python is in PATH
- Activate virtual environment if used
- Check file permissions
- Install Nmap: https://nmap.org/download.html
- Add Nmap to system PATH
- Restart terminal after installation
SECURITY_REPORT.md- Comprehensive security auditINSTALLATION.md- Detailed installation guideQUICKSTART.md- Quick start tutorialCOMMANDS.md- Complete command reference
Contributions welcome! Please:
- Fork the repository
- Create feature branch
- Add tests for new features
- Ensure security best practices
- Submit pull request
Report security vulnerabilities privately to: [email protected]
MIT License - See LICENSE file for details
- OWASP Top 10: https://owasp.org/www-project-top-ten/
- Python Security: https://python.readthedocs.io/en/latest/library/security_warnings.html
- Nmap Documentation: https://nmap.org/book/
- Shodan Documentation: https://developer.shodan.io/
# Setup
pip install -r requirements.txt
Copy-Item .env.example .env
# Edit .env with your API keys
# Basic Usage
python main.py recon -t example.com -m free # Free recon
python main.py recon -t 8.8.8.8 -m shodan # Shodan lookup
python main.py portscan -t example.com # Port scan
python main.py subdomain -d example.com # Find subdomains
# API Server
python api_server.py # Start server- Issues: https://github.com/yourusername/pentest-toolkit/issues
- Documentation: https://github.com/yourusername/pentest-toolkit/wiki
- Security: [email protected]
Remember: Always obtain authorization before testing any systems. Unauthorized access is illegal.