class Crowbar::Rules::PacketRule

Overview

Structure-preserving rule for raw network packets (IPv4, TCP, UDP) and PCAP capture traces. Automatically maintains RFC 791 16-bit Internet Header Checksums, Total Length, and UDP length fields, while fuzzing ports, sequence numbers, TCP flags, TTL, fragmentation offsets, IP options, and transport payloads.

Defined in:

crowbar/rules/packet.cr

Constant Summary

PCAP_MAGIC_BE = Bytes[161, 178, 195, 212]
PCAP_MAGIC_LE = Bytes[212, 195, 178, 161]

Instance Method Summary

Instance methods inherited from class Crowbar::Rule

apply(context : Context, buffer : Buffer) : Bool apply, description : String description, match?(buffer : Buffer) : Bool match?, name : String name, targets(*targets : Symbol) targets, weight : Float64 weight, weight=(weight : Float64) weight=

Constructor methods inherited from class Crowbar::Rule

new(weight : Float64 = 1.0) new

Instance Method Detail

def apply(context : Context, buffer : Buffer) : Bool #
Description copied from class Crowbar::Rule

Applies a structure-preserving transformation to the buffer


def description : String #

def match?(buffer : Buffer) : Bool #
Description copied from class Crowbar::Rule

Checks whether the buffer matches the format handled by this rule


def name : String #

def recalculate_ip_checksum(buffer : Buffer, base_off : Int32, ihl : Int32) #