CyberChef HASSH Fingerprinting

Category: Security Operations: HASSH Client & Server Fingerprint
HASSH SSH Fingerprinting Network Security Detection

What is HASSH?

HASSH is a network fingerprinting method developed by Salesforce security researchers to identify SSH clients and servers based on their algorithm negotiation behavior. The name "HASSH" is a play on "hash" and "SSH", reflecting its core mechanism: creating MD5 hashes of specific SSH handshake parameters.

When an SSH connection is established, the client and server exchange messages listing their supported cryptographic algorithms. HASSH captures these algorithm lists from the Key Exchange Init messages and creates a unique fingerprint. This fingerprint can identify specific SSH client or server software, versions, and implementations, even when connections are encrypted.

Key Concept: HASSH doesn't break SSH encryption or compromise security. Instead, it analyzes publicly visible handshake metadata to create fingerprints that can identify SSH software. This is valuable for threat detection, anomaly detection, and network monitoring.

How HASSH Works

HASSH generates fingerprints by concatenating specific fields from the SSH Key Exchange Init (KEXINIT) message and computing an MD5 hash:

  1. Extract the Client/Server Key Exchange Init message from SSH handshake
  2. Concatenate four specific algorithm lists in order, separated by semicolons
  3. Compute MD5 hash of the concatenated string
  4. The resulting hash is the HASSH fingerprint

The Four Algorithm Lists

HASSH Algorithm Components
Component Description Example Values
Key Exchange Algorithms Methods for exchanging keys diffie-hellman-group14-sha256, ecdh-sha2-nistp256
Encryption Algorithms Symmetric ciphers for data encryption aes128-ctr, aes256-gcm@openssh.com
MAC Algorithms Message Authentication Codes hmac-sha2-256, hmac-sha1
Compression Algorithms Compression methods none, zlib@openssh.com

HASSH String Formation

Format: kex_algs;enc_algs;mac_algs;comp_algs Example HASSH String: diffie-hellman-group14-sha256,ecdh-sha2-nistp256;aes128-ctr,aes256-ctr;hmac-sha2-256,hmac-sha1;none,zlib@openssh.com MD5 Hash (HASSH Fingerprint): 92674389fa1e47a27ddd8d9b63ecd42b

HASSH Client Fingerprint

The HASSH Client Fingerprint identifies the SSH client software. Different SSH clients (OpenSSH, PuTTY, WinSCP, etc.) advertise different algorithm preferences in different orders, creating unique fingerprints.

Common SSH Clients and Their Fingerprints

SSH Client Version HASSH Fingerprint
OpenSSH 7.4 92674389fa1e47a27ddd8d9b63ecd42b
PuTTY 0.70 9f7b9f7b5e3d9b2e0e3e9b7f5e3d9b2e
WinSCP 5.15 a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
Paramiko 2.7.2 9f71a5d8c5d9b6e9f0e0b3c7a8d6e5f4
Note: The fingerprints above are examples. Actual fingerprints vary by version and configuration. Maintain an up-to-date database of known fingerprints for accurate identification.

Use Cases for Client Fingerprints

HASSH Server Fingerprint

The HASSH Server Fingerprint identifies the SSH server software. This helps detect rogue SSH servers, identify honeypots, or inventory SSH server software across an organization.

Common SSH Servers and Their Fingerprints

SSH Server Version HASSH Fingerprint
OpenSSH 7.4 b12d2871a1189eff20364cf5333619ee
Dropbear 2019.78 c3e5f3e5b7d9a6f8e1c4b5a7d9e6f8a1
libssh 0.9.4 d4f8e6a1c9b7e5f3a2d8c6e9b1f4a7d5
AsyncSSH 2.7.0 e9f3b1d6c8a5e7f4b2d9c1e8a6f5b3d7

Use Cases for Server Fingerprints

Using HASSH in CyberChef

CyberChef provides two operations for HASSH fingerprinting:

HASSH Client Fingerprint

Generates a HASSH fingerprint from SSH Client Key Exchange Init message data.

Input:

SSH_MSG_KEXINIT packet from client

Output:

MD5 hash identifying the client

HASSH Server Fingerprint

Generates a HASSH fingerprint from SSH Server Key Exchange Init message data.

Input:

SSH_MSG_KEXINIT packet from server

Output:

MD5 hash identifying the server

Steps to Generate HASSH Fingerprints:

  1. Capture SSH traffic using Wireshark, tcpdump, or similar tool
  2. Extract the SSH Key Exchange Init (KEXINIT) packets
  3. Copy the hex dump of the client or server KEXINIT packet
  4. Paste into CyberChef input
  5. Add "HASSH Client Fingerprint" or "HASSH Server Fingerprint" operation
  6. View the resulting fingerprint hash
  7. Compare against known fingerprint databases
Example HASSH Generation
Input: SSH Client KEXINIT Packet (Hex)
140000016b... (truncated for display)
HASSH Algorithm String:
curve25519-sha256,ecdh-sha2-nistp256;aes128-ctr,aes192-ctr,aes256-ctr;hmac-sha2-256,hmac-sha2-512;none
HASSH Fingerprint (MD5):
92674389fa1e47a27ddd8d9b63ecd42b

This fingerprint identifies OpenSSH 7.4 client.

Practical Applications

Security Operations Center (SOC)

Integrate HASSH fingerprinting into SIEM systems to:

Threat Intelligence

Build databases of HASSH fingerprints associated with:

Incident Response

During investigations:

Network Monitoring

Continuous monitoring for:

HASSH in Network Traffic Analysis

Capturing KEXINIT Packets

Using Wireshark to capture SSH handshake:

# Capture filter for SSH traffic tcp port 22 # Display filter for SSH KEXINIT messages ssh.message_code == 20 # Steps: 1. Start packet capture on interface 2. Initiate SSH connection 3. Filter for SSH KEXINIT (message type 20) 4. Right-click packet → Copy → ...as Hex Dump 5. Paste into CyberChef

Automated Fingerprinting

Many security tools now include HASSH fingerprinting:

Limitations and Considerations

Fingerprint Stability

HASSH fingerprints can change when:

Hash Collisions

While MD5 collisions are theoretically possible, they're unlikely in practice for HASSH. Different software versions typically have distinct algorithm preferences.

Encrypted Traffic

HASSH works on encrypted SSH connections because it analyzes the unencrypted handshake. However, traffic must be intercepted during connection establishment.

Custom Implementations

Attackers aware of HASSH fingerprinting might:

Defense in Depth: HASSH is one tool in a comprehensive security strategy. Combine it with other detection methods like behavioral analysis, authentication monitoring, and anomaly detection for robust security.

HASSH Databases and Resources

Public HASSH Databases

Building Your Own Database

For custom fingerprint databases:

  1. Inventory all authorized SSH clients and servers
  2. Generate HASSH fingerprints for each
  3. Document versions and configurations
  4. Update as software is upgraded
  5. Share findings with security community

CyberChef Recipe Ideas

Here are some useful recipe combinations involving HASSH fingerprinting:

Best Practices

For Security Monitoring

For Incident Response

For Defense

← Back to Operations Guide