SSH Private key cracking
Steps for Cracking SSH key
Step 1: Generate SSH Hash from Private Key
ssh2john id_rsa > ssh.hashStep 2: Clean SSH Hash File (Remove Filename Prefix)
# Removing Username from hash and keeping only hash.
output=$(cat ssh.hash | cut -d ":" -f2)
echo $output > ssh.hash
cat ssh.hashStep 3: Cracking SSH hash with john
# Using only wordlist
john --wordlist=/usr/share/wordlists/rockyou.txt ssh.hash
# Using wordlist and custom rule:
john --wordlist=/usr/share/wordlists/rockyou.txt --rules=sshrules ssh.hashStep 4: Connect using SSH
Last updated