Skip to main content

Frame Overview

The Heartbeat protocol uses a binary framing format where each message begins with a Message Header Frame followed by zero or one operation-specific frame.

Message Header Frame

Every message starts with a 3-byte message header:
    0                   1                   2
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |I|             id              |      op       |
 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Fields

FieldBitsTypeDescription
I1flagInitiator flag - set if sent by session initiator
id15uintMessage ID (0-32767)
op8enumOperation code

Properties

  • Type: prne_htbt_msg_head_t
  • Length: 3 bytes (fixed)
  • Functions: prne_htbt_init_msg_head(), prne_htbt_ser_msg_head(), prne_htbt_dser_msg_head()

Operation Codes

OP CodeValueNameNext FrameDescription
NOOP0x00No Operation-Keep-alive message
STATUS0x01StatusStatusResult or error report
HOST_INFO0x02Host InfoNone/HostinfoQuery instance information
HOVER0x03Hand-overHandoverRedirect to another server
SOLICIT0x04Solicit-Request instructions
RUN_CMD0x05ExecuteCommandRun shell command
UP_BIN0x06Binary UpgradeBin MetaReplace instance binary
RUN_BIN0x07Execute BinaryBin MetaUpload and run binary
STDIO0x08STDIOSTDIOTransfer I/O data
RCB0x09Binary RecombinationRCBRequest recombined binary

Status Frame

Reports the result of operations or errors.
    0
    0 1 2 3 4 5 6 7
 0 +-+-+-+-+-+-+-+-+
   |     code      |
   +-+-+-+-+-+-+-+-+
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                              err                              |
 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Fields

FieldTypeDescription
codeuint8Status code
errint32Error value (errno or module-specific)

Status Codes

CodeValueDescription
OK0x00Operation successful
UNIMPL0x01Functionality not implemented
PROTO_ERR0x02Protocol error detected
ERRNO0x03System error, see err field
SUB0x04Module error, see err field
LIMIT0x05Resource limit reached
Properties: 5 bytes fixed length, type prne_htbt_status_t

Hostinfo Frame

Carries diagnostic and statistical data about a Proone instance.
      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                          prog_ver (16 bytes)                  +
     |                                                               |
  16 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                          boot_id (16 bytes)                   +
     |                                                               |
  32 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                       instance_id (16 bytes)                  +
     |                                                               |
  48 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     +                          org_id (16 bytes)                    +
     |                                                               |
  64 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         parent_uptime                         |
  68 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                         child_uptime                          |
  72 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                          bne_cnt (64-bit)                     |
  80 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                        infect_cnt (64-bit)                    |
  88 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                           crash_cnt                           |
  92 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                          parent_pid                           |
  96 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                           child_pid                           |
 100 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |    hc_len     |     arch      |      os       |    bf_len     |
 104 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | hc ... (variable) | bf ... (variable)
     +-------------------

Key Fields

FieldTypeDescription
prog_verUUIDProone version identifier
boot_idUUIDHost boot UUID (from /proc/sys/kernel/random/boot_id)
instance_idUUIDGenerated on first launch
org_idUUIDInstance ID of infecting instance (origin)
parent_uptimeuint32Parent process uptime in seconds
child_uptimeuint32Child process uptime in seconds
bne_cntuint64”Break and entry” count
infect_cntuint64Successful infection count
crash_cntuint32Child process crash count
archuint8CPU architecture code
osuint8OS code
hcvariableHost credential data (username + password)
bfvariableBitfield with instance flags
Properties: Variable length, 104-614 bytes, type prne_htbt_host_info_t

Instance Flags (Bitfield)

FlagBitDescription
BA0Binary archive initialized
INIT_RUN1First run on this host
WKR_RCN2Recon worker running
WKR_RESOLV3Resolv worker running
WKR_HTBT4Heartbeat worker running

Command Frame

Represents arguments for exec() syscall.
     0                   1
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   rsv   |D|     args_len      |
  2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   args ...
    +-+-+-

Fields

FieldTypeDescription
DflagDetach flag - spawn as daemon
args_lenuint10Length of args in bytes (0-1023)
argsvariableNull-terminated strings
Properties: Variable length, 2-1025 bytes, type prne_htbt_cmd_t

Detached Processes

When the D flag is set, the process is spawned with:
  • STDIN returns EOF
  • STDOUT/STDERR cause EPIPE
  • Process is session leader
  • Parent is system reaper process

Binary Meta Frame

Extends Command frame for binary uploads.
     0                   1                   2
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
  0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                   alloc_len                   |
  3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   rsv   |D|     args_len      |
  5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |  args ...
    +-+-+-

Additional Field

FieldTypeDescription
alloc_lenuint24Advisory preallocation size (0-16,777,215 bytes)
Properties: Variable length, 5-1028 bytes, type prne_htbt_bin_meta_t

STDIO Frame

Transfers standard I/O or binary data.
    0                   1
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |E|F|rsv|          len          |
 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  data ...
   +-+-+-

Fields

FieldTypeDescription
Eflagstderr flag (submissive→authoritative only)
FflagFinal frame flag (EOF/end of transfer)
lenuint12Data length in bytes (0-4095)
datavariableBinary data
Properties: Variable length, 2+ bytes, type prne_htbt_stdio_t

Handover Frame

Instructs instance to connect to another authoritative host.
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            addr_4                             |
  4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |            port_4             |          addr_6 ...           |
  8 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
    |                         addr_6 (16 bytes)                     |
 22 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |            port_6             |
 24 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Fields

FieldTypeDescription
addr_4uint32IPv4 address (network order)
port_4uint16IPv4 port
addr_6uint128IPv6 address (network order)
port_6uint16IPv6 port
Properties: 24 bytes fixed, type prne_htbt_hover_t Note: Use 0.0.0.0 or :: for unspecified addresses. IPv6 takes precedence when both are specified.

RCB Frame

Requests binary recombination for a specific platform.
    0                   1                   2
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |C|S|    rsv    |      os       |     arch      |
 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Fields

FieldTypeDescription
CflagAllow compatible architecture
SflagSelf-copy flag
osuint8OS code
archuint8CPU architecture code
Properties: 3 bytes fixed, type prne_htbt_rcb_t

Architecture Codes

CodeValueDescription
I6860x01Intel P6 (Pentium Pro)
X86_640x02AMD64
ARMV4T0x03ARM v4 w/ Thumb
ARMV70x04ARM v7 w/ Thumb-2
AARCH640x05AArch64
MIPS0x06MIPS 1 big-endian
MPSL0x07MIPS 1 little-endian
PPC0x08PowerPC 1
SH40x09SuperH 4
M68K0x0AMotorola 68040
ARC0x0BARC little-endian
ARCEB0x0CARC big-endian

OS Codes

CodeValueDescription
LINUX0x01Linux ABI (LSB)

Next Steps

Protocol Overview

Back to protocol introduction

TXT REC CNC

DNS-based command mechanism

Build docs developers (and LLMs) love