/network-forensics:lockdown-iot-devicefrom network-forensics
Lock an IoT device (IP camera, smart plug) to the LAN - probe it, capture and trace its cloud egress at the firewall, document, block, verify.
Ships in network-forensics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Forensics-first playbook for a device the user wants to keep using locally only (e.g. a cheap IP camera feeding Frigate, Home Assistant or an NVR) while cutting its vendor cloud. Worked out on a Xiongmai-firmware Wi-Fi PTZ camera behind OPNsense; the method carries to any device and any stateful firewall.
Order is the point: probe, observe and document before you block. Once the rule is in, the interesting traffic stops and can no longer be studied.
references/opnsense-api.md, key/secret in OPNSENSE_URL, OPNSENSE_KEY,
OPNSENSE_SECRET); for other routers, use their state table, packet capture and
rule UI with the same steps.IP-Cam-Lockdown) with devices/, forensics/, captures/
(git-ignored) and a playbook.md. Ask once whether it will be public; if so, apply
the redaction rules below from the first commit.00:12:34:...).401, that is the
usual cause.nmap -sn, or the router's ARP table): usually the Wi-Fi chip vendor,
not the device maker.nmap -sT -p 1-10000 <dev> plus targeted UDP
(sudo nmap -sU -p 53,123,1900,3702,5353,6668,8765,32100,32108 <dev>). Match
against references/fingerprints.md.GetDeviceInformation, GetScopes, GetNetworkInterfaces, GetDNS,
GetNTP (snippet in references/probing.md). Model strings name the SoC;
firmware strings identify the firmware house./ and its JS; grep for hostnames (curl -s http://<dev>/ | grep -oE '[a-z0-9.-]+\.(com|cn|net)'). Plug-in download URLs often name the cloud brand.ffprobe rtsp://<user>:<pw>@<dev>:554/<path> for codec and real
resolution. Compare with the listing's claims (an "8MP" listing streaming
2880x1616 is the 5MP variant).adb shell pm list packages with the phone plugged in). Listings often show other
products' apps; take the app from the box or the user.devices/<platform>-<model>.md from templates/device-dossier.md.Observe in three windows, each with its own capture, because each shows things the others miss: idle (what it does on its own), live remote view (how the app reaches it) and reboot (the names it resolves and what it calls at startup). Nothing is blocked during this phase, so the app keeps working; tell the user that up front, or "it still works in the app" reads as a failed block.
host <dev>, excluding the NVR's local pull by port (e.g. not
554). On OPNsense the capture host field silently rejects compound expressions such
as <dev> and not net <lan>: the job runs but writes an empty pcap (24-byte header).search_jobs size, or a quick
tcpdump -r cap.pcap -c 5). Don't find out it was empty after the user's test.State table snapshot, then a 15-30 minute capture with nobody using the app. Answers: which hosts it keeps sessions with, keep-alive interval, whether video or audio leaves the house when nobody is watching.
The user puts the phone on mobile data (Wi-Fi off), opens the vendor app, watches live for 1-2 minutes, moves PTZ, tries talk-back, then closes the app and says "done". Answers: the session broker, whether a P2P hole-punch is attempted and whether it gets a reply, which relays carry the stream (often several in turn, in different regions), bitrate, and whether the media is encrypted (see payload inspection below).
Idle and live captures usually contain no DNS at all: the device resolved its servers long ago and caches them. A capture across a power cycle gets them.
port 67 or port 68 separately, or read the
router's DHCP lease log.# boot order: first packet of each flow
tshark -r boot.pcap -T fields -e frame.time_relative -e _ws.col.Protocol -e ip.dst -e udp.dstport -e tcp.dstport \
| awk '!seen[$3" "$4$5]++' | head -40
# hard-coded IPs: remote IPs never returned by a DNS answer
comm -23 <(tshark -r boot.pcap -T fields -e ip.dst | grep -vE '^(10|192\.168|172\.(1[6-9]|2[0-9]|3[01]))\.|^(22[4-9]|23[0-9])\.' | sort -u) \
<(tshark -r boot.pcap -Y 'dns.flags.response==1' -T fields -e dns.a | tr ',' '\n' | sort -u)
Remove the public resolvers and ICMP check targets from that list by hand; what is left was dialled by IP.
The device may bypass the LAN resolver, so the LAN DNS logs show nothing; read DNS from the captures:
tshark -r cap.pcap -Y 'dns.flags.response==0' -T fields -e frame.time_relative -e ip.dst -e dns.qry.name
tshark -r cap.pcap -Y 'dns.flags.response==1' -T fields -e dns.qry.name -e dns.a | sort -u # name -> IPs
tshark -r cap.pcap -Y 'udp.port==53 && !(ip.dst==<router>)' -T fields -e ip.dst | sort | uniq -c # resolvers it uses
Join dns.a against the flow table so each remote IP gets its name. Also check DoH/DoT
(TCP 853, or 443 to a known resolver IP): that hides names even from a capture.
whois <ip> | grep -iE 'netname|orgname|descr|country|route'
tshark -r cap.pcap -Y tls.handshake.extensions_server_name -T fields -e ip.dst -e tls.handshake.extensions_server_name | sort -u
tshark -r cap.pcap -q -z conv,udp -z conv,tcp # who, how much, how long
tshark -r cap.pcap -q -z io,stat,10 # traffic per 10 s, to match user actions
tshark -r cap.pcap -Y 'http.request' -T fields -e ip.dst -e http.host -e http.request.uri # plain HTTP (firmware checks)
Record the hosting owner and the role of each flow. Patterns (more in
references/fingerprints.md): long-lived bidirectional UDP to one host = registration
keep-alive / NAT pinhole; a persistent TCP session = control channel; one unanswered UDP
datagram when the app opens = failed P2P hole-punch; large outbound TCP lining up with
viewing = relayed stream; direct UDP 53 to a public resolver = hard-coded DNS; ICMP to
8.8.8.8 / 114.114.114.114 = "am I online" checks.
Check whether what leaves the house is encrypted, without decoding anything further than needed:
tshark -r cap.pcap -Y 'ip.dst==<peer>' -T fields -e data.data | head # keep-alive bytes
tshark -r cap.pcap -q -z follow,tcp,raw,<stream#> | xxd | head -40 # relay stream
strings -n 8 cap.pcap | sort | uniq -c | sort -rn | head # plaintext IDs, hosts
Look for the device serial / cloud ID in plain ASCII in keep-alives, vendor media frame
headers followed by codec start codes (plain video/audio), and A-law/µ-law silence runs
(0x55/0xD5, 0xFF/0x7F) that mark raw audio. Count frame types to see which parts,
if any, are scrambled. Report what was seen, and mark decoding as not tested.
Write forensics/<YYYY-MM-DD>-<model>/findings.md from templates/findings.md
before touching the firewall:
findings.md, capture.md, reboot.md).Raw captures stay out of the repo (captures/ git-ignored): they carry the device's
cloud ID. Commit only extracts.
Redaction for a public record: serials or UIDs that double as the cloud/P2P ID,
credentials, full MACs (keep the OUI), the home's public IP, internal hostnames and
addressing beyond placeholders like <cam> and <lan>.
Phases 4-5 are expanded, with a 10 min / 1 h / 24 h test matrix, a reboot-while-blocked
test and a post-block.md record, in the verify-iot-lockdown skill. Use it for
anything you will publish or score. The short form follows.
Confirm the rule set with the user before applying it. On the device's interface, at the top of the rule list, in this order:
| # | Action | Source | Destination | Why |
|---|---|---|---|---|
| 1 | Pass | device | LAN net | replies to the NVR, ONVIF discovery |
| 2 | Pass | device | firewall, UDP 123 | NTP; point the device's NTP at the router or timestamps drift |
| 3 | Pass (optional) | device | firewall, 53 | local DNS only; omit to make it fully dark |
| 4 | Block + log | device | any | cloud, hard-coded DNS, ICMP checks, firmware calls |
Also:
On OPNsense, back up the config first; rules can be added by API (see references).
findings.md, and
update the device's status in the repo README.score-device-security (Local-Only Security Rubric) once the
findings exist, and re-score after verify-iot-lockdown.references/opnsense-api.md: state table, packet capture, states kill, rules via API.references/probing.md: ONVIF queries, RTSP probe, web-UI hostname grep.references/fingerprints.md: ports and strings that identify common camera/IoT platforms.references/example-xiongmai-gk7205v500.md: a full worked run (idle, live view, boot).templates/device-dossier.md, templates/findings.md.What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/score-device-securityRate an IoT device (IP camera, hub) for local-only use and cloud exposure on a fixed 100-point rubric, from its forensics findings and vendor docs. Produces a score file, a grade with red flags, and the list of what is still untested./verify-iot-lockdownApply and validate an internet block on an IoT device (IP camera), then record what happened afterwards. Does RTSP/ONVIF/NVR recording keep working, does the vendor app work on the LAN, what does the device keep trying to reach, does it survive a reboot while blocked? Tested at 10 min, 1 h and 24 h.Other plugins' skills for the same job
network-forensics@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin network-forensics