Overview
The Header Normalization transform modifies IPv4 and TCP headers to prevent OS fingerprinting and header-based traffic analysis. It can normalize TTL values, TCP window sizes, and randomize IP identification fields.Structure
Configuration
When enabled, sets all packets’ TTL (Time To Live) field to
ttl_value.The TTL value to set when
normalize_ttl is enabled. Common values:- 64: Linux/Unix default
- 128: Windows default
- 255: Maximum value
When enabled, sets the TCP window size to 65535 (maximum value).
When enabled, randomizes the IP identification field to prevent tracking.
Methods
new
normalize_ipv4
- Sets TTL to
ttl_valueifnormalize_ttlis enabled - Randomizes IP ID if
randomize_ip_idis enabled
normalize_tcp
- Sets window size to 65535 if
normalize_windowis enabled
tcp_offset
Some(offset) if the packet is valid IPv4 TCP, None otherwise.
apply
TransformResult::Continue
Behavior
- Only processes packets with valid IPv4 headers (minimum 20 bytes)
- Skips non-IPv4 packets (e.g., IPv6)
- TCP normalization only applies to TCP packets (IP protocol = 6)
- Packets smaller than minimum header size are ignored
- The transform is enabled when any normalization option is active
- Uses packet count as seed for randomization:
seed = packet_count * 0xDEADBEEF
Example Configuration
Normalize to Linux defaults
Randomize IP ID only
Windows fingerprint
Code Example
From header.rs:161:IPv4 Header Normalization
From header.rs:20:TCP Header Normalization
From header.rs:68:Header Field Locations
IPv4 Header (20 bytes minimum)
- Byte 0: Version and IHL
- Bytes 4-5: Identification
- Byte 8: Time To Live (TTL)
- Byte 9: Protocol
TCP Header (20 bytes minimum, follows IPv4)
- Bytes 14-15: Window Size (relative to TCP header start)
Use Cases
- OS fingerprinting evasion: Normalize headers to match a different OS
- Tracking prevention: Randomize IP ID to prevent packet tracking
- Fingerprint obfuscation: Make all connections appear identical
- Protocol normalization: Standardize header values across flows
Limitations
- Only supports IPv4 (not IPv6)
- Only normalizes TCP windows (not UDP)
- Does not recalculate checksums (assumes lower-level handling)
- Small packets and malformed headers are silently ignored