Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-6387 PoC — Openssh: regresshion - race condition in ssh allows rce/dos

Source
Associated Vulnerability
Title:Openssh: regresshion - race condition in ssh allows rce/dos (CVE-2024-6387)
Description:A security regression (CVE-2006-5051) was discovered in OpenSSH's server (sshd). There is a race condition which can lead sshd to handle some signals in an unsafe manner. An unauthenticated, remote attacker may be able to trigger it by failing to authenticate within a set time period.
Description
HASSH fingerprints for identifying OpenSSH servers potentially vulnerable to CVE-2024-6387 (regreSSHion).
Readme
# CVE-2024-6387 HASSH Fingerprints

HASSH fingerprints for identifying OpenSSH servers potentially vulnerable to CVE-2024-6387 (regreSSHion).

The primary goal of this repository is to share the generated HASSH fingerprint database. The scripts use the Shodan API to compile a list of HASSH fingerprints for vulnerable OpenSSH versions. The generated database can be used to query Shodan or Censys to identify potentially vulnerable OpenSSH servers. The `hasshdb.txt` database can also be used with my Nmap NSE script available at [hassh-utils](https://github.com/0x4D31/hassh-utils).

## Background

SSH Server Identification String (aka version string) is not a reliable way to identify SSH server implementations and versions, as it can be easily spoofed, as seen in honeypots like Cowrie. HASSH, developed by Ben Reardon (with contributions from me and John Althouse), is a fingerprinting technique that combines KEX, Encryption, MAC, and Compression algorithms from the `SSH_MSG_KEXINIT` message to create a fingerprint for specific SSH implementations. For more information about HASSH, refer to the [Salesforce engineering blog post](https://engineering.salesforce.com/open-sourcing-hassh-abed3ae5044c/) and the [HASSH repository](https://github.com/corelight/hassh).

Considering the recent RCE vulnerability in OpenSSH ([Qualys blog post](https://blog.qualys.com/vulnerabilities-threat-research/2024/07/01/regresshion-remote-unauthenticated-code-execution-vulnerability-in-openssh-server)), I thought it was worth generating a fingerprint database, as HASSH is supported in both Shodan and Censys and provides a more reliable method of identifying specific SSH server implementations and versions.

The HASSH fingerprint can be searched in Shodan using the `ssh.hassh` query and in Censys using the `services.ssh.hassh_fingerprint` query.


## Generated Data

The Shodan scripts produce the following data files:

- `hasshdb.txt`: A text file containing formatted HASSH fingerprints and their associated OpenSSH versions, including confidence percentages.
- `hasshdb.json`: A JSON file with the HASSH database, mapping each HASSH fingerprint to its OpenSSH versions and counts.
- `potentially-vulnerable.json`: A JSON file containing HASSH fingerprints of potentially vulnerable servers, total counts, and top 100 version/identification strings.

Note: The scripts use Shodan's facets and the `count()` method, which doesn't return detailed results and doesn't require a paid API plan. This method is also much faster than the `search()` method.
File Snapshot

[4.0K] /data/pocs/4a5cea42b0c1bd73f5adee2fa3637936da4c0fad ├── [4.0K] data │   ├── [9.1K] hasshdb.json │   ├── [6.6K] hasshdb.txt │   ├── [ 16K] output.log │   └── [ 64K] potentially-vulnerable.json ├── [ 11K] LICENSE ├── [2.5K] README.md └── [4.0K] scripts ├── [4.4K] hasshdb_gen.py └── [2.2K] hassh_query.py 2 directories, 8 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →