πŸ”Credential Hunting

🎯 Overview

Systematic search for stored credentials across the Linux file system. Credentials may be found in configuration files, scripts, history files, backups, databases, and various application-specific locations.

πŸ“ Common Credential Locations

Configuration Files

# All config files
find / ! -path "*/proc/*" -iname "*config*" -type f 2>/dev/null

# Database configs
find / -name "*.conf" -exec grep -l "password\|pass\|pwd" {} \; 2>/dev/null

# Web application configs
find /var/www -name "wp-config.php" 2>/dev/null
find /var/www -name "config.php" 2>/dev/null
find /etc -name "*sql*" -o -name "*db*" 2>/dev/null

WordPress Database Credentials

# WordPress config files
find / -name "wp-config.php" -exec cat {} \; 2>/dev/null

# Extract DB credentials
grep 'DB_USER\|DB_PASSWORD\|DB_HOST' /var/www/*/wp-config.php

πŸ”‘ SSH Key Discovery

SSH Key Locations

SSH Key Analysis

πŸ“ History & Log Files

Command History Files

Log File Investigation

πŸ—ƒοΈ Backup & Archive Files

Backup File Discovery

πŸ’Ύ Database & Application Files

Database Credential Hunting

Web Application Files

πŸ“§ Mail & Spool Directories

Mail System Investigation

Specific Application Hunting

πŸ” Advanced Credential Discovery

Environment Variables & Memory

Hidden & Dot Files

πŸš€ Quick Credential Hunt Script

🎯 High-Value Target Files

Priority File Types

Common Credential Patterns

πŸ”‘ Password Validation

Test Discovered Credentials

⚠️ Credential Security

What to Look For

  • Plaintext passwords in config files

  • Connection strings with embedded credentials

  • SSH private keys without passphrases

  • Database credentials for privilege escalation

  • Service account passwords for lateral movement

Common Mistakes

  • WordPress wp-config.php with default credentials

  • Backup files containing production passwords

  • Development configs deployed to production

  • SSH keys in world-readable locations

  • Passwords in bash history or scripts


Credential hunting transforms file system enumeration into actionable intelligence - discovering stored secrets that enable privilege escalation and lateral movement throughout the target environment.

Last updated