SPIKE

Framework et bibliothèque de fuzzing protocolaire en C, utilisé pour construire des fuzzers réseau sur mesure à partir de petits scripts décrivant la structure des messages. C-based protocol fuzzing framework and library used to build custom network protocol fuzzers from small scripts describing message structure.

↗ https://www.kali.org/tools/spike/

Overview

SPIKE is a low-level, C-based fuzzing framework for building custom network protocol fuzzers. Rather than fuzzing blindly, you describe a protocol’s message structure in a small “SPIKE script” (.spk) using primitives like s_string(), s_binary(), and s_int(), and SPIKE mutates each field in turn while sending the resulting packets at a target service — useful for vulnerability research against proprietary or undocumented TCP/UDP protocols where no off-the-shelf fuzzer exists.

Common Usage

Fuzz a TCP service using a SPIKE script describing its protocol

generic_send_tcp <target> <port> <script.spk> <skip_var_count> <skip_str_count>

Fuzz a UDP service instead

generic_send_udp <target> <port> <script.spk> 0 0

Resume fuzzing from a specific test case index after a crash

generic_send_tcp <target> <port> <script.spk> 45 0
// example.spk — minimal SPIKE script describing a length-prefixed command
s_binary("00 00 00 00");    // 4-byte length placeholder, auto-filled
s_string("USER");            // fixed command name
s_string_variable("admin");  // fuzzed field — SPIKE will mutate this
s_string("\r\n");

Tips

  • Run the target under a debugger (or with core dumps enabled) so you can correlate a SPIKE crash with the exact test case index that triggered it
  • skip_var_count/skip_str_count let you resume a long fuzzing run from where it crashed instead of restarting from test case zero
  • SPIKE predates most modern coverage-guided fuzzers (AFL++, boofuzz) — still valuable for quick structure-aware fuzzing of a proprietary TCP/UDP protocol without instrumenting the binary
Help / Man page
generic_send_tcp host port spike_script skip_variable skip_string
generic_send_udp host port spike_script skip_variable skip_string

  host              target hostname or IP
  port              target port
  spike_script      path to .spk script describing the protocol
  skip_variable     skip to this variable index (resume support)
  skip_string       skip to this string fuzz index (resume support)

SPIKE script primitives (used inside .spk files):
  s_string("literal")          fixed string content
  s_string_variable("value")   fuzzed string field, seeded with value
  s_binary("hex bytes")         fixed binary content
  s_int(N)                       fuzzed integer field
  s_block_size_binary(...)       auto-computed length field

Vue d’ensemble

SPIKE est un framework de fuzzing bas niveau en C pour construire des fuzzers réseau sur mesure. Plutôt que de fuzzer à l’aveugle, on décrit la structure des messages d’un protocole dans un petit “script SPIKE” (.spk) à l’aide de primitives comme s_string(), s_binary() et s_int(), et SPIKE mute chaque champ à tour de rôle en envoyant les paquets résultants vers un service cible : utile pour la recherche de vulnérabilités sur des protocoles TCP/UDP propriétaires ou non documentés pour lesquels aucun fuzzer prêt à l’emploi n’existe.

Utilisation courante

# Fuzzer un service TCP à l'aide d'un script SPIKE décrivant son protocole
generic_send_tcp <target> <port> <script.spk> <skip_var_count> <skip_str_count>

# Fuzzer un service UDP à la place
generic_send_udp <target> <port> <script.spk> 0 0

# Reprendre le fuzzing depuis un index de cas de test précis après un crash
generic_send_tcp <target> <port> <script.spk> 45 0
// example.spk : script SPIKE minimal décrivant une commande préfixée par sa longueur
s_binary("00 00 00 00");    // marqueur de longueur sur 4 octets, rempli automatiquement
s_string("USER");            // nom de commande fixe
s_string_variable("admin");  // champ fuzzé, SPIKE va le muter
s_string("\r\n");

Conseils

  • Faire tourner la cible sous un débogueur (ou avec les core dumps activés) afin de pouvoir corréler un crash SPIKE avec l’index exact du cas de test qui l’a déclenché
  • skip_var_count/skip_str_count permettent de reprendre une longue session de fuzzing là où elle a planté au lieu de repartir du cas de test zéro
  • SPIKE précède la plupart des fuzzers modernes guidés par la couverture (AFL++, boofuzz) : il reste utile pour un fuzzing rapide et sensible à la structure d’un protocole TCP/UDP propriétaire sans instrumenter le binaire
Aide / Page de manuel
generic_send_tcp host port spike_script skip_variable skip_string
generic_send_udp host port spike_script skip_variable skip_string

  host              target hostname or IP
  port              target port
  spike_script      path to .spk script describing the protocol
  skip_variable     skip to this variable index (resume support)
  skip_string       skip to this string fuzz index (resume support)

SPIKE script primitives (used inside .spk files):
  s_string("literal")          fixed string content
  s_string_variable("value")   fuzzed string field, seeded with value
  s_binary("hex bytes")         fixed binary content
  s_int(N)                       fuzzed integer field
  s_block_size_binary(...)       auto-computed length field