FrameAssembly v3.1.2 · 8 Runnable Examples · .frasm <-> .pcap

Eight Packet Chores in Plain .frasm

Sometimes you only need a handful of frames to verify a firewall rule, test an encrypted SNMPv3 alert, feed a clean stream into Suricata, or redact private addresses from an outage .pcap before attaching it to a support ticket. Every example below runs right here in your browser.

Filter by Category

Showing 8 of 8 runnable examples
Use Case 01Firewall & ACLsfirewall_acl_test.frasm
Standalone Use Case Page

Poke Holes in a New Firewall Rulebase Before Live Traffic Does

You just rewrote 40 firewall rules and want to know if they actually work before flipping DNS. Sadly, curl and ping obey your OS kernel, while single-packet hping3 SYN blasts get laughed out of the room by any stateful NGFW.

The Catch

Normal tools like ping, curl, and netcat go through your laptop’s polite OS TCP/IP stack: they refuse to spit out an unsolicited mid-stream TCP ACK on port 22, they can’t bundle client probes and firewall rejections into a single baseline file, and Windows/macOS NIC drivers happily eat your 802.1Q VLAN tags for breakfast.

Meanwhile, stateless one-packet injectors (hping3 or quick Scapy one-liners) bounce straight off Palo Alto, FortiGate, Check Point, and nftables—because stateful engines ignore a bare TLS ClientHello SNI unless it rides in behind a real 3-way TCP handshake with matching 4-tuple SEQ/ACK math.

Setup & Topology

DMZ Reverse-Proxy Cutover on VLAN 40 (Without Waking Up the Whole Floor)

Outside Tester (203.0.113.45) -> Perimeter Firewall (VLAN 40) <-> DMZ Proxy (198.51.100.80)

You are swapping a crusty router ACL for a stateful zone firewall in front of a DMZ proxy (198.51.100.80) on VLAN 40. Instead of crossing your fingers at 2 AM, one 9-frame .frasm script checks all four cases at once: (1) TCP 443 finishes syn -> syn ack -> ack and carries a TLS 1.3 ClientHello SNI for "portal.corp.example"; (2) MySQL TCP 3306 gets slapped back with tcp rst ack; (3) a stray out-of-state TCP ACK on SSH port 22 gets dropped cold; and (4) ICMP ping into VLAN 40 gets icmp destunreach code 13 (Administratively Prohibited).

Adapt It for Your Network

  1. Change outside_tester and dmz_proxy to your own source zone and DMZ IPs/MACs.
  2. Tweak vlan 40, the permitted TLS sni string, and whichever dstport numbers your policy is supposed to block.
  3. Run frameassembly firewall_acl_test.frasm, then replay the .pcap across your test interface with tcpreplay.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Compiles 9 VLAN-40 frames covering a full TCP 443 handshake + TLS 1.3 SNI, a rejected MySQL 3306 probe, an out-of-state SSH ACK test, and an ICMP Code 13 admin block.

firewall_acl_test.frasm
Open in Playground
host outside_tester { ip 203.0.113.45 mac 00:0c:29:45:11:22 }
host dmz_proxy { ip 198.51.100.80 mac 00:1b:21:80:aa:bb }
flow allow_https_sni(ext, dmz) {
// 1. Permitted TCP 443 handshake + TLS 1.3 ClientHello SNI on VLAN 40
ext -> dmz vlan 40 tcp syn srcport 52100 dstport 443 win 64240 mss 1460 wscale 7 sackperm wait 1ms
ext <- dmz vlan 40 tcp syn ack win 65535 mss 1460 wscale 7 sackperm wait 1ms
ext -> dmz vlan 40 tcp ack wait 1ms
ext -> dmz vlan 40 tls clienthello sni "portal.corp.example" ciphersuite 4865 alpn "h2" wait 2ms
}
flow verify_firewall_blocks(ext, dmz) {
// 2. Blocked MySQL port 3306 rejected immediately with TCP RST+ACK
ext -> dmz vlan 40 tcp syn srcport 52101 dstport 3306 win 64240 mss 1460 wait 1ms
ext <- dmz vlan 40 tcp rst ack wait 5ms
// 3. Out-of-state TCP ACK probe on SSH port 22 (audits stateful session drop)
ext -> dmz vlan 40 tcp ack srcport 52102 dstport 22 seq 85000 acknum 42000 win 1024 wait 5ms
// 4. Blocked ICMP Echo answered with Code 13 (Administratively Prohibited)
ext -> dmz vlan 40 ttl 64 icmp echorequest id 900 seq 1 payload "DMZ_ACL_AUDIT" wait 1ms
ext <- dmz vlan 40 ttl 64 icmp destunreach code 13 wait 1ms
}
compile {
allow_https_sni(outside_tester, dmz_proxy)
verify_firewall_blocks(outside_tester, dmz_proxy)
}
Local CLI Build, Inspect & Replay Commands
# 1. Preview the 9-packet stateful firewall audit ladder in your terminal
frameassembly show firewall_acl_test.frasm

# 2. Compile to .pcap and verify TCP SEQ/ACK, VLAN 40, TLS SNI, and ICMP Code 13 in tshark
frameassembly firewall_acl_test.frasm firewall_acl_test.pcap
tshark -r firewall_acl_test.pcap

# 3. Replay into your firewall ingress test port or SPAN sensor
sudo tcpreplay -i eth0 firewall_acl_test.pcap
Use Case 02SNMP & Monitoringsnmpv3_trap_test.frasm
Standalone Use Case Page

Test Encrypted SNMPv3 Traps Before an Actual Outage

SNMPv3 traps travel one way (rtr -> nms) with zero handshake—if your EngineID, boot counter, or AES passphrase is off by one character, your collector silently drops the packet and nobody gets paged.

The Catch

With SNMPv3 GET polling, the collector talks to the router first and learns its EngineID automatically. Traps skip that step: a single UDP 162 packet arrives unannounced, and if snmptrapd or Zabbix disagrees on one nibble of EngineID or SHA-256/AES-128 key localization, nothing shows up in the event log.

Trying to test it with Net-SNMP’s snmptrap CLI usually means fighting missing MIB directories, only for the packet to leave from your laptop Wi-Fi IP instead of 10.250.1.1 so the collector ignores it anyway.

Setup & Topology

Edge Router linkDown -> 10s Wait -> linkUp Recovery on VLAN 20

Edge Router (10.250.1.1, EngineID 8000000903001c73a00001) -> Mgmt VLAN 20 -> Trap Collector (10.250.100.50:162)

You moved edge-rtr-01 (10.250.1.1) on VLAN 20 from old SNMPv2c "public" to SNMPv3 authPriv (SHA-256 + AES-128). Two lines emit the router’s exact IP/MAC, send an encrypted TenGigabitEthernet0/1/0 linkDown trap (ifOperStatus = 2), advance 10s on the capture clock, and send the matching linkUp recovery trap (ifOperStatus = 1).

Adapt It for Your Network

  1. Set edge_router ip to the exact switch or router management IP your monitoring server expects.
  2. Paste your real hex engineid, username, sha256 auth passphrase, and aes priv passphrase.
  3. Compile -> double-check decryption in Wireshark’s SNMP Users table -> replay with tcpreplay.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Runs real RFC 3414/7860 USM key localization + AES-128-CFB encryption to emit a VLAN 20 linkDown trap followed 10s later by linkUp.

snmpv3_trap_test.frasm
Open in Playground
host edge_router { ip 10.250.1.1 mac 00:1c:73:a0:00:01 }
host nms_collector { ip 10.250.100.50 mac 00:50:56:a0:00:50 }
flow link_flap_snmpv3_traps(rtr, nms) {
// 1. Encrypted SNMPv3 authPriv linkDown trap (ifOperStatus = 2 down) on Mgmt VLAN 20
rtr -> nms vlan 20 snmp3 trap user "noc_sha256_aes" engineid "8000000903001c73a00001"
engineboots 12 enginetime 86400
auth sha256 "AuthKey_SHA256_99!" priv aes "PrivKey_AES128_99!"
oid 1.3.6.1.6.3.1.1.5.3
varbind 1.3.6.1.2.1.1.5.0 string "edge-rtr-01.dc1"
varbind 1.3.6.1.2.1.2.2.1.2.5 string "TenGigabitEthernet0/1/0"
varbind 1.3.6.1.2.1.2.2.1.8.5 int 2 wait 10s
// 2. Recovery SNMPv3 authPriv linkUp trap 10s later (ifOperStatus = 1 up)
rtr -> nms vlan 20 snmp3 trap user "noc_sha256_aes" engineid "8000000903001c73a00001"
engineboots 12 enginetime 86410
auth sha256 "AuthKey_SHA256_99!" priv aes "PrivKey_AES128_99!"
oid 1.3.6.1.6.3.1.1.5.4
varbind 1.3.6.1.2.1.1.5.0 string "edge-rtr-01.dc1"
varbind 1.3.6.1.2.1.2.2.1.2.5 string "TenGigabitEthernet0/1/0"
varbind 1.3.6.1.2.1.2.2.1.8.5 int 1 wait 5ms
}
compile {
link_flap_snmpv3_traps(edge_router, nms_collector)
}
Local CLI Build, Inspect & Replay Commands
# 1. Compile the encrypted SNMPv3 authPriv linkDown + linkUp capture
frameassembly snmpv3_trap_test.frasm snmpv3_trap_test.pcap

# 2. Inspect SNMPv3 USM EngineID, Boots, Time, and Username in tshark
tshark -r snmpv3_trap_test.pcap -Y "snmp" -V

# 3. Replay the encrypted traps toward Zabbix, PRTG, LibreNMS, or snmptrapd
sudo tcpreplay -i eth0 snmpv3_trap_test.pcap
Use Case 03Pentest & SecOpspentest_lateral_audit.frasm
Standalone Use Case Page

VLAN Hopping, Kerberoasting & SMB ADMIN$ Without Locking Out AD

Firing live Impacket, Responder, or CrackMapExec on a Tuesday afternoon is a great way to lock out production service accounts, get your laptop quarantined by EDR in 4 seconds, or drown the SOC in angry alerts.

The Catch

When you just want to verify whether your switches drop double-tagged VLAN-hopping frames or whether your NDR sensor spots RC4 Kerberoasting + SMB2 ADMIN$ lateral movement, running live offensive tools on prod subnets is overkill.

And hand-rolling ASN.1 DER Kerberos TGS-REQ structures, BER-encoded LDAPv3 SPN filters, and UTF-16LE SMB2 tree-connects in raw Python bytes is a weekend you will never get back.

Setup & Topology

User VLAN 10 -> Server VLAN 20 Purple-Team Wake-Up Check

Jump Box (10.20.5.101, VLAN 10) -> Switch / Firewall -> Domain Controller (10.20.1.10) & File Server (10.20.1.50)

In 15 surgical packets—zero background chatter—you test four classics: (1) an 802.1ad double-tagged QinQ frame hopping outer VLAN 10 -> inner VLAN 20; (2) a lit-up TCP Xmas tree scan (fin + psh + urg) against RDP 3389; (3) an RC4-HMAC (etype 23) Kerberoast TGS-REQ for "mssqlsvc/sql01.corp.local" + stateful LDAP SPN search; and (4) an SMB2 "\\10.20.1.50\ADMIN$" mount attempt slapped down with STATUS_ACCESS_DENIED (0xc0000022).

Adapt It for Your Network

  1. Point jump_box, corp_dc, and file_srv at the IPs/MACs in your test segment.
  2. Swap the qinq outer/inner VLAN IDs, Kerberos realm/sname, LDAP filter, or SMB share string.
  3. Compile -> feed into suricata -r / zeek -r offline, or replay onto your SPAN/trunk port with tcpreplay.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Packs 15 frames covering an 802.1ad QinQ VLAN-hop, TCP Xmas scan, Kerberos RC4 TGS-REQ/REP, stateful LDAP SPN search, and SMB2 ADMIN$ rejection.

pentest_lateral_audit.frasm
Open in Playground
host jump_box { ip 10.20.5.101 mac 00:50:56:20:05:65 }
host corp_dc { ip 10.20.1.10 mac 00:50:56:20:01:0a }
host file_srv { ip 10.20.1.50 mac 00:50:56:20:01:32 }
flow l2_vlan_hop_and_stealth_scan(box, srv) {
// 1. 802.1ad double-tagged VLAN-hopping probe (outer VLAN 10 -> inner VLAN 20)
box -> srv qinq 10 innervlan 20 icmp echorequest id 404 seq 1 payload "VLAN_HOP_AUDIT" wait 2ms
// 2. Stealth TCP Xmas scan (FIN + PSH + URG) against RDP port 3389
box -> srv tcp fin psh urg srcport 59100 dstport 3389 win 1024 urgent 1 wait 5ms
}
flow ad_kerberoast_and_smb_lateral(box, dc, srv) {
// 3. RC4-HMAC (etype 23) Kerberoast TGS-REQ + stateful LDAP SPN enumeration
box -> dc kerberos tgsreq realm "CORP.LOCAL" cname "svc_audit" sname "mssqlsvc/sql01.corp.local" etype 23 wait 2ms
box <- dc kerberos tgsrep realm "CORP.LOCAL" cname "svc_audit" sname "mssqlsvc/sql01.corp.local" etype 23 wait 2ms
box -> dc tcp syn srcport 51389 dstport 389 win 64240 mss 1460 wait 1ms
box <- dc tcp syn ack win 64240 mss 1460 wait 1ms
box -> dc tcp ack wait 1ms
box -> dc ldap searchreq msgid 2 basedn "dc=corp,dc=local" filter "(servicePrincipalName=*)" wait 2ms
box <- dc ldap searchdone msgid 2 resultcode 0 wait 2ms
// 4. SMB2 lateral-movement probe to ADMIN$ share on TCP 445
box -> srv tcp syn srcport 51445 dstport 445 win 64240 mss 1460 wait 1ms
box <- srv tcp syn ack win 64240 mss 1460 wait 1ms
box -> srv tcp ack wait 1ms
box -> srv smb negotiate msgid 0 wait 1ms
box -> srv smb treeconnect msgid 1 sessionid 0x0001000000000001 share "\\\\10.20.1.50\\ADMIN$" wait 2ms
box <- srv smb treeconnect msgid 1 sessionid 0x0001000000000001 treeid 1 status 0xc0000022 wait 1ms
}
compile {
l2_vlan_hop_and_stealth_scan(jump_box, file_srv)
ad_kerberoast_and_smb_lateral(jump_box, corp_dc, file_srv)
}
Local CLI Build, Inspect & Replay Commands
# 1. Preview all 15 frames (QinQ, Xmas TCP, Kerberos, LDAP, SMB2) in terminal
frameassembly show pentest_lateral_audit.frasm

# 2. Compile to .pcap and inspect Kerberos SPN, LDAP filter, and SMB2 share in tshark
frameassembly pentest_lateral_audit.frasm pentest_lateral_audit.pcap
tshark -r pentest_lateral_audit.pcap

# 3. Validate NDR / IDS detections offline or replay onto an isolated test SPAN port
suricata -r pentest_lateral_audit.pcap -k none -l ./suricata_pentest/
zeek -C -r pentest_lateral_audit.pcap
Use Case 04Pentest & SecOpsids_scan_test.frasm
Standalone Use Case Page

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.

Setup & Topology

One Clean 16-Frame Regression Capture for 4 Suricata / Zeek Detections

Scanner / Beacon (172.18.99.10) <-> Sensor / Gateway (172.18.10.50)

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

  1. Match scanner and target to $HOME_NET / $EXTERNAL_NET in your suricata.yaml.
  2. Edit dns qname, tls clienthello sni, http headers, or fragment offsets in plain text.
  3. Compile -> run suricata -r ids_scan_test.pcap -k none or zeek -C -r ids_scan_test.pcap -> check eve.json.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Emits 16 noise-free frames covering a DNS sinkhole, stateful TLS 1.3 SNI, stateful HTTP POST/403, SYN scan, and fragmented IPv4 UDP.

ids_scan_test.frasm
Open in Playground
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)
}
Local CLI Build, Inspect & Replay Commands
# 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.pcap
Use Case 05Edit & Sanitize PCAPredacted_radius.frasm
Standalone Use Case Page

Scrub Embarrassing IPs & Usernames Out of a .pcap Before Sending to Support

Vendor support says "attach a packet capture of the outage." Security says "if you upload internal 10.x subnets or real employee usernames to a third-party ticket portal, you’re fired." And tcprewrite chokes the moment you try changing variable-length Layer 7 strings.

The Catch

Real outage captures are full of things you don’t want leaving the building: internal IP schemes, employee RADIUS/LDAP logins, internal Syslog hostnames, and 4,000 unrelated broadcast packets. Chopping frames at byte 64 with editcap -s 64 hides the PII—right along with the exact Layer 7 bug the vendor needs to see.

Meanwhile, tcprewrite only swaps outer L2/L3 headers because changing "jsmith@secretcorp.internal" to "redacted" changes the packet’s byte length, breaking IP Total Length, UDP/TCP checksums, and every TCP sequence number downstream.

Setup & Topology

outage.pcap -> reverse -> Redact RADIUS & Syslog -> redacted_auth.pcap

Branch Switch (192.0.2.1, VLAN 100) <-> AAA Server (198.51.100.10)

Drop an outage .pcap onto /playground (0 bytes uploaded) or run frameassembly reverse, swap private IPs for RFC 5737 documentation space (192.0.2.1 and 198.51.100.10), replace the employee username with "redacted_user", delete stray broadcast lines, and compile a clean 3-frame reproducer.

Adapt It for Your Network

  1. Run frameassembly reverse outage.pcap redacted.frasm (or drag-and-drop into /playground).
  2. Replace internal host IPs/MACs with 192.0.2.x / 198.51.100.x and scrub usernames, SNIs, or hostnames.
  3. Recompile with frameassembly redacted.frasm redacted_auth.pcap and inspect in Wireshark before sharing.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Decompiles binary .pcap -> .frasm text, lets you redact L2–L7 fields and trim background chatter, and recompiles valid lengths + checksums.

redacted_radius.frasm
Open in Playground
host branch_gw { ip 192.0.2.1 mac 0011.22aa.bb01 }
host auth_srv { ip 198.51.100.10 mac 0011.22cc.dd10 }
flow redacted_radius_repro(gw, srv) {
gw -> srv vlan 100 radius accessrequest id 10 user "redacted_user" nasip 192.0.2.1 wait 10ms
gw <- srv vlan 100 radius accessaccept id 10 wait 5ms
gw -> srv vlan 100 syslog facility 1 severity 6 hostname "branch-gw" app "tacacs" msg "User authenticated via 802.1X" wait 2ms
}
compile {
redacted_radius_repro(branch_gw, auth_srv)
}
Local CLI Build, Inspect & Replay Commands
# 1. Convert any existing .pcap or .pcapng into editable .frasm text
frameassembly reverse outage.pcap redacted_radius.frasm

# 2. After editing IPs, VLANs, or strings in .frasm, preview and rebuild to .pcap
frameassembly show redacted_radius.frasm
frameassembly redacted_radius.frasm redacted_auth.pcap

# 3. Verify updated IPs, VLAN tags, and valid checksums in tshark
tshark -r redacted_auth.pcap -V
Use Case 06Shadow IT & Monitoringshadow_it_detection.frasm
Standalone Use Case Page

Check Shadow IT & Rogue-Gadget Sensors Without Getting Flagged by HR

You wired up a shiny new passive SPAN/Zeek sensor to catch rogue NAS boxes and unapproved cloud uploads—except nobody wants to test it by browsing blocked sites from their corporate laptop or smuggling a consumer IoT toaster into VLAN 30.

The Catch

Passive SPAN mirrors fail silently all the time (wrong trunk direction, missing VLAN in monitor session, or UDP 443 QUIC slipping right past a legacy TCP-only TLS inspector).

Generating synthetic packets lets you test every blind spot—DNS A queries, stateful TLS 1.3 ClientHello SNI, HTTP/3 QUIC Initial frames, and RFC 1112 multicast mDNS/SSDP broadcasts—without touching a single real external domain.

Setup & Topology

Branch SPAN Turn-Up: DNS + TLS 1.3 SNI + QUIC + Rogue NAS Multicast

Workstation (10.30.15.42) -> Gateway (10.30.15.1) & LAN Multicast (224.0.0.251 / 239.255.255.250)

Nine packets prove your sensor sees all four tricks: (1) a DNS query <-> reply for "personal-cloud-sync.example.io"; (2) a full TCP 443 handshake followed by a TLS 1.3 ClientHello SNI; (3) a UDP 443 QUIC Initial packet trying to dodge TCP inspection; and (4) mDNS (224.0.0.251) + SSDP (239.255.255.250) broadcasts from "rogue-office-nas.local" with auto-derived 01:00:5e:xx:xx:xx multicast MACs.

Adapt It for Your Network

  1. Change qname and tls clienthello sni to the exact domains on your watchlist.
  2. Compile -> replay into your SPAN/TAP NIC with tcpreplay, or run zeek -C -r shadow_it_detection.pcap.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Emits 9 frames covering a DNS lookup, stateful TLS 1.3 SNI, UDP 443 QUIC Initial, and multicast mDNS + SSDP rogue-device chatter.

shadow_it_detection.frasm
Open in Playground
host employee_pc { ip 10.30.15.42 }
host corp_gw { ip 10.30.15.1 }
host mdns_group { ip 224.0.0.251 }
host ssdp_group { ip 239.255.255.250 }
flow unmanaged_saas_and_ai(ws, gw) {
ws -> gw dns query txid 0x7101 qname "personal-cloud-sync.example.io" qtype "A" wait 1ms
ws <- gw dns response txid 0x7101 qname "personal-cloud-sync.example.io" qtype "A" rdata "198.51.100.77" wait 1ms
ws -> gw tcp syn srcport 53443 dstport 443 win 65535 mss 1460 wait 1ms
ws <- gw tcp syn ack win 65535 mss 1460 wait 1ms
ws -> gw tcp ack wait 1ms
ws -> gw tls clienthello sni "unmanaged-ai-assistant.example.io" ciphersuite 4865 alpn "h2" wait 2ms
ws -> gw dstport 443 quic initial version 1 dcid "a1b2c3d4e5f60708" scid "1122334455667788" pktnum 1 payload "QUIC_DOH_BYPASS" wait 2ms
}
flow rogue_device_discovery(ws, mcast_dns, mcast_upnp) {
ws -> mcast_dns mdns query qname "rogue-office-nas.local" qtype "A" wait 2ms
ws -> mcast_upnp ssdp msearch st "ssdp:all" mx 3 wait 2ms
}
compile {
unmanaged_saas_and_ai(employee_pc, corp_gw)
rogue_device_discovery(employee_pc, mdns_group, ssdp_group)
}
Local CLI Build, Inspect & Replay Commands
# 1. Build the Shadow IT & rogue device test capture
frameassembly shadow_it_detection.frasm shadow_it_detection.pcap

# 2. Verify DNS qname, TLS SNI hostname, QUIC DCID, and mDNS/SSDP fields in tshark
tshark -r shadow_it_detection.pcap -T fields -e frame.number -e ip.src -e dns.qry.name -e tls.handshake.extensions_server_name

# 3. Replay into your monitoring sensor SPAN/TAP interface or evaluate in Zeek
sudo tcpreplay -i eth0 shadow_it_detection.pcap
zeek -C -r shadow_it_detection.pcap
Use Case 07Campus & VLANsqinq_mpls_trunk.frasm
Standalone Use Case Page

Stamp 802.1Q VLAN, Double-Tagged QinQ & MPLS Without an IXIA Rack

Normal OS sockets won’t let unprivileged users emit outer 802.1ad QinQ S-tags, 20-bit MPLS labels, or 802.1p priority bits—and desktop NIC drivers famously strip 802.1Q tags before Wireshark even sees them.

The Catch

When a carrier hands you a new Metro Ethernet circuit or you’re tuning VoIP strict-priority queues, you just want to know whether S-VLAN 2000 + C-VLAN 150 + MPLS 40960 + DSCP 46 make it to the other side unscathed.

Renting a hardware traffic generator or wiring up three spare lab routers just to push four shim bytes onto an Ethernet header is ridiculous when you can type qinq 2000 innervlan 150 mpls 40960 exp 5 on one line.

Setup & Topology

Voice VLAN 110 (DSCP EF) + Carrier QinQ 2000/150 + MPLS 40960 Check

Branch CPE (10.220.1.10) <-> Carrier QinQ 2000/150 + MPLS 40960 <-> HQ Edge (10.220.1.200)

Three frames cover the whole trunk check: (1) a Voice VLAN 110 G.711 RTP packet stamped with pcp 5 and dscp 46 (EF); followed by (2 & 3) cpe -> hq and cpe <- hq double-tagged 802.1ad frames (qinq 2000 innervlan 150) carrying MPLS label 40960 (exp 5) and a TLS handshake.

Adapt It for Your Network

  1. Set branch_cpe and hq_gateway to your circuit endpoints.
  2. Drop vlan, pcp, dei, dscp, qinq <outer> innervlan <inner>, and mpls <label> right in front of any protocol.
  3. Compile -> verify tag stacks in tshark -> replay onto your trunk NIC.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Writes raw 802.1Q (0x8100), 802.1ad (0x88a8), MPLS (0x8847), and DSCP EF headers straight into a 3-frame .pcap.

qinq_mpls_trunk.frasm
Open in Playground
host branch_cpe { ip 10.220.1.10 }
host hq_gateway { ip 10.220.1.200 }
flow metro_trunk(cpe, hq) {
cpe -> hq vlan 110 pcp 5 dei 0 dscp 46 rtp pt 0 seq 1 timestamp 160 payload "G711_VOICE_EF" wait 5ms
cpe -> hq qinq 2000 innervlan 150 mpls 40960 exp 5 tls clienthello sni "wan.example.com" wait 5ms
cpe <- hq qinq 2000 innervlan 150 mpls 40960 exp 5 tls serverhello wait 5ms
}
compile {
metro_trunk(branch_cpe, hq_gateway)
}
Local CLI Build, Inspect & Replay Commands
# 1. Build the VLAN, QinQ, MPLS & DSCP QoS capture
frameassembly qinq_mpls_trunk.frasm qinq_mpls_trunk.pcap

# 2. Verify VLAN IDs, 802.1p PCP priority, DSCP markings, and MPLS labels in tshark
tshark -r qinq_mpls_trunk.pcap -T fields -e frame.number -e vlan.id -e vlan.priority -e mpls.label -e ip.dsfield.dscp

# 3. Replay onto your 802.1Q / 802.1ad trunk interface
sudo tcpreplay -i eth0 qinq_mpls_trunk.pcap
Use Case 08Industrial OTscada_modbus.frasm
Standalone Use Case Page

Poke OT / SCADA Firewalls Without Accidentally Opening a Substation Breaker

OT firewall rules usually say "Historian may Read Holding Registers (0x03), but NEVER Write Single Register (0x06) or DNP3 Operate." Testing the block rule against a live factory PLC is a career-limiting move, and calculating IEEE 1815 DNP3 16-byte chunk CRCs by hand is pure misery.

The Catch

OT firewalls and ICS sensors (Claroty, Dragos, Nozomi, Palo Alto/Fortinet OT profiles) dissect deep inside Modbus, DNP3, S7comm, BACnet, EtherNet/IP, and OPC UA.

If your synthetic DNP3 packet has a bad link-layer or data-chunk CRC-16, or your Modbus TCP packet skips the port 502 3-way handshake, the dissector drops it as corrupt wire noise instead of testing your actual function-code policy.

Setup & Topology

Level 3 HMI -> OT Firewall -> Level 1 PLC (Read OK, Write & Operate Blocked)

SCADA HMI (10.80.20.10) -> OT Conduit Firewall -> Plant PLC / RTU (10.80.10.50)

Nine frames, zero physical PLCs harmed: a TCP 502 handshake (syn -> syn ack -> ack), an allowed Modbus Read Holding Registers (40001) <-> response, an unauthorized Write Single Register (value 1500), DNP3 Select + Operate (Group 12 CROB with auto CRC-16), and BACnet ReadProperty.

Adapt It for Your Network

  1. Point scada_hmi and plc_node at your Level 3 historian and Level 1 controller IPs.
  2. Open TCP 502 with syn -> syn ack -> ack, then mix modbus, dnp3, s7comm, bacnet, ethernetip, or opcua lines.
  3. Compile -> replay across your OT test firewall or feed offline into Claroty/Dragos/Suricata.

.frasm -> .pcap

Click Preview Packets to dissect inline or Open in Playground to edit live.

Builds a stateful TCP 502 Modbus read/write check + DNP3 Select/Operate (with automatic IEEE 1815 CRC-16) + BACnet ReadProperty.

scada_modbus.frasm
Open in Playground
host scada_hmi { ip 10.80.20.10 }
host plc_node { ip 10.80.10.50 }
flow modbus_and_ot_poll(hmi, plc) {
hmi -> plc tcp syn srcport 50200 dstport 502 wait 1ms
hmi <- plc tcp syn ack wait 1ms
hmi -> plc tcp ack wait 1ms
hmi -> plc modbus readholdingregisters txid 101 unitid 1 addr 40001 count 4 wait 5ms
hmi <- plc modbus readholdingregisters txid 101 unitid 1 count 4 isresponse wait 5ms
hmi -> plc modbus writesingleregister txid 102 unitid 1 addr 40001 value 1500 wait 5ms
hmi -> plc transport udp dnp3 select src 1 dst 10 group 12 variation 1 wait 2ms
hmi -> plc transport udp dnp3 operate src 1 dst 10 group 12 variation 1 wait 2ms
hmi -> plc bacnet readproperty invokeid 10 objecttype 0 objectinstance 1 propertyid 85 wait 2ms
}
compile {
modbus_and_ot_poll(scada_hmi, plc_node)
}
Local CLI Build, Inspect & Replay Commands
# 1. Build the Industrial OT / SCADA conduit capture
frameassembly scada_modbus.frasm scada_modbus.pcap

# 2. Inspect Modbus function codes, DNP3 CRC-16 frames, and BACnet properties in tshark
tshark -r scada_modbus.pcap

# 3. Replay across your OT zone firewall or passive ICS sensor SPAN port
sudo tcpreplay -i eth1 scada_modbus.pcap
Browser Tab -> Terminal & Git

Have another packet chore worth adding here?

Send a quick note, or grab the local frameassembly binary so your test captures live as readable text in Git instead of capture_final_v4.pcap.

CLI & VS Code ->