SSH Private Key Discovery and Passphrase Cracking
Compromised user accounts frequently contain reusable SSH keys. Private keys with trusted public counterparts on other hosts allow silent lateral movement without password exposure.
Locating Keys
System-wide public keys often reveal host identities or trusted configurations:
User-specific keys hold the highest reuse potential.
Narrow to current user for speed.
Prioritize id_rsa, id_ed25519, and id_ecdsa. Exfiltrate all private keys immediately. Unencrypted keys enable direct reuse.
Success confirms authorized_keys trust on the target.
Cracking Passphrase-Protected Keys
Encrypted keys prompt for passphrases on use. Crack offline after exfiltration to avoid on-host detection risk.
Set strict permissions if conversion fails.
Convert to John format.
Or use the standalone binary.
Crack the passphrase.
hunter2 (id_rsa)
Weak passphrases fall quickly. Cracked keys unlock the same lateral potential as unencrypted ones. Test against internal hosts trusting the public key.
Edge Cases and Broader Searches
Keys in non-standard locations require broader searches.
Suppress errors on inaccessible directories. Root access expands scope significantly. Check backup directories or application-specific configs for additional keys.
Was this helpful?
Your feedback helps improve this page.