Feed Suricata, Snort & Zeek Streams They Won’t Silently Drop
Classic IDS headache: you write a shiny new Suricata rule with flow:established,to_server, throw one lonely spoofed packet at it, nothing fires in eve.json, and you spend an hour blaming your regex when Suricata’s stream engine just threw your orphan packet in the trash.
The Catch
Suricata, Snort 3, and Zeek track full TCP streams and check checksums by default. If your test capture skips syn -> syn ack -> ack or has off-by-one SEQ numbers after editing a payload string, the Layer 7 dissector (tls.sni, http.header, dns.query) never even runs.
Checking binary .pcap fixtures into Git isn’t much better: six months later when someone needs to change "bad-domain.test" to a new domain of a different byte length, nobody can edit the binary blob without corrupting the rest of the TCP stream.
One Clean 16-Frame Regression Capture for 4 Suricata / Zeek Detections
Before pushing new rules to 40 sensors, this script builds four crisp triggers in one file: (1) a C2 DNS lookup <-> RCODE 5 (REFUSED) sinkhole reply; (2) an established TCP 443 stream carrying TLS 1.3 SNI "shadow-upload.example.net"; (3) an established TCP 80 POST from "ScannerBot/2.1" answered by an HTTP 403 WAF block; and (4) rapid SYN scan probes + a 2-piece fragmented IPv4 UDP packet (mf + fragoffset 185).
Adapt It for Your Network
- Match scanner and target to $HOME_NET / $EXTERNAL_NET in your suricata.yaml.
- Edit dns qname, tls clienthello sni, http headers, or fragment offsets in plain text.
- Compile -> run suricata -r ids_scan_test.pcap -k none or zeek -C -r ids_scan_test.pcap -> check eve.json.
.frasm -> .pcap
Preview frames inline or open in Playground ->Emits 16 noise-free frames covering a DNS sinkhole, stateful TLS 1.3 SNI, stateful HTTP POST/403, SYN scan, and fragmented IPv4 UDP.
host scanner { ip 172.18.99.10 }host target { ip 172.18.10.50 }flow dns_tls_and_waf_check(src, dst) { src -> dst dns query txid 0x4401 qname "c2-beacon.bad-domain.test" qtype "A" wait 1ms src <- dst dns response txid 0x4401 qname "c2-beacon.bad-domain.test" qtype "A" rcode 5 wait 2ms src -> dst tcp syn srcport 53443 dstport 443 win 65535 mss 1460 wait 1ms src <- dst tcp syn ack win 65535 mss 1460 wait 1ms src -> dst tcp ack wait 1ms src -> dst tls clienthello sni "shadow-upload.example.net" ciphersuite 4866 alpn "h2" wait 2ms src -> dst tcp syn srcport 53080 dstport 80 win 65535 mss 1460 wait 1ms src <- dst tcp syn ack win 65535 mss 1460 wait 1ms src -> dst tcp ack wait 1ms src -> dst http post uri "/admin/export" hosthdr "portal.local" useragent "ScannerBot/2.1" body "{\"dump\":true}" wait 2ms src <- dst http status 403 reason "Forbidden" body "{\"error\":\"blocked_by_waf\"}" wait 2ms}flow syn_scan_and_fragments(src, dst) { src -> dst tcp syn srcport 61001 dstport 21 wait 1ms src -> dst tcp syn srcport 61002 dstport 22 wait 1ms src -> dst tcp syn srcport 61003 dstport 80 wait 1ms src -> dst udp dstport 161 ipid 4421 mf fragoffset 0 wait 1ms src -> dst udp dstport 161 ipid 4421 fragoffset 185 wait 1ms}compile { dns_tls_and_waf_check(scanner, target) syn_scan_and_fragments(scanner, target)}# 1. Build the IDS/WAF validation capture
frameassembly ids_scan_test.frasm ids_scan_test.pcap
# 2. Run Suricata offline against the generated .pcap (writes eve.json / fast.log)
suricata -r ids_scan_test.pcap -k none -l ./suricata_out/
# 3. Or run Zeek offline to generate dns.log, ssl.log, http.log, and conn.log
zeek -C -r ids_scan_test.pcapKeep ids_scan_test.frasm in Git and compile .pcap in under 1ms
Single rootless binary + VS Code extension with live squiggles, quick-fixes, and side-by-side packet ladders ready for Wireshark.