Shaking Out Shells with SSHamble
HD Moore
DEF CON 33 · Day 2 · Main Stage
Overview
SSH has long been treated as a solved problem — a cryptographically sound protocol that, once properly deployed, provides a trustworthy remote administration channel. That assumption has eroded sharpl

Key moments
- 0:19 So, really fast overview of all SH stuff.
- 8:46 So they have fantastic opsect.
- 14:40 Uh has anyone here played with it a bit?
- 21:45 and that's a a nice verifiable way to make sure it's vulnerable is you turn it off...
- 31:48 Um, so what was really sad though is we went back and looked at all the machines...
- 35:03 It's just a lot of gpping until you find new fun stuff.
- 41:39 I don't know what useful it is, but it's a good reminder.
Shaking Out Shells with SSHamble
Speakers: HD Moore
Conference: DEF CON 33
YouTube: https://www.youtube.com/watch?v=XHoH4ic8fX8
Overview
SSH has long been treated as a solved problem — a cryptographically sound protocol that, once properly deployed, provides a trustworthy remote administration channel. That assumption has eroded sharply over the past two years. A cascade of significant vulnerabilities has struck multiple SSH implementations simultaneously, exposing weaknesses in the protocol's state machine, authentication logic, and client libraries that researchers had largely ignored for decades. HD Moore, creator of Metasploit and founder of runZero, returns to DEF CON with an expanded version of his SSHamble research, delivering new zero-day findings, updated internet-wide exposure statistics, and substantial improvements to open-source tooling for SSH security research.
The talk provides both a retrospective of the recent SSH vulnerability landscape and a forward-looking look at the ongoing research infrastructure Moore has built to systematically study SSH at internet scale.
Background
▶ Watch: So, really fast overview of all SH stuff. (0:19)
SSH's Position in the Internet Attack Surface
SSH is the second most commonly exposed administrative protocol on the internet, trailing only HTTP/HTTPS. Its prevalence extends well beyond the Linux server administration use case most practitioners picture — SSH underlies network equipment management, OT/ICS device control interfaces, file transfer products like MOVEit, and embedded systems across the internet. This broad deployment footprint means that SSH vulnerabilities carry outsized impact.
The protocol's vendor composition is extremely concentrated at the top: OpenSSH and Dropbear together account for approximately 98% of all internet-exposed SSH deployments. However, Moore emphasizes that the remaining 2% — the "long tail" of custom SSH implementations — tends to be disproportionately important. These are typically proprietary SSH stacks embedded in industrial control systems, network appliances, and specialized software like MOVEit. When you find these devices, they are almost certainly running critical infrastructure.
Protocol Structure and the Pre-Authentication Attack Surface
Understanding SSH's protocol state diagram is foundational to understanding why the recent vulnerabilities are interesting. SSH operates in distinct phases: cleartext TCP setup and version exchange, Key Exchange Init (KEX), encrypted transport establishment, and then authentication. A common misconception is that nothing interesting happens before authentication. In reality, substantial information leaks from the server before any credentials are exchanged:
- TCP/IP stack fingerprinting — OS version, TTL, window size, congestion algorithm
- Server version string — explicit software version and often OS context
- KEX extensions — negotiated capabilities including cipher suites and host key algorithms
- Server banners — free-form text that frequently reveals software version, organization, and even configuration details
- Authentication handshake metadata — which authentication methods are supported, and critically, whether a given username exists
This pre-authentication surface is the foundation for a class of reconnaissance techniques that Moore's tooling systematizes. In particular, SSH's handling of public key authentication reveals whether a given username is valid on the server — a server will respond differently to a "partial authentication" probe using a public key than to an authentication attempt for a nonexistent user.
Key Findings
▶ Watch: Uh has anyone here played with it a bit? (14:40)
Recent SSH Vulnerability Landscape
Moore provides a thorough retrospective of the most significant SSH vulnerabilities of the past two years, which have collectively made this "the most exciting time in SSH in a very long time":
Terrapin (CVE-2023-48795): A protocol-level vulnerability where attackers could perform a prefix truncation attack on the SSH Binary Packet Protocol, exploiting weaknesses in how sequence numbers are handled for the ChaCha20-Poly1305 and CBC-EtM encryption modes. By injecting and removing packets during the handshake, an attacker capable of TCP MITM could downgrade the session to less secure extension negotiation. The attack was the first of its kind to target the SSH transport layer directly.
XZ Utils Backdoor (CVE-2024-3094): Described by Moore as "probably one of the best backdoors in the history of the internet." A threat actor spent approximately three years building trust within the XZ Utils open-source project before inserting a highly sophisticated backdoor into the build system that, in certain distributions, would have enabled unauthenticated remote code execution via the SSH daemon. It was detected only because a Microsoft engineer noticed unusual CPU consumption. Moore notes that attempts to hunt the actor (known as "Jia Tan") via their public GPG key sprayed across internet SSH servers found nothing — the actor has excellent operational security.
regreSSHion (CVE-2024-6387): A signal-handler race condition in OpenSSH's sshd that resurrected a vulnerability class (CVE-2006-5051) that had been considered fixed for nearly two decades. The vulnerability enables unauthenticated remote code execution as root in default OpenSSH configurations on glibc-based Linux systems. Exploitation is difficult on modern 64-bit systems due to ASLR, but has been demonstrated on 32-bit x86. As Moore notes, sshd is one of very few network-facing services that runs as root by default, making this an extraordinarily high-impact target. Credit goes to Qualys Threat Research Unit.
MOVEit SSH Authentication Bypass: The MOVEit file transfer platform (prominent due to widespread ransomware exploitation of other MOVEit vulnerabilities) sources its SSH implementation from a third-party library called IP Works. When processing public key authentication, the IP Works library would take the raw DER-encoded public key blob and treat it as a file path, attempting to open it for an inexplicable reason. By supplying a UNC path or a Windows local path (e.g., \\localhost\C$) as the "key," an attacker could cause the server to authenticate to itself against its own log files, bypassing authentication.
Qualys QoS OOM → MITM (recent): Qualys researchers found a way to convert a denial-of-service condition in the SSH client into a man-in-the-middle attack. By flooding the client with SSH ping packets, they could trigger an out-of-memory condition that caused the SSH handshake to fail in a way that bypassed host key verification, allowing a MITM attacker to intercept the session.
Go SSH Library Authentication Bypass: A subtle API misuse vulnerability in the widely-used golang.org/x/crypto/ssh library. If a developer used the library in a naive way, an attacker could send multiple keys during authentication. The server callback would trigger for the correct key (signaling valid authentication), but the attacker would never actually complete authentication with that key. The server would then incorrectly grant access. This is a class of vulnerability that stems from library API design rather than implementation bugs — the library's callback-based API made it easy to write authentication logic that could be defeated.
New Zero-Day Research
Moore presents new zero-day vulnerabilities discovered through systematic fuzzing and analysis of the long-tail SSH implementations — the proprietary stacks in embedded devices and network appliances. Details of specific CVEs and vendor identities are handled according to responsible disclosure timelines, but the talk demonstrates that the non-OpenSSH/Dropbear space contains a substantial number of unexamined vulnerabilities. Devices that have been running custom SSH daemons for years without security review represent a significant unexplored attack surface.
Technical Deep Dive
▶ Watch: and that's a a nice verifiable way to make sure it's vulnerable is you turn i... (21:45)
The Username Enumeration Primitive
One of the most operationally useful SSH primitives Moore's research formalizes is public-key-based username enumeration. SSH's authentication protocol allows a client to send a SSH2_MSG_USERAUTH_REQUEST with publickey method but without the actual signature (a "dry run" probe). If the user does not exist, the server responds with SSH2_MSG_USERAUTH_FAILURE. If the user exists and the key would be considered for authentication, the server responds with SSH2_MSG_USERAUTH_PK_OK.
This means: given a target server and a public key (which is public information — GitHub, corporate directories, etc.), you can determine whether the associated identity has access to that server. Moore's team famously used this to hunt for the XZ Utils backdoor author's key across internet-wide SSH deployments. The technique has significant offensive intelligence value: you can map which internal servers a specific individual (identified by their public key) can access, without ever possessing the private key or generating any authentication failure log entries on the target.
SSHamble Tooling
SSHamble is an open-source Go tool built around the golang.org/x/crypto/ssh library (with modifications to enable research capabilities that the standard library intentionally prevents). The tool provides:
- Version and capability fingerprinting — extracting version strings, KEX capabilities, and banner content across large-scale targets
- Username enumeration — the public key probe technique described above, at scale
- Partial authentication abuse — exploiting incomplete authentication state machines in non-standard SSH implementations
- Post-authentication attack surface probing — once authenticated (with valid credentials), systematically testing the channel and forwarding attack surface that many custom SSH daemons leave exposed
- Fuzzing harnesses — for systematic testing of custom SSH implementations
The updated version released at DEF CON 33 incorporates lessons from the past year's vulnerability research and adds new modules targeting the long-tail device categories.
Exposure Statistics
Moore presents updated internet-wide scanning data on SSH exposure. Key metrics include the total count of internet-accessible SSH services, the version distribution across the OpenSSH/Dropbear/other breakdown, and the prevalence of known-vulnerable versions. A notable datapoint: a substantial number of internet-exposed SSH servers are running versions that remain unpatched against regreSSHion and Terrapin months after patches were available, particularly in the embedded and network appliance categories.
Demo / PoC
▶ Watch: It's just a lot of gpping until you find new fun stuff. (35:03)
The talk includes live demonstrations of several SSHamble capabilities, including the username enumeration technique against a controlled target and a walkthrough of how the Go SSH library authentication bypass vulnerability could be exploited in a vulnerable application. Moore also demonstrates the post-authentication attack surface probing on a custom SSH implementation that, once authenticated, presents a broader attack surface than the pre-authentication hardening would suggest.
Defensive Implications
▶ Watch: I don't know what useful it is, but it's a good reminder. (41:39)
Patch and upgrade SSH implementations aggressively. The past two years have demonstrated that no SSH implementation is immune. regreSSHion, Terrapin, and the Go library bypass all affect widely deployed code. Automated patch management for SSH-bearing systems, including embedded devices that traditionally have long refresh cycles, is essential.
Disable password authentication. This recommendation is not new, but continues to be widely ignored. Keyboard-interactive (PAM-backed password) authentication is enabled by default on most SSH servers. Disabling it eliminates an entire category of brute-force and credential stuffing attacks.
Implement SSH certificate-based authentication. SSH certificates (distinct from simple public keys) enable short-lived, centrally revocable authentication with no client-side private key storage requirements. They are more operationally manageable than public keys at scale and provide significantly stronger security guarantees.
Inventory the long tail. Organizations with OT/ICS environments, legacy network appliances, or third-party software products using embedded SSH daemons are likely running unexamined code. Enumerate all SSH-bearing devices and assess whether they are running standard OpenSSH/Dropbear or a custom stack. Custom stacks warrant security review.
Monitor for public key enumeration. The username enumeration primitive generates SSH2_MSG_USERAUTH_PK_OK responses for valid users, which should be distinguishable in SSH daemon logs. Alert on authentication probes that test keys without completing authentication.
Review SSH library API usage in custom applications. The Go SSH library authentication bypass is a reminder that cryptographic library APIs can be misused in ways that completely defeat their security guarantees. Any in-house application that implements SSH authentication using library callbacks should be audited against the pattern described in the research.
Key Takeaways
- SSH is the second most exposed admin protocol on the internet, and its security has deteriorated significantly over the past two years with a wave of high-severity vulnerabilities.
- regreSSHion (CVE-2024-6387) represents the first unauthenticated RCE in default OpenSSH in many years; the XZ backdoor was one of the most sophisticated supply chain attacks ever detected.
- Pre-authentication SSH metadata enables significant reconnaissance without triggering authentication failures, including precise username existence confirmation using only a target's public key.
- The non-OpenSSH "long tail" of embedded SSH implementations is a significantly underexamined attack surface with real critical infrastructure impact.
- SSHamble provides a systematic, open-source toolchain for SSH security research, fuzzing, and exposure analysis.
About the Speaker
HD Moore is the creator of the Metasploit Framework, the most widely used open-source penetration testing platform in the world. He is the founder and CEO of runZero, a network asset discovery and attack surface management company. Moore has spent over two decades as a central figure in vulnerability research and offensive security tooling, and has been conducting internet-wide scanning research since the days of the original NeXpose scanner. His annual internet-wide research projects have consistently surfaced structural security problems in widely deployed protocols, and the SSH work represents a multi-year research investment in systematically mapping the SSH attack surface at a scale and depth that has not previously been possible with open tooling.
Reviews
Dr. Zero (Offensive Security Researcher) — MUST SEE
HD Moore returns with an expanded SSHamble research set covering the past two years of SSH vulnerabilities — Terrapin, XZ backdoor, regreSSHion, MOVEit SSH authentication bypass, Qualys QoS OOM-to-MITM, Go SSH library auth bypass — plus new zero-days in long-tail proprietary SSH implementations, updated internet-wide exposure statistics, and the public release of improved SSHamble tooling.
Heather Calloway (CISO) — STRONG ACCEPT
HD Moore catalogs two years of SSH vulnerability acceleration — Terrapin, regreSSHion, XZ Utils backdoor, MOVEit authentication bypass, Go library auth bypass — while presenting new zero-day findings in the long tail of custom SSH implementations embedded in OT devices and network appliances. SSHamble, his open-source toolchain, now supports systematic username enumeration, partial authentication abuse, and post-authentication attack surface probing at internet scale.