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
Sourcezhinkgit/embeddedskills
Added on
NPX Install
npx skill4agent add zhinkgit/embeddedskills netTags
Translated version includes tags in frontmatterSKILL.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: (tool paths only)
<skill-dir>/config.json - Project-level configuration: (network parameters)
<workspace>/.embeddedskills/config.json - Protocol reference:
<skill-dir>/references/common_protocols.json
Dependencies
- (installed with Wireshark, needs to be added to PATH)
tshark - (installed with Wireshark)
dumpcap - Optional:
capinfos - Windows built-in tools: ,
ipconfig,ping,tracert,netstat,arpnslookup - 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
)
skill/config.jsonOnly keep environment-level configuration related to tool paths:
json
{
"tshark_exe": "tshark",
"capinfos_exe": "capinfos"
}Project-level Configuration (.embeddedskills/config.json
)
.embeddedskills/config.jsonThe under the workspace stores project-level network configurations:
.embeddedskills/config.jsonjson
{
"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
- CLI parameters (,
--interfaceetc.) - Highest priority--target - Project-level configuration (the section in
net).embeddedskills/config.json - State file (historical records in )
.embeddedskills/state.json - 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
- Check if is available
tshark - Parse parameters by priority: CLI > Project-level configuration > State file > Default values
- If no subcommand is provided, execute (list network interfaces) by default
iface - After successful execution, write the confirmed parameters back to the project configuration
- Run the corresponding script and output structured JSON results
- 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]- : Display tshark packet capture interface index mapping at the same time
--tshark - : Filter interfaces by keyword
--filter - 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
- : Packet capture interface (overrides configuration)
--interface - : Packet capture duration (overrides configuration)
--duration - : BPF packet capture filter (overrides configuration)
--capture-filter - : Wireshark display filter (overrides configuration)
--display-filter - : Path to save the captured packet file
--output - : Output in JSON Lines format (based on tshark -T ek)
--json - : Custom decoding rules
--decode-as - 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
- outputs all analysis dimensions
--mode all - 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 address (overrides configuration)
--target - : TCP connectivity test (specify port)
--tcp - : Execute traceroute
--traceroute - : Timeout in milliseconds (overrides configuration)
--timeout - 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 address (overrides configuration)
--target - : Port range, e.g., '80,443,8000-8100' (overrides configuration)
--ports - : Attempt to obtain service banner
--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
- : Packet capture interface (overrides configuration)
--interface - : Statistics duration (overrides configuration)
--duration - : Wireshark display filter (overrides configuration)
--display-filter - 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 --jsonInteraction 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