ports/22
22/tcp
SSH · Secure Shell
Encrypted remote shells, file transfer and port forwarding. Rarely exploitable itself on a current OpenSSH, so it's mostly about the banner, the auth methods on offer and the credentials you already hold.
ProtocolTCP
Servicessh
Default onLinux, BSD, network gear
AuthPassword, public key, keyboard-interactive
01
Enumerate
start hereRead the banner and the accepted auth methods, then try any credentials you have.
# version, host keys and algorithms nmap -p 22 -sV --script ssh2-enum-algos,ssh-hostkey $IP # which auth methods the server offers ssh -v -o PreferredAuthentications=none -o StrictHostKeyChecking=no $USER@$IP # spray a known credential (authorised testing only) nxc ssh $IP -u $USER -p $PASS
02
Weaknesses
check each one CHECK HOW TO TELL WHAT IT GIVES YOU
Password auth enabled
offers 'password' in auth methods Credential spraying surface Reused keys or creds
A key or password found elsewhere works here Shell, often with sudo Old OpenSSH banner
Pre-8.x version string User enumeration, known CVEs A current, patched OpenSSH is a hard target. Your time on port 22 is almost always spent on credentials — banner and algorithm hygiene, which auth methods are allowed, and whether a password or key you recovered elsewhere unlocks it.