Overview
The Heartbeat protocol is a point-to-point or broadcast framing protocol that works over transport streams such as TCP/IP. It enables:- Remote command execution
- Binary upgrades
- Host information retrieval
- Machine-to-machine (M2M) communication
- DNS TXT record-based control
Architecture
The subsystem runs as a worker thread and consists of three main components:Main Thread (HTBT_MAIN)
Handles authoritative host connections and processes request queues. Manages hover requests and maintains connection state.src/htbt.c
Local Backdoor (LBD)
Listens on port 64420 (default) for incoming M2M connections. Provides maintenance access to running instances.src/htbt.c
CNC Probe Worker (CNCP)
Periodically queries DNS TXT records for commands. The interval is 1800±1800 seconds (30-60 minutes).src/htbt.c
Protocol Features
TLS Security
Both client and server implementations use mutual TLS authentication:- Two-way certificate verification
- ALPN string “prne-htbt” for endpoint validation
- Hardcoded CA cert, DH parameters, and key pairs
Session Management
A session consists of:- Message Header Frame: Contains message ID and operation code
- Data Frames: Depends on the operation type
- Status/Response Frames: Confirms operation completion
All messages in a session share the same message ID. The special ID
0x7FFF indicates a notification session requiring no response.Operation Codes
| Code | Name | Description |
|---|---|---|
0x00 | NOOP | No operation (keepalive) |
0x01 | STATUS | Status response |
0x02 | HOST_INFO | Request/response host information |
0x03 | HOVER | Hand-over to another host |
0x04 | SOLICIT | Request instructions |
0x05 | RUN_CMD | Execute command |
0x06 | UP_BIN | Binary upgrade |
0x07 | RUN_BIN | Execute binary |
0x08 | STDIO | Standard I/O data |
0x09 | RCB | Binary recombination |
TXT Record CNC
Unlike conventional botnets, Proone instances are controlled via DNS TXT records:Record Format
The header record follows the pattern:([0-9a-fA-F]{8})(.*)
- First 8 hex digits: Number of data records
- Remaining string: Suffix for data record names
Example
For header record value00000003.cnc.test, the worker queries:
M2M Communication
Instances check if target hosts are already infected by connecting to the local backdoor:- Attempt connection to port 64420
- Perform TLS handshake with certificate verification
- Check ALPN string for “prne-htbt”
- Query version and upgrade if necessary
Binary Upgrade Process
src/htbt.c
Implementation Details
Timeouts
src/htbt.c
Lock Matrix
Prevents concurrent operations that could conflict:src/htbt.c
Use Cases
Security Considerations
Related Components
- Resolv Worker - DNS resolution for TXT records
- BNE Worker - Binary deployment after breach
- Binary Recombination - Executable preparation
References
- Full protocol specification:
/doc/htbt.md - Implementation:
src/htbt.c,src/htbt.h - Standalone tools:
proone-htbtclient,proone-htbthost
