๐Ÿ” Credential Harvester Pro auto-chunk ยท multi-protocol v2.0

Bulk security assessment tool that scans thousands of domains, extracts leaked credentials from config files (WordPress, Laravel, CodeIgniter, .env, FTP/SFTP configs), and validates live MySQL / FTP / SSH connections.

โšก Automated credential intelligence โ€” discover exposed database passwords, FTP secrets, and SSH keys hidden in common configuration backups. Built for security researchers, pentesters, and blue teams with intelligent memory chunking and multithreading.

โœจ Core capabilities

๐Ÿ“ 10+ config patterns

WordPress (wp-config.php), Laravel .env, CodeIgniter database.php, SFTP/FTP json configs, Symfony DATABASE_URL, custom MySQL env vars.

๐Ÿง  Auto chunking & memory guard

Processes millions of domains by splitting into chunks, enforcing RAM limits, and automatic garbage collection. No crashes.

๐ŸŒ Multi-protocol validation

Tests MySQL, FTP (port 21), SSH/SFTP (port 22) credentials in real time using pymysql, ftplib, paramiko.

โš™๏ธ Smart host resolution

Automatically resolves 'localhost' / '127.0.0.1' to target domain IP, fallback to domain name for external access.

๐Ÿš€ Thread pool per chunk

Adjustable thread count (default 50) for maximum speed while respecting rate limits.

๐Ÿ“„ Structured output

Separate files for all found credentials, valid MySQL, valid FTP, valid SSH โ€“ clean CSV-like format with metadata.

๐Ÿ“ฆ Dependencies & installation

pip install requests paramiko pymysql colorama psutil

Requirements: Python 3.7+ ยท internet connectivity for HTTP requests & service validation.

โœ… The script suppresses Paramiko & SSL warnings to keep console clean. For best performance, use on Linux/macOS with stable network.

๐Ÿš€ Command-line usage

python cred_harvester.py -f domains.txt [options]
ArgumentDescriptionDefault
-f, --fileRequired โ€” path to domain list (one domain per line)โ€”
-t, --threadsNumber of concurrent threads per chunk50
--limitLimit total domains to process (useful for testing)None (all)
--chunk-sizeDomains per chunk (controls memory footprint)1000
--mem, --memory-limitRAM ceiling in MB before forced GC500

๐Ÿ“Œ Examples

# Basic scan with 100 threads, chunk 2000 domains
python harvest.py -f targets.txt -t 100 --chunk-size 2000
# Limit to first 5000 domains, memory limit 1GB
python harvest.py -f big_list.txt --limit 5000 --mem 1024

๐Ÿงฉ Workflow & detection logic

The script follows a systematic reconnaissance approach for each domain (both HTTP and HTTPS):

  1. Probes backup/sensitive files like /wp-config.php~, /.env.bak, /sftp-config.json, etc.
  2. Extracts credentials using framework-specific regex (WordPress, Laravel, CodeIgniter, raw MySQL env).
  3. If credentials found, attempts live validation: MySQL connection, FTP login, SSH authentication with timeouts (3 sec).
  4. Saves valid entries to categorized files and displays color-coded console stats.
  5. Intelligent chunking + GC prevents memory bloat even with millions of domains.
๐Ÿ—‚๏ธ Detected config files (non exhaustive):
wp-config.php~, wp-config.php.bak, .env, .env.backup, .env.example, application/config/database.php~, config/database.php~, .vscode/sftp.json, ftp-config.json, settings.inc.php~, db.inc.php~, and 20+ more variations.

๐Ÿ“ Output files (auto-generated)

FilenameContent
credential_found.txtAll discovered credentials (MySQL, FTP/SFTP) with source, host, user, password, database, path
mysql_valid.txtWorking MySQL logins (tested connection success)
ftp_valid.txtValid FTP (port 21) credentials
ssh_valid.txtValid SSH / SFTP credentials (port 22, or custom port from config)

๐Ÿ“Œ All files use pipe-delimited format: Domain | Path | Source | Host | Username | Password | [Database/Type] | [Port] for easy parsing.

๐Ÿ—๏ธ Architecture & optimization

๐Ÿ” Validation logic (MySQL / FTP / SSH)

After extracting credentials, the tool attempts multiple connection strategies:

โš ๏ธ Legal & ethical notice: This tool is intended for authorized security assessments, bug bounty, and self-audit purposes only. Scanning domains without explicit permission may violate laws. Always obtain written consent before testing.

๐Ÿ› ๏ธ Customization & extension

You can easily add new file paths or regex patterns inside the script. Look for dictionaries like wp_paths, env_paths, ci_paths and extend extraction functions (extract_wp_credentials, extract_env_credentials).

# Example: add custom CMS detection
custom_paths = ['/custom-config.inc', '/backup/db.txt']
for path in custom_paths:
    response = requests.get(f"{protocol}{domain}{path}", timeout=3)
    # parse accordingly

Thread count, chunk size and memory limit can be tuned depending on network speed and available RAM.

โš ๏ธ Troubleshooting & tips

๐Ÿ“Š Real-time console output

[+] Found example.com | MySQL | FTP | SSH
[PROGRESS] Processed: 12,450 | Credentials Found: 342 | MySQL Valid: 98 | FTP Valid: 31 | SSH Valid: 19 | RAM: 312.45 MB
[CHUNK COMPLETE] RAM usage: 285.23 MB
[CHUNK] Processing Chunk 4/20 (1000 domains)

Color legend: MySQL (blue), FTP (green), SSH (yellow) if connection is alive โ€” otherwise white.

๐Ÿ“ Sample output snippet

# credential_found.txt (example)
example.com | /wp-config.php~ | WordPress | db.example.com | wp_user | s3cr3tP@ss | wordpress_db | 3306
target.org | /.env | Laravel | 192.168.1.100 | laravel_user | MySecurePwd | app_db | 3306
site.io | /.vscode/sftp.json | Config | ftp.site.io | ftp_user | ftpPass123 | SFTP | 22
# mysql_valid.txt (validated connections)
example.com | /wp-config.php~ | WordPress | db.example.com | wp_user | s3cr3tP@ss | wordpress_db

๐Ÿ“œ License & credits

This script is released for educational & defensive research. Built with Python libraries: requests, paramiko, pymysql, colorama, psutil. Feel free to modify and adapt under MIT terms.

๐Ÿ’ก Pro tip: Combine with subdomain enumeration tools (amass, subfinder) to feed the domain list and discover forgotten configuration exposures across your organization.

โšก Quick reference

ParameterRecommended valueUse case
Threads30โ€“80Higher = faster but may trigger WAF/rate limit
Chunk size500โ€“2000Smaller chunks for low RAM systems
Memory limit300โ€“1024 MBPrevents OOM killer on shared servers
Domain file formatplain text, one per lineexample.com (without http://)