Back to services

SSH

SSHSecure ShellOpenSSH

SSH (Secure Shell) provides encrypted remote access. Weak key exchange algorithms, default credentials, and private key exposure are common attack vectors.

Ports

PortProtocolDescription
22tcpSSH

Fingerprints

Banner / ProbeExpected Response
nmap -sV -p <port> <target>Service banner and version info
nc -nv <target> <port>Raw banner grab

Key Files

PathDescription
/etc/passwdList of system users
/etc/shadowPassword hashes for local users
/etc/ssh/sshd_configSSH server configuration
~/.ssh/id_rsaSSH private key

Default Credentials

UsernamePasswordContext
adminadminGeneric admin account
rootrootGeneric root account

Known CVEs

IdentifierTypeDescription
CVE-2024-6387RCEregreSSHion — OpenSSH signal handler race
CVE-2023-38408RCEOpenSSH forwarded SSH agent RCE

Exploitation Primitives

TechniqueTool / CommandResult
Password Brute Forcehydra -l root -P /usr/share/wordlists/rockyou.txt ssh://<target>SSH credential guessing
Key Auth Abusessh -i id_rsa user@<target>Use stolen private key

Notes

Check for weak key exchange algorithms: `nmap --script ssh2-enum-algos -p22 <target>`.

Default credentials are shockingly common on IoT and network devices.

Private keys without passphrases in `~/.ssh/` are instant wins.

regreSSHion (CVE-2024-6387) affects OpenSSH < 4.4p1 and 8.5p1–9.7p1 on glibc.

Seen on

ShodanCensysFOFAZoomEye

References