Includes AirPlan design documents, AircOding-alpha1-plan, AirPlanV2, AirPlan-ParaV2, AirPlan-Para V1 reference docs, and all working code changes across packages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4.9 KiB
Executable File
4.9 KiB
Executable File
description, argument-hint, allowed-tools
| description | argument-hint | allowed-tools | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Enter, exit, inspect, capture, remote-capture, or read AirNDB tcpdump/WinDump network debug mode |
|
|
/airndb
控制当前工作区的 AirNDB 网络抓包调试模式。
用户传入参数:$ARGUMENTS
enter或空参数:进入 AirNDB 模式并初始化网络调试上下文。status:检查 AirNDB 状态和关键文件是否存在。setup:执行首启工具自检;Windows 下缺少 tcpdump/WinDump 时自动下载官方WinDump.exe并写入AirPlan/state/airndb/tool.env。interfaces:调用 tcpdump/WinDump 列出可抓包接口。command:生成安全、有界的 tcpdump/WinDump 抓包命令,不实际执行。capture:执行短时有界抓包,写入 timestamped.pcap和 JSON 报告。read:读取已有.pcap,生成文本摘要和 JSON 报告。remote-setup:检查远程设备 SSH 和抓包工具;缺失时自动尝试配置远程tcpdump。remote-status:只检查远程设备配置和工具状态,不自动安装。remote-interfaces:通过 SSH 调用远端抓包工具列出接口。remote-command:生成安全、有界的远程抓包命令,不实际执行。remote-capture:通过 SSH 执行短时有界远程抓包,并把 pcap/JSON 报告拉回当前项目。exit:退出 AirNDB 模式。
执行步骤
- 解析
$ARGUMENTS,默认动作为enter。 - 在当前项目根目录运行;
enter/setup会检测tcpdump/WinDump.exe,Windows 缺失时自动从 WinDump 官方下载页获取WinDump.exe,校验 SHA1 后配置AirPlan/state/airndb/tool.env:
python "$HOME/plugins/airndb/scripts/airndb_mode.py" --mode <enter|setup|exit|status> --project .
如果 python 不存在,尝试 py、python3 或用户提供的 Python 绝对路径。
- 如果
$ARGUMENTS包含remote、ssh、远程,或用户已经说明目标流量在远程设备、测试机、服务器、VM、容器宿主机、SSH 主机上,优先运行远程设备 helper:
python "$HOME/plugins/airndb/scripts/airndb_remote_device.py" --project . --action <setup|status|interfaces|command|capture>
首次缺少远程配置时,helper 会生成 AirPlan/state/airndb/remote-device.env.example 并提示设置 AIRNDB_REMOTE_SSH_TARGET。有 SSH 目标后,helper 会探测远端 tcpdump / dumpcap;缺失时自动尝试安装 tcpdump,只使用非交互式 sudo -n,无法自动配置时停止并提示用户。
interfaces且目标是本机时运行:
python "$HOME/plugins/airndb/scripts/airndb_capture.py" --project . --action interfaces
command且目标是本机时先收集接口、host/port/protocol/filter、包数或超时,再运行:
python "$HOME/plugins/airndb/scripts/airndb_capture.py" --project . --action command --iface <iface> --filter "<bpf>" --count 200
capture且目标是本机时必须使用有界抓包:
python "$HOME/plugins/airndb/scripts/airndb_capture.py" --project . --action capture --iface <iface> --filter "<bpf>" --count 200 --timeout 30
read时读取已有 pcap:
python "$HOME/plugins/airndb/scripts/airndb_capture.py" --project . --action read --read-file docs/network/airndb-captures/<file>.pcap --filter "<bpf>"
- 每次抓包或读取后维护:
AirPlan/docs/network/airndb-log.mddocs/architecture/adr/docs/architecture/c4/module.mdAGENTS.md
安全边界
- 只抓取用户授权的本机、项目、测试环境或明确允许的网络流量。
- 默认禁止无界抓包;必须使用
--count、--timeout或轮转策略。 - 默认使用
-nn和-s 0,避免 DNS/service-name 解析并保留完整包。 - 自动获取仅下载
WinDump.exe并配置工具路径,不静默安装 WinPcap/Npcap 抓包驱动;接口列举失败时提示用户安装驱动或以管理员权限重试。 - pcap 可能包含凭据、cookie、token、内网地址或个人信息;对外分享前必须提醒脱敏。
输出文案
进入模式:
AirNDB 模式已开启:已初始化或检查 AGENTS.md、ADR、C4 module 和 network debug log,并完成 tcpdump/WinDump 工具自检。请说明网络问题、目标主机/端口/协议、抓包接口和允许的抓包窗口。
抓包完成:
AirNDB 抓包完成:pcap 和 JSON 报告已写入 docs/network/airndb-captures/,请结合 airndb-log.md 继续分析。
remote-capture 完成:
AirNDB 远程抓包完成:已通过 SSH 执行有界抓包,pcap 和 JSON 报告已写入 docs/network/airndb-captures/,请结合 airndb-log.md 继续分析。
状态检查:
AirNDB 状态:<enabled|disabled>
关键文件:逐项列出 ok/missing。