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

> **FrameAssembly v3.3.0** · Operational Playbook (SecOps, Firewalls & IDS) · Canonical URL: https://frameassembly-lang.dev/use-cases/shadow-it-detection-pcap

Verify your SPAN port mirror sees sketchy DNS, TLS 1.3 SNI, QUIC UDP 443, and rogue office NAS broadcasts—without actually visiting sketchy sites.

- **Category:** SecOps, Firewalls & IDS
- **Capture Filename:** `shadow_it_detection.frasm` (9 Ethernet frames)
- **Protocols Exercised:** `dns`, `tcp`, `tls`, `quic`, `mdns`, `ssdp`

## Operational Problem

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.

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.

## Scenario & Topology: Branch SPAN Turn-Up: DNS + TLS 1.3 SNI + QUIC + Rogue NAS Multicast

- **Topology:** `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.

## FrameAssembly Workflow

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

### 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.

## Runnable Capture Specification (`shadow_it_detection.frasm`)

```frameassembly
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)
}
```

## Equivalent CLI Commands

```bash
# 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
```

## Protocol Reference Links

- [`dns` — Domain Name System over UDP or TCP](https://frameassembly-lang.dev/docs/protocols/dns) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/dns.md))
- [`tcp` — Transmission Control Protocol & RFC 7323 Options](https://frameassembly-lang.dev/docs/protocols/tcp) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/tcp.md))
- [`tls` — Transport Layer Security Record & Handshake Layer](https://frameassembly-lang.dev/docs/protocols/tls) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/tls.md))
- [`quic` — QUIC v1 & v2 Encrypted UDP Transport](https://frameassembly-lang.dev/docs/protocols/quic) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/quic.md))
- [`mdns` — Multicast DNS Zero-Configuration Discovery](https://frameassembly-lang.dev/docs/protocols/mdns) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/mdns.md))
- [`ssdp` — Simple Service Discovery Protocol & UPnP Multicast](https://frameassembly-lang.dev/docs/protocols/ssdp) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/ssdp.md))
