TCP: SSH - 22

Connection

ssh <Username>@<Target IP Address> [-p <Port>]
ssh -i <ID_RSA File Name> [-p <Port>] <Username>@<Target IP Address>

NOTE: Make sure id_rsa has permission of 400

chmod 400 <ID_RSA File Name>

Enumeration

nc -vn <Target IP Address> 22

Grab Cert

ssh-keygen -t rsa <Target IP Address> [-p <Port>]

Vulnerability Scanning

ssh-audit -v <Target IP Address>

Nmap

Default Nmap script for SSH

Retrieve version

Retrieve support algorithms

Retrieve weak keys

Check authentication method

Bruteforce

Normal Password Bruteforce

Passphrase Bruteforce

1

Retrieve passphrase hash from id_rsa

2

Crack hash

Password Spraying

Exploit

Heartbleed.py

Github Repo: https://gist.github.com/eelsivart/10174134

Modify the following part

To include Hexdump

For repeated run

Fake user

1

Generate id_rsa

2

Copy the content of id_rsa.pub and paste it in target machine

Last updated