SSH Version-Based Vulnerability Check
The SSH banner exposes the server software and version. Matching that against known CVEs identifies exploitable conditions without triggering any authentication. This page covers the most operationally relevant vulnerabilities across OpenSSH and other SSH implementations encountered in lab and real-world environments.
Pull the Version
22/tcp open ssh OpenSSH 7.4 (protocol 2.0)
For the raw banner:
SSH-2.0-OpenSSH_7.4
The format is SSH-2.0-SOFTWARENAME_VERSION. Note the exact version string before checking CVEs.
OpenSSH Username Enumeration (CVE-2018-15919 and Earlier)
OpenSSH versions before 7.7 are vulnerable to a timing-based username enumeration attack. The server responds differently to valid versus invalid usernames during public key authentication, leaking whether an account exists.
Check the version against the vulnerable range:
Vulnerable: OpenSSH < 7.7
Fixed: OpenSSH 7.7 and later
For a version reporting 7.4, 7.5, or 7.6, username enumeration is viable. The full technique is covered in SSH User Enumeration.
Terrapin Attack (CVE-2023-48795)
Terrapin is a prefix truncation attack against the SSH handshake that allows an attacker positioned on the network path to downgrade the negotiated connection security. It affects connections using chacha20-poly1305@@openssh.com or any CBC cipher with EtM (Encrypt-then-MAC).
Check whether the server negotiates vulnerable cipher combinations:
Look for chacha20-poly1305@@openssh.com in the encryption algorithms, or hmac-*-etm@@openssh.com MACs paired with CBC ciphers.
Confirm Terrapin susceptibility directly:
The Terrapin scanner tool gives a definitive result:
================================================================================ Reachable Terrapin Severity: HIGH ================================================================================ The following cipher combinations are potentially vulnerable: - [email protected] (client-to-server) - [email protected] (server-to-client)
Affected versions: OpenSSH before 9.6. The fix requires both client and server to be patched. A vulnerable server paired with a patched client is still exploitable if a network attacker can intercept the handshake.
The full exploitation is covered in SSH Terrapin Attack.
libssh Authentication Bypass (CVE-2018-10933)
libssh versions 0.6 through 0.7.5 and 0.8.x before 0.8.4 contain an authentication bypass. The server-side code accepts an SSH_MSG_USERAUTH_SUCCESS message sent by the client as a substitute for a valid login, bypassing the authentication process entirely.
This affects applications and devices that use libssh as a server library, not standard OpenSSH. Check the banner for non-OpenSSH implementations:
Banners indicating libssh-based servers include libssh, vendor appliances, and some embedded devices.
Check the version:
Vulnerable: libssh 0.6.0 to 0.7.5, 0.8.0 to 0.8.3
Fixed: libssh 0.7.6 and 0.8.4+
OpenSSH Double-Free Memory Corruption (CVE-2023-38408)
The ssh-agent in OpenSSH before 9.3p2 has a double-free vulnerability reachable when the agent forwards connections through malicious SSH servers. Exploitation requires controlling a server that a vulnerable client with agent forwarding connects to.
Affected: OpenSSH ssh-agent < 9.3p2
Check the client version on a compromised host:
Check Against searchsploit
Once you have the exact version, check for public exploits:
Filter to remote exploits only:
References
-
CVE-2023-48795nvd.nist.gov/vuln/detail/CVE-2023-48795 (opens in new tab)
Terrapin | NVD entry for the SSH Terrapin prefix truncation attack
-
CVE-2018-15919 — OpenSSH user enumerationnvd.nist.gov/vuln/detail/CVE-2018-15919 (opens in new tab)
NVD entry for timing-based username enumeration in OpenSSH < 7.7
-
CVE-2018-10933 — libssh auth bypassnvd.nist.gov/vuln/detail/CVE-2018-10933 (opens in new tab)
NVD entry for the libssh server-side authentication bypass
-
RUB-NDS/Terrapin-Scannergithub.com/RUB-NDS/Terrapin-Scanner (opens in new tab)
Official Terrapin vulnerability scanner from the researchers who discovered CVE-2023-48795
Was this helpful?
Your feedback helps improve this page.