John

Common Formats

Type
Mode

$krb5asrep$23$

krb5asrep

$krb5tgs$23$

krb5tgs

NTLMv2

netntlmv2

NTLM

netntlm

Usage

john --format=<FORMAT> --wordlist=/usr/share/wordlists/rockyou.txt --fork=4 hash

Rules

To be able to use the previously created rules in JtR, we need to add a name for the rules and append them to the /etc/john/john.conf configuration file.

$ cat ssh.rule
[List.Rules:sshRules]
c $1 $3 $7 $!
c $1 $3 $7 $@
c $1 $3 $7 $#

Files

The id_rsa file is the default private key generated by OpenSSH when creating an RSA key pair for authentication. It is stored under ~/.ssh/ on Unix-like systems and must be kept strictly confidential, as it grants access to any system where the corresponding public key (id_rsa.pub) has been authorized. Possession of this file is equivalent to possessing the login credentials for the associated accounts.

# Convert file to a john-suitable format
$ ssh2john id_rsa > ssh.hash

# Remove the username (id_rsa) from the resulting file
$ cat ssh.hash
$sshng$6$16$7059e78a8d3764ea1e883fcdf592feb7$1894$6f70656e737<SNIP>

# Crack the file
$ john --wordlist=ssh.passwords ssh.hash

# Assing the required permissions
$ chmod 600 id_rsa

# Connect to SSH using the private key
$ ssh -i id_rsa -p 2222 x7331@192.168.50.201

Last updated

Was this helpful?