by John Lauer
Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap.
← Commit history
plugin source v0.1.0
8 files changed
+132−21
README.md+8−2@@ -1,3 +1,9 @@-# CDC / ACM serial sniffer+# adom-usb-sniffer-cdc -Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap.+**adom-usb sniffer plugin.** Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap.++```bash+adompkg install adom-usb-sniffer-cdc+```++Once installed, `adom-usb` discovers it (scans `~/.adom/usb-plugins/`) and routes the **Sniff** action for matching devices (CDC serial) to it. See the adom-usb wiki page → *Writing a packet-sniffer plugin*.
adom-usb-sniffer-cdcadded+18@@ -0,0 +1,18 @@+#!/usr/bin/env bash+# CDC / ACM serial sniffer — adom-usb sniffer plugin (API v1). Implements: manifest, sniff.+set -euo pipefail; HERE="$(cd "$(dirname "$0")" && pwd)"+cmd="${1:-}"; shift || true+case "$cmd" in+ manifest) cat "$HERE/plugin.json";;+ sniff)+ VID="" PID="" BUSID="" TARGET="" SECONDS_N=10 OUT=""+ while [ $# -gt 0 ]; do case "$1" in --vid)VID="$2";shift 2;; --pid)PID="$2";shift 2;; --busid)BUSID="$2";shift 2;; --target)TARGET="$2";shift 2;; --seconds)SECONDS_N="$2";shift 2;; --out)OUT="$2";shift 2;; *)shift;; esac; done+ OUT="${OUT:-/tmp/adom-usb-sniffer-cdc-${VID}-${PID}.pcap}"; BUS_NUM="${BUSID%%-*}"+ sudo modprobe usbmon 2>/dev/null || true+ if command -v tshark >/dev/null; then+ timeout "$SECONDS_N" tshark -i "usbmon${BUS_NUM}" -w "$OUT" -f "usb.idVendor==0x${VID} && usb.idProduct==0x${PID}" 2>/dev/null || true+ PKTS=$(tshark -r "$OUT" 2>/dev/null | wc -l | tr -d ' ')+ else PKTS=0; fi+ printf '{"ok":true,"pcap":"%s","packets":%s,"decoders":["cdc-acm", "at-commands"],"summary":"captured %s packets for %s:%s on %s"}\n' "$OUT" "${PKTS:-0}" "${PKTS:-0}" "$VID" "$PID" "$TARGET";;+ *) echo "usage: adom-usb-sniffer-cdc manifest | sniff --vid <hex> --pid <hex> --busid <b> --target <host> [--seconds N] [--out FILE]" >&2; exit 2;;+esac
install.shadded+9@@ -0,0 +1,9 @@+#!/bin/bash+set -euo pipefail+DIR="$(cd "$(dirname "$0")" && pwd)"; SLUG="adom-usb-sniffer-cdc"+PDIR="${HOME}/.adom/usb-plugins/${SLUG}"; mkdir -p "$PDIR" "${HOME}/.local/bin"+install -m 0644 "$DIR/plugin.json" "$PDIR/plugin.json"+install -m 0755 "$DIR/$SLUG" "$PDIR/$SLUG"+[ -d "$DIR/firmware" ] && cp -r "$DIR/firmware" "$PDIR/" || true+ln -sf "$PDIR/$SLUG" "${HOME}/.local/bin/$SLUG"+echo "Installed plugin $SLUG -> $PDIR (adom-usb discovers it on next refresh)"
package.jsonadded+54@@ -0,0 +1,54 @@+{+ "slug": "adom-usb-sniffer-cdc",+ "version": "0.1.0",+ "type": "app",+ "description": "Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap.",+ "dependencies": {},+ "keywords": [+ "adom-usb-plugin",+ "sniffer",+ "usb"+ ],+ "license": "MIT",+ "scripts": {+ "install": "./install.sh",+ "uninstall": "./uninstall.sh"+ },+ "files": [+ "adom-usb-sniffer-cdc",+ "plugin.json",+ "install.sh",+ "uninstall.sh",+ "package.json",+ "README.md",+ "page.json",+ "screenshots/**",+ "skills/**"+ ],+ "adom_usb_plugin": {+ "kind": "sniffer",+ "entrypoint": "adom-usb-sniffer-cdc",+ "matches": {+ "class": [+ "CDC serial"+ ],+ "vid": [+ "*"+ ],+ "pid": [+ "*"+ ]+ },+ "capture": "usbmon",+ "decoders": [+ "cdc-acm",+ "at-commands"+ ],+ "api_version": "1"+ },+ "tags": [+ "adom-usb-plugin",+ "sniffer",+ "usb"+ ]+}
page.json+2−19@@ -1,5 +1,4 @@ {- "schema_version": 1, "type": "app", "slug": "adom-usb-sniffer-cdc", "title": "CDC / ACM serial sniffer",@@ -11,10 +10,7 @@ "path": "screenshots/hero.png" }, "install": {- "binary_name": "adom-usb-sniffer-cdc",- "install_dir": "",- "install_hint": "",- "version_cmd": ""+ "binary_name": "adom-usb-sniffer-cdc" }, "metadata": { "version": "0.1.0",@@ -29,18 +25,5 @@ "flash usb persona", "test usb device" ]- },- "author": {- "id": "6738b00a4dc87b8adbb0a5a3",- "name": "John Lauer",- "email": "[email protected]"- },- "tags": [],- "license": "proprietary",- "sample_prompts": [],- "discovery_triggers": [],- "discovery_pitch": null,- "created_at": "2026-06-20T02:57:46.841Z",- "updated_at": "2026-06-20T02:57:46.842Z",- "skills": []+ } }
plugin.jsonadded+26@@ -0,0 +1,26 @@+{+ "slug": "adom-usb-sniffer-cdc",+ "name": "CDC / ACM serial sniffer",+ "version": "0.1.0",+ "api_version": "1",+ "kind": "sniffer",+ "entrypoint": "adom-usb-sniffer-cdc",+ "matches": {+ "class": [+ "CDC serial"+ ],+ "vid": [+ "*"+ ],+ "pid": [+ "*"+ ]+ },+ "capture": "usbmon",+ "decoders": [+ "cdc-acm",+ "at-commands"+ ],+ "description": "Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap.",+ "homepage": "https://wiki.adom.inc/john/adom-usb-sniffer-cdc"+}
skills/adom-usb-sniffer-cdc/SKILL.mdadded+11@@ -0,0 +1,11 @@+---+name: adom-usb-sniffer-cdc+description: >+ adom-usb sniffer plugin. Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap. Trigger words: adom-usb-sniffer-cdc, adom-usb plugin, usb sniffer, sniff usb, capture usb packets, decode usb.+---++# adom-usb-sniffer-cdc++Capture + decode USB CDC/ACM serial traffic (virtual COM ports, modems, dev boards) to pcap.++Install: `adompkg install adom-usb-sniffer-cdc`. adom-usb discovers it automatically (scans `~/.adom/usb-plugins/`) and routes the Sniff action for matching devices to it. See the adom-usb wiki page for the plugin API.
uninstall.shadded+4@@ -0,0 +1,4 @@+#!/bin/bash+set -euo pipefail+rm -rf "${HOME}/.adom/usb-plugins/adom-usb-sniffer-cdc" "${HOME}/.local/bin/adom-usb-sniffer-cdc"+echo "Removed adom-usb-sniffer-cdc"