Skip to content

Commit f8ebd1f

Browse files
committed
Add bundled Wireshark traffic analysis skill
1 parent 7222d30 commit f8ebd1f

12 files changed

Lines changed: 615 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.6.2] - 2026-03-14
11+
12+
### Added
13+
- Added a bundled Codex skill at `skills/wireshark-traffic-analysis/` for structured packet triage, security hunting, incident response, troubleshooting, and CTF workflows.
14+
- Added focused skill references for playbooks, evidence grading, reporting, and official Wireshark behavior notes.
15+
16+
### Changed
17+
- Strengthened the bundled traffic-analysis skill with guidance grounded in official Wireshark documentation for protocol hierarchy, endpoints, conversations, expert info, display filters, and follow-stream behavior.
18+
- Wheel builds now include the repository `skills/` directory under the installed `wireshark_mcp` package, so the bundled skill ships with release artifacts instead of only the Git repository.
19+
1020
## [0.6.1] - 2026-03-14
1121

1222
### Fixed
@@ -69,7 +79,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6979
- Decoding: `wireshark_decode_payload` with auto-detection (Base64, Hex, URL, Gzip, Deflate, Rot13)
7080
- Visualization: ASCII traffic plot, ASCII protocol hierarchy tree
7181

72-
[Unreleased]: https://github.com/bx33661/Wireshark-MCP/compare/v0.6.1...HEAD
82+
[Unreleased]: https://github.com/bx33661/Wireshark-MCP/compare/v0.6.2...HEAD
83+
[0.6.2]: https://github.com/bx33661/Wireshark-MCP/compare/v0.6.1...v0.6.2
7384
[0.6.1]: https://github.com/bx33661/Wireshark-MCP/compare/v0.6.0...v0.6.1
7485
[0.6.0]: https://github.com/bx33661/Wireshark-MCP/compare/v0.4.0...v0.6.0
7586
[0.4.0]: https://github.com/bx33661/Wireshark-MCP/compare/v0.2.1...v0.4.0

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,29 @@ Analyze <path/to/file.pcap> using the Wireshark MCP tools.
289289

290290
---
291291

292+
## Bundled Codex Skill
293+
294+
This repo also includes a Codex skill at `skills/wireshark-traffic-analysis/`.
295+
It is designed for disciplined packet analysis: start with capture-wide context, choose the right workflow, validate with packet evidence, and finish with actionable next steps.
296+
The latest revision is also grounded in official Wireshark documentation for protocol hierarchy, endpoints, conversations, expert info, display filters, and stream-follow behavior.
297+
298+
The skill supports these modes:
299+
300+
- `triage`
301+
- `security`
302+
- `incident-response`
303+
- `troubleshoot`
304+
- `ctf`
305+
306+
Example invocation:
307+
308+
```text
309+
Use $wireshark-traffic-analysis to investigate <file.pcap>.
310+
Start in triage mode, escalate if you find suspicious behavior, and produce a concise report with exact filters, streams, frames, confidence, and next steps.
311+
```
312+
313+
---
314+
292315
## Prompt Engineering
293316

294317
LLMs perform best with specific, structured prompts. Below are refined prompts for common scenarios:

README_zh.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,29 @@ wireshark-mcp --config
288288

289289
---
290290

291+
## 内置 Codex Skill
292+
293+
这个仓库现在也自带一个 Codex skill,位置在 `skills/wireshark-traffic-analysis/`
294+
它不是简单的提示词集合,而是一套更稳的流量分析工作流:先建立全局画像,再选择分析模式,用数据包证据确认结论,最后给出可执行的下一步。
295+
这次也补进了基于 Wireshark 官方文档整理的关键规则,包括 Protocol Hierarchy、Endpoints、Conversations、Expert Info、Display Filters 和 Follow Stream 的使用边界。
296+
297+
支持的模式:
298+
299+
- `triage`
300+
- `security`
301+
- `incident-response`
302+
- `troubleshoot`
303+
- `ctf`
304+
305+
示例调用:
306+
307+
```text
308+
Use $wireshark-traffic-analysis to investigate <file.pcap>.
309+
Start in triage mode, escalate if you find suspicious behavior, and produce a concise report with exact filters, streams, frames, confidence, and next steps.
310+
```
311+
312+
---
313+
291314
## Prompt Engineering(提示词工程)
292315

293316
LLM 在有结构化、具体的提示词时表现最好。以下是针对常见场景的推荐提示词:

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "wireshark-mcp"
7-
version = "0.6.1"
7+
version = "0.6.2"
88
description = "A production-grade Model Context Protocol (MCP) server for Wireshark"
99
readme = "README.md"
1010
keywords = ["mcp", "wireshark", "tshark", "packet-analysis", "network", "pcap", "model-context-protocol", "llm", "security"]
@@ -49,6 +49,9 @@ Changelog = "https://github.com/bx33661/Wireshark-MCP/blob/main/CHANGELOG.md"
4949
[project.scripts]
5050
wireshark-mcp = "wireshark_mcp.server:main"
5151

52+
[tool.hatch.build.targets.wheel.force-include]
53+
"skills" = "wireshark_mcp/skills"
54+
5255
[tool.ruff]
5356
target-version = "py310"
5457
line-length = 120
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
name: "wireshark-traffic-analysis"
3+
description: "Use when analyzing packet captures or live network traffic with Wireshark MCP; choose the right workflow for triage, security hunting, incident response, troubleshooting, or CTF work, then produce evidence-backed findings with exact filters, streams, frames, and next steps."
4+
---
5+
6+
# Wireshark Traffic Analysis
7+
8+
Use this skill to turn raw packet captures into a disciplined investigation. The goal is not to list packets. The goal is to build a defensible answer from capture-wide context, protocol-level evidence, and clearly labeled inferences.
9+
10+
## When to use
11+
12+
- `pcap` or `pcapng` analysis
13+
- live traffic review after capture
14+
- security triage, threat hunting, or incident response
15+
- network and protocol troubleshooting
16+
- CTF and forensics-style packet challenges
17+
- any task where packet evidence matters more than intuition
18+
19+
## Required inputs
20+
21+
- capture path
22+
- primary goal: `triage`, `security`, `incident-response`, `troubleshoot`, or `ctf`
23+
- any known scope: suspicious host, port, domain, time window, protocol, or symptom
24+
25+
If the user does not name a goal, default to `triage`.
26+
27+
## Core workflow
28+
29+
1. Open the capture first.
30+
- Use `wireshark_open_file` before protocol-specific tools. It activates contextual tools and gives an initial protocol summary.
31+
2. Build a global picture before drilling down.
32+
- Prefer `wireshark_quick_analysis`, `wireshark_stats_protocol_hierarchy`, `wireshark_stats_endpoints`, and `wireshark_stats_conversations`.
33+
3. Choose one mode and follow its playbook.
34+
- Read [references/playbooks.md](references/playbooks.md) and use the matching section.
35+
4. Confirm interesting leads with packet-level evidence.
36+
- Use `wireshark_follow_stream`, `wireshark_get_packet_details`, `wireshark_get_packet_context`, `wireshark_extract_fields`, and `wireshark_search_packets`.
37+
5. Separate observation from interpretation.
38+
- Facts come from tool output.
39+
- Inferences must be labeled `confirmed`, `likely`, `possible`, or `unresolved`.
40+
6. End with next actions.
41+
- Suggest exact display filters, stream indexes, frame numbers, fields, or follow-up questions.
42+
43+
## Analysis rules
44+
45+
- Start broad, then narrow.
46+
- Prefer Wireshark MCP tools over freehand `tshark` syntax.
47+
- Never guess display filter syntax. Use `wireshark://reference/display-filters`.
48+
- Use `wireshark://reference/protocol-fields` when you need field names for extraction or filters.
49+
- Never decode payloads manually when `wireshark_decode_payload` can verify the result.
50+
- Treat `wireshark_stats_expert_info` as a lead generator, not a final verdict.
51+
- When a finding depends on context, follow the full stream before concluding.
52+
- For large captures, paginate instead of treating the first page as representative.
53+
- If the capture vantage point could distort interpretation, say so explicitly.
54+
- If evidence is incomplete, say exactly what is missing.
55+
56+
## Statistics notes
57+
58+
- `wireshark_stats_protocol_hierarchy` is for structure, not naive percentage math. A single packet can contribute to multiple protocol rows across layers.
59+
- `wireshark_stats_endpoints` is the fastest host inventory view. Use it to identify broadcast, multicast, and heavy talkers before drilling into conversations.
60+
- `wireshark_stats_conversations` is usually the best place to prioritize long-lived, high-volume, or asymmetric exchanges.
61+
- Stream indexes are tool evidence too. When `wireshark_follow_stream` explains the finding, include the exact stream index in the report.
62+
63+
For official Wireshark behavior notes and source links, see [references/official-wireshark-notes.md](references/official-wireshark-notes.md).
64+
65+
## Evidence standard
66+
67+
For any non-trivial finding, include at least two of the following:
68+
69+
- the tool call that surfaced it
70+
- exact host, port, protocol, or field names
71+
- a stream index or frame number
72+
- a display filter or field extraction query
73+
- a short explanation of why the signal matters
74+
75+
When a pattern looks suspicious but could still be normal, read [references/evidence-rubric.md](references/evidence-rubric.md) before concluding.
76+
77+
## Output shape
78+
79+
Use the structure in [references/report-template.md](references/report-template.md). Keep reports concise, evidence-backed, and action-oriented.
80+
81+
## Mode selection
82+
83+
Use the matching playbook in [references/playbooks.md](references/playbooks.md):
84+
85+
- `triage`: unknown capture, fast situational awareness
86+
- `security`: suspicious traffic, exfiltration, credential exposure, malware behavior
87+
- `incident-response`: reconstruct the timeline, scope, and affected systems
88+
- `troubleshoot`: retransmissions, latency, resets, failed handshakes, unstable services
89+
- `ctf`: flags, hidden payloads, staged transfers, encoded streams
90+
91+
## Built-in prompts and references
92+
93+
If the user mainly needs a starting workflow rather than a full investigation, the MCP prompts in this repo can help:
94+
95+
- `traffic_overview`
96+
- `security_audit`
97+
- `performance_analysis`
98+
- `incident_response`
99+
- `ctf_solve`
100+
101+
Use `wireshark://guide/usage` when you need the repo's built-in MCP workflow reference.
102+
103+
## Common mistakes to avoid
104+
105+
- calling something malicious because it is uncommon
106+
- calling something benign because it is encrypted
107+
- over-trusting a single heuristic such as long DNS queries or one retransmission
108+
- skipping endpoints and conversations, then missing the real top talker
109+
- reporting a hypothesis as a confirmed root cause
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface:
2+
display_name: "Wireshark Traffic Analysis"
3+
short_description: "Triage, hunt, and debug packet captures"
4+
default_prompt: "Use $wireshark-traffic-analysis to investigate this capture, choose the right workflow, and produce an evidence-backed packet analysis report."
5+
6+
policy:
7+
allow_implicit_invocation: true
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Evidence Rubric
2+
3+
Use this rubric when a pattern looks suspicious but the capture alone may not be enough to prove intent or root cause.
4+
5+
## Contents
6+
7+
- [Confidence labels](#confidence-labels)
8+
- [Vantage point checks](#vantage-point-checks)
9+
- [Common signals](#common-signals)
10+
11+
## Confidence labels
12+
13+
Use these labels consistently:
14+
15+
- `confirmed`: directly supported by packet evidence with little ambiguity
16+
- `likely`: multiple signals support the conclusion, but another explanation is still plausible
17+
- `possible`: one or two weak indicators exist, but the conclusion is not stable
18+
- `unresolved`: the capture suggests a question, not an answer
19+
20+
## Vantage point checks
21+
22+
Before concluding, ask:
23+
24+
- Is this capture from the client, server, gateway, mirror port, or only one side of the path?
25+
- Could packet loss in the capture itself create fake retransmissions or gaps?
26+
- Are missing packets making application behavior look incomplete?
27+
- Is TLS decryption unavailable, limiting what can be claimed about payloads?
28+
29+
If vantage point uncertainty affects the conclusion, mention it explicitly.
30+
31+
## Common signals
32+
33+
### DNS tunneling
34+
35+
Treat DNS as suspicious only when several indicators align:
36+
37+
- unusually long query names
38+
- many unique subdomains under one base domain
39+
- repetitive TXT or NULL queries
40+
- regular beacon-like cadence
41+
- high-entropy labels
42+
- weak or failed response patterns
43+
44+
Counterexamples:
45+
46+
- CDN hostnames
47+
- telemetry platforms
48+
- service discovery
49+
- anti-malware lookups
50+
51+
Good confirmation tools:
52+
53+
- `wireshark_detect_dns_tunnel`
54+
- `wireshark_extract_dns_queries`
55+
- `wireshark_extract_fields` with `dns.qry.name`, `dns.qry.type`, `ip.src`, `ip.dst`
56+
57+
### Port scanning
58+
59+
Treat scanning as stronger when you see:
60+
61+
- one source probing many ports or many hosts
62+
- many SYN-only attempts with little follow-through
63+
- short-lived connections with consistent fan-out
64+
65+
Counterexamples:
66+
67+
- vulnerability scanners you already own
68+
- health checks
69+
- inventory tooling
70+
- load balancer probes
71+
72+
Good confirmation tools:
73+
74+
- `wireshark_detect_port_scan`
75+
- `wireshark_extract_fields` with `ip.src`, `ip.dst`, `tcp.dstport`, `tcp.flags.syn`
76+
- `wireshark_stats_conversations`
77+
78+
### Credential exposure
79+
80+
Only call credentials exposed when the capture actually contains the secret or credential-bearing field.
81+
82+
Examples:
83+
84+
- `http.authbasic`
85+
- FTP `PASS`
86+
- Telnet plaintext login flows
87+
88+
Good confirmation tools:
89+
90+
- `wireshark_extract_credentials`
91+
- `wireshark_follow_stream`
92+
- `wireshark_get_packet_details`
93+
94+
### Exfiltration or suspicious data transfer
95+
96+
Treat exfiltration as stronger when you see:
97+
98+
- sustained asymmetric upload volume
99+
- repetitive uploads to a narrow destination set
100+
- encoded or staged payloads
101+
- suspicious destinations plus meaningful payload movement
102+
103+
Counterexamples:
104+
105+
- backups
106+
- software updates
107+
- sync clients
108+
- log shipping
109+
110+
Good confirmation tools:
111+
112+
- `wireshark_stats_conversations`
113+
- `wireshark_follow_stream`
114+
- `wireshark_extract_http_requests`
115+
- `wireshark_export_objects`
116+
117+
### TLS suspicion
118+
119+
TLS alone is not suspicious. Treat it as more interesting when it overlaps with:
120+
121+
- failed or unusual handshakes
122+
- uncommon SNI targets
123+
- self-signed or mismatched certificates
124+
- suspicious destinations found elsewhere in the capture
125+
126+
Counterexamples:
127+
128+
- internal PKI
129+
- TLS interception
130+
- test environments
131+
132+
Good confirmation tools:
133+
134+
- `wireshark_extract_tls_handshakes`
135+
- `wireshark_check_threats`
136+
- `wireshark_follow_stream`
137+
138+
### TCP health problems
139+
140+
One retransmission rarely proves a network issue. Stronger cases include:
141+
142+
- repeated retransmissions in the same conversation
143+
- duplicate ACK bursts
144+
- zero-window events
145+
- resets aligned with user-visible failures
146+
147+
Counterexamples:
148+
149+
- capture loss
150+
- transient congestion
151+
- intentionally closed connections
152+
153+
Good confirmation tools:
154+
155+
- `wireshark_analyze_tcp_health`
156+
- `wireshark_stats_expert_info`
157+
- `wireshark_follow_stream`
158+
159+
## Reporting rule
160+
161+
Whenever a claim could be disputed, include:
162+
163+
- the signal
164+
- the counter-interpretation
165+
- why your conclusion still holds, or why it remains unresolved

0 commit comments

Comments
 (0)