Back to selected research

Protocol reverse engineering · 2026

NeurInferno

Field Inference for Unknown Binary Protocols Without Priors or Binaries

A trace-only neural system that recovers byte-level field boundaries in a protocol it has never seen, using only a collection of raw same-format messages at inference time.

0.807 average boundary F1 across 12 held-out binary protocols
0.815 average recall, up from 0.538 for the strongest trace-only baseline by F1
0.079 false-positive rate under strict leave-one-protocol-out evaluation
01

Motivation

A binary message hides its own structure.

Field inference is the first step in reverse engineering an unknown protocol: determine where one field ends and the next begins. Parser construction, fuzzing, intrusion detection, and malware command-and-control analysis all depend on getting these boundaries right.

A single byte sequence is ambiguous. The same four bytes could encode a number, timestamp, checksum, length, or several smaller fields. Existing systems typically need analyst-supplied priors, a runnable target binary, or training on the target protocol's own traffic. The missing evidence is often visible only across messages: constants stay fixed, payloads vary, and length fields co-vary with message size.

02

Method

Within-message context plus cross-message evidence.

Pretrain byte surprise

A Byte Generative Model learns next-byte prediction from raw protocol messages. Its predictive entropy becomes an explicit cue for changes in byte structure.

Compare each offset

The Cross-Message Byte Encoder computes mean, variance, and maximum activation at the same offset across valid messages and injects them at every transformer layer.

Classify the gap

For each adjacent byte pair, the boundary head combines both embeddings, their difference and interaction, Byte-GM entropy, and cross-message variance.

Freeze for deployment

The Byte-GM, encoder, and heads are fixed after offline training. An unseen protocol needs no labels, specification, executable, endianness prior, or target-specific retraining.

An optional auxiliary head assigns coarse protocol-agnostic roles after segmentation. It is not used to improve the boundary results reported below, which come from direct gap-level training.

03

Performance

High recall without giving up competitive precision.

0.808

Boundary precision

Competitive with the conservative BinaryInferno detector at 0.736, while recovering far more true boundaries.

0.784

Leave-four-protocols-out F1

Removing four protocols from the training pool reduces average F1 by only 0.023 from the leave-one-out setting.

1.4-6.6 ms

Inference per message

The 1.44M-parameter frozen model runs from 1.4 ms on an RTX 6000 Ada to 6.6 ms on a commodity Xeon CPU.

Average boundary detection across 12 held-out protocols. Netzob is averaged over 10 protocols because it failed on DHCP and OSPF.
Method Precision Recall False-positive rate F1
NeurInferno0.8080.8150.0790.807
NetPlier0.5650.5380.2010.533
Nemesys0.5050.3420.1980.398
Netzob0.5620.2660.1450.316
BinaryInferno0.7360.1150.0000.192

The held-out protocol is excluded from main-model training, validation, hyperparameter tuning, and Byte-GM pretraining. Ground-truth dissector labels are used only for evaluation.

04

What the results show

Both uncertainty and message collections carry boundary evidence.

Removing cross-message statistics reduces leave-one-out F1 from 0.807 to 0.741. Removing Byte-GM entropy produces a similar drop to 0.742. The two signals are complementary: one exposes fixed-versus-variable behavior across messages, while the other marks changes in within-message predictability.

Performance improves with more same-format messages and largely saturates around 64-100 messages, but the model retains most of its final F1 with 32. Its advantage is consistent across link, network, transport, routing, infrastructure, and industrial-control protocols.

  • Byte-level resolutionSub-byte fields such as packed flags cannot be recovered.
  • Plaintext structure requiredEncrypted payloads remove the statistical regularities the model uses.
  • Coarse semanticsThe optional eight-role vocabulary cannot recover protocol-specific field names without external knowledge.
  • Message grouping assumptionInputs are collections of messages that share an unknown format; fixed-size formats provide less cross-message evidence.