net

Original🇨🇳 Chinese
Translated
7 scripts

Embedded network debugging tool used for interface discovery, packet capture, pcap/pcapng analysis, connectivity testing, port scanning, and traffic statistics. It is automatically triggered when users mention network protocol debugging terms such as Wireshark, tshark, Npcap, packet capture, network joint debugging, port scanning, connectivity troubleshooting, pcap analysis, network interface, ping test, traceroute, traffic statistics, Modbus TCP, EtherNet/IP, etc. It also supports explicit invocation via /net. Even if users only say "capture a packet", "scan ports", "check network connectivity" or "analyze this pcap", this skill should be triggered as long as the context involves network communication debugging.

2installs
Added on

NPX Install

npx skill4agent add zhinkgit/embeddedskills net

SKILL.md Content (Chinese)

View Translation Comparison →

Net Debug Skill

Embedded network communication debugging tool that encapsulates capabilities including interface discovery, packet capture, offline analysis, connectivity testing, port scanning, and traffic statistics in a unified manner.

Script and Configuration Paths

  • Script directory:
    <skill-dir>/scripts/
  • Environment-level configuration:
    <skill-dir>/config.json
    (tool paths only)
  • Project-level configuration:
    <workspace>/.embeddedskills/config.json
    (network parameters)
  • Protocol reference:
    <skill-dir>/references/common_protocols.json

Dependencies

  • tshark
    (installed with Wireshark, needs to be added to PATH)
  • dumpcap
    (installed with Wireshark)
  • Optional:
    capinfos
  • Windows built-in tools:
    ipconfig
    ,
    ping
    ,
    tracert
    ,
    netstat
    ,
    arp
    ,
    nslookup
  • Python 3.x (standard library only)
  • Packet capture requires Npcap driver; administrator privileges may be required in some environments

Configuration

Environment-level Configuration (
skill/config.json
)

Only keep environment-level configuration related to tool paths:
json
{
  "tshark_exe": "tshark",
  "capinfos_exe": "capinfos"
}

Project-level Configuration (
.embeddedskills/config.json
)

The
.embeddedskills/config.json
under the workspace stores project-level network configurations:
json
{
  "net": {
    "interface": "",
    "target": "",
    "capture_filter": "",
    "display_filter": "",
    "duration": 30,
    "timeout_ms": 1000,
    "scan_ports": "",
    "capture_format": "pcapng",
    "log_dir": ".embeddedskills/logs/net"
  }
}

Parameter Parsing Priority

  1. CLI parameters (
    --interface
    ,
    --target
    etc.) - Highest priority
  2. Project-level configuration (the
    net
    section in
    .embeddedskills/config.json
    )
  3. State file (historical records in
    .embeddedskills/state.json
    )
  4. Default values - Lowest priority
Connection and collection parameters are parsed according to priority, and scripts receive override values via CLI parameters. If necessary items are missing from the configuration or connection fails, ask the user and guide them to modify the configuration.

Execution Flow

  1. Check if
    tshark
    is available
  2. Parse parameters by priority: CLI > Project-level configuration > State file > Default values
  3. If no subcommand is provided, execute
    iface
    (list network interfaces) by default
  4. After successful execution, write the confirmed parameters back to the project configuration
  5. Run the corresponding script and output structured JSON results
  6. When failed, prioritize prompting issues such as permissions, Npcap, filters, interface selection, etc.

Subcommands

iface — List Network Interfaces

bash
python <skill-dir>/scripts/net_iface.py [--filter <keyword>] [--tshark] [--json]
  • --tshark
    : Display tshark packet capture interface index mapping at the same time
  • --filter
    : Filter interfaces by keyword
  • No side effects, can be executed directly

capture — Packet Capture

bash
python <skill-dir>/scripts/net_capture.py [--interface <interface>] [--duration <seconds>] [--capture-filter <filter>] [--display-filter <filter>] [--output <file path>] [--format <pcapng|pcap>] [--decode-as <rule>] [--json]
  • Interface, filter, and duration are parsed according to priority
  • --interface
    : Packet capture interface (overrides configuration)
  • --duration
    : Packet capture duration (overrides configuration)
  • --capture-filter
    : BPF packet capture filter (overrides configuration)
  • --display-filter
    : Wireshark display filter (overrides configuration)
  • --output
    : Path to save the captured packet file
  • --json
    : Output in JSON Lines format (based on tshark -T ek)
  • --decode-as
    : Custom decoding rules
  • Default format is pcapng; execute directly after parameters are complete

analyze — Analyze pcap Files

bash
python <skill-dir>/scripts/net_analyze.py <pcap_file> [--mode <summary|protocols|conversations|endpoints|io|anomalies|all>] [--filter <display filter>] [--top <number>] [--decode-as <rule>] [--export-fields <field list>] [--output <CSV path>] [--json]
  • Offline analysis based on tshark and capinfos
  • --mode all
    outputs all analysis dimensions
  • No side effects, can be executed directly

ping — Connectivity Testing

bash
python <skill-dir>/scripts/net_ping.py [--target <target>] [--tcp <port>] [--count <times>] [--traceroute] [--concurrent <thread count>] [--timeout <milliseconds>] [--json]
  • Target is parsed according to priority
  • --target
    : Target address (overrides configuration)
  • --tcp
    : TCP connectivity test (specify port)
  • --traceroute
    : Execute traceroute
  • --timeout
    : Timeout in milliseconds (overrides configuration)
  • Execute directly after parameters are complete

scan — Port Scanning

bash
python <skill-dir>/scripts/net_scan.py [--target <target>] [--ports <port range>] [--timeout <milliseconds>] [--banner] [--concurrent <thread count>] [--json]
  • Target and port range are parsed according to priority
  • --target
    : Target address (overrides configuration)
  • --ports
    : Port range, e.g., '80,443,8000-8100' (overrides configuration)
  • --banner
    : Attempt to obtain service banner
  • Default converges to port sets commonly used in embedded systems
  • Execute directly after parameters are complete

stats — Traffic Statistics

bash
python <skill-dir>/scripts/net_stats.py [--interface <interface>] [--duration <seconds>] [--display-filter <filter>] [--interval <seconds>] [--mode <overview|protocol|endpoint|port>] [--json]
  • Interface and duration are parsed according to priority
  • --interface
    : Packet capture interface (overrides configuration)
  • --duration
    : Statistics duration (overrides configuration)
  • --display-filter
    : Wireshark display filter (overrides configuration)
  • Default outputs JSON summarized by time period
  • No side effects, can be executed directly

Output Format

All scripts output a unified JSON structure:
json
{
  "status": "ok",
  "action": "<subcommand name>",
  "summary": "<brief description>",
  "details": { ... }
}
In case of error:
json
{
  "status": "error",
  "action": "<subcommand name>",
  "error": {
    "code": "<error code>",
    "message": "<error description>"
  }
}
capture --json
outputs JSON Lines, and progress information is written to stderr.

Interaction Strategy

  • Parse parameters by priority: CLI > Project-level configuration > State file > Default values
  • Prioritize direct execution with parsed parameters without additional inquiries
  • Ask the user and guide configuration modification only when connection fails
  • After successful execution, automatically write confirmed parameters back to
    .embeddedskills/config.json
  • Default converges to single host and small port range when no scanning range is specified
  • Clearly echo target range, filters, and duration in results
  • Prioritize summarizing abnormal protocols, retransmissions, RST, etc. in packet capture results
  • Prioritize prompting permission and Npcap issues when packet capture fails

Protocol Reference

When querying port and protocol mappings commonly used in embedded systems, read
references/common_protocols.json
.