/analysis-tshark
Network protocol analyzer and packet capture tool for traffic analysis, security investigations, and forensic examination using Wireshark's command-line interface. Use when: (1) Analyzing network traffic for security incidents and malware detection, (2) Capturing and filtering
$ npx -y skills add AgentSecOps/SecOpsAgentKit --skill analysis-tshark --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/analysis-tshark
Context preview
The summary Claude sees to decide when to auto-load this skill.
Network protocol analyzer and packet capture tool for traffic analysis, security investigations, and forensic examination using Wireshark's command-line interface. Use when: (1) Analyzing network traffic for security incidents and malware detection, (2) Capturing and filtering
SKILL.md
analysis-tshark.SKILL.mdname: analysis-tshark
description: >
Network protocol analyzer and packet capture tool for traffic analysis, security investigations,
and forensic examination using Wireshark's command-line interface. Use when: (1) Analyzing network
traffic for security incidents and malware detection, (2) Capturing and filtering packets for
forensic analysis, (3) Extracting credentials and sensitive data from network captures, (4)
Investigating network anomalies and attack patterns, (5) Validating encryption and security
controls, (6) Performing protocol analysis for vulnerability research.
version: 0.1.0
maintainer: sirappsec@gmail.com
category: offsec
tags: [packet-capture, network-analysis, forensics, tshark, wireshark, traffic-analysis]
frameworks: [MITRE-ATT&CK, NIST]
dependencies:
packages: [tshark, wireshark]
tools: [tcpdump, python3]
references:
- https://www.wireshark.org/docs/man-pages/tshark.html
- https://wiki.wireshark.org/DisplayFilters
- https://attack.mitre.org/techniques/T1040/
TShark Network Protocol Analyzer
Overview
TShark is the command-line network protocol analyzer from the Wireshark project. It provides powerful packet capture and analysis capabilities for security investigations, forensic analysis, and network troubleshooting. This skill covers authorized security operations including traffic analysis, credential extraction, malware detection, and forensic examination.
**IMPORTANT**: Network packet capture may expose sensitive information and must only be conducted with proper authorization. Ensure legal compliance and privacy considerations before capturing network traffic.
Quick Start
Basic packet capture and analysis:
# Capture packets on interface
sudo tshark -i eth0
# Capture 100 packets and save to file
sudo tshark -i eth0 -c 100 -w capture.pcap
# Read and analyze capture file
tshark -r capture.pcap
# Apply display filter
tshark -r capture.pcap -Y "http.request.method == GET"
# Extract HTTP objects
tshark -r capture.pcap --export-objects http,extracted_files/
Core Workflow
Network Analysis Workflow
Progress: [ ] 1. Verify authorization for packet capture [ ] 2. Identify target interface and capture requirements [ ] 3. Capture network traffic with appropriate filters [ ] 4. Analyze captured packets for security indicators [ ] 5. Extract artifacts (files, credentials, sessions) [ ] 6. Document findings and security implications [ ] 7. Securely handle and store capture files [ ] 8. Clean up sensitive data per retention policy
Work through each step systematically. Check off completed items.
1. Authorization Verification
**CRITICAL**: Before any packet capture:
- Confirm written authorization for network monitoring
- Verify legal compliance (wiretapping laws, privacy regulations)
- Understand data handling and retention requirements
- Document scope of capture (interfaces, duration, filters)
- Ensure secure storage for captured data
2. Interface Discovery
Identify available network interfaces:
# List all interfaces
tshark -D
# List with interface details
sudo tshark -D
# Capture on specific interface
sudo tshark -i eth0
sudo tshark -i wlan0
# Capture on any interface
sudo tshark -i any
# Capture on multiple interfaces
sudo tshark -i eth0 -i wlan0
**Interface types**:
- **eth0/ens33**: Ethernet interface
- **wlan0**: Wireless interface
- **lo**: Loopback interface
- **any**: All interfaces (Linux only)
- **mon0**: Monitor mode interface (wireless)
3. Basic Packet Capture
Capture network traffic:
# Capture indefinitely (Ctrl+C to stop)
sudo tshark -i eth0
# Capture specific number of packets
sudo tshark -i eth0 -c 1000
# Capture for specific duration (seconds)
sudo tshark -i eth0 -a duration:60
# Capture to file
sudo tshark -i eth0 -w capture.pcap
# Capture with ring buffer (rotate files)
sudo tshark -i eth0 -w capture.pcap -b filesize:100000 -b files:5
**Capture options**:
- `-c <count>`: Capture packet count
- `-a duration:<sec>`: Auto-stop after duration
- `-w <file>`: Write to file
- `-b filesize:<KB>`: Rotate at file size
- `-b files:<num>`: Keep N ring buffer files
4. Capture Filters
Apply BPF (Berkeley Packet Filter) during capture for efficiency:
# Capture only HTTP traffic
sudo tshark -i eth0 -f "tcp port 80"
# Capture specific host
sudo tshark -i eth0 -f "host 192.168.1.100"
# Capture subnet
sudo tshark -i eth0 -f "net 192.168.1.0/24"
# Capture multiple ports
sudo tshark -i eth0 -f "tcp port 80 or tcp port 443"
# Exclude specific traffic
sudo tshark -i eth0 -f "not port 22"
# Capture SYN packets only
sudo tshark -i eth0 -f "tcp[tcpflags] & tcp-syn != 0"
**Common capture filters**:
- `host <ip>`: Traffic to/from IP
- `net <cidr>`: Traffic to/from network
- `port <port>`: Specific port
- `tcp|udp|icmp`: Protocol type
- `src|dst`: Direction filter
- `and|or|not`: Logical operators
5. Display Filters
Analyze captured traffic with Wireshark display filters:
# HTTP requests only
tshark -r capture.pcap -Y "http.request"
# HTTP responses
tshark -r capture.pcap -Y "http.response"
# DNS queries
tshark -r capture.pcap -Y "dns.flags.response == 0"
# TLS handshakes
tshark -r capture.pcap -Y "tls.handshake.type == 1"
# Suspicious traffic patterns
tshark -r capture.pcap -Y "tcp.flags.syn==1 and tcp.flags.ack==0"
# Failed connections
tshark -r capture.pcap -Y "tcp.flags.reset==1"
**Advanced display filters**:
# HTTP POST requests with credentials
tshark -r capture.pcap -Y "http.request.method == POST and (http contains \"password\" or http contains \"username\")"
# SMB file transfers
tshark -r capture.pcap -Y "smb2.cmd == 8 or smb2.cmd == 9"
# Suspicious User-Agents
tshark -r capture.pcap -Y "http.user_agent contains \"python\" or http.user_agent contains \"curl\""
# Large data transfers
tshark -r capture.pcap -Y "tcp.len > 1400"
# Beaconing detection (periodic traffic)
tshark -r capture.pcap -Y "ht
Read more
name: analysis-tshark description: > Network protocol analyzer and packet capture tool for traffic analysis, security investigations, and forensic examination using Wireshark's command-line interface. Use when: (1) Analyzing network traffic for security incidents and malware detection, (2) Capturing and filtering packets for forensic analysis, (3) Extracting credentials and sensitive data from network captures, (4) Investigating network anomalies and attack patterns, (5) Validating encryption and security controls, (6) Performing protocol analysis for vulnerability research. version: 0.1.0 maintainer: sirappsec@gmail.com category: offsec tags: [packet-capture, network-analysis, forensics, tshark, wireshark, traffic-analysis] frameworks: [MITRE-ATT&CK, NIST] dependencies: packages: [tshark, wireshark] tools: [tcpdump, python3] references: - https://www.wireshark.org/docs/man-pages/tshark.html - https://wiki.wireshark.org/DisplayFilters - https://attack.mitre.org/techniques/T1040/
TShark Network Protocol Analyzer
Overview
TShark is the command-line network protocol analyzer from the Wireshark project. It provides powerful packet capture and analysis capabilities for security investigations, forensic analysis, and network troubleshooting. This skill covers authorized security operations including traffic analysis, credential extraction, malware detection, and forensic examination.
**IMPORTANT**: Network packet capture may expose sensitive information and must only be conducted with proper authorization. Ensure legal compliance and privacy considerations before capturing network traffic.
Quick Start
Basic packet capture and analysis:
# Capture packets on interface sudo tshark -i eth0 # Capture 100 packets and save to file sudo tshark -i eth0 -c 100 -w capture.pcap # Read and analyze capture file tshark -r capture.pcap # Apply display filter tshark -r capture.pcap -Y "http.request.method == GET" # Extract HTTP objects tshark -r capture.pcap --export-objects http,extracted_files/
Core Workflow
Network Analysis Workflow
Progress: [ ] 1. Verify authorization for packet capture [ ] 2. Identify target interface and capture requirements [ ] 3. Capture network traffic with appropriate filters [ ] 4. Analyze captured packets for security indicators [ ] 5. Extract artifacts (files, credentials, sessions) [ ] 6. Document findings and security implications [ ] 7. Securely handle and store capture files [ ] 8. Clean up sensitive data per retention policy
Work through each step systematically. Check off completed items.
1. Authorization Verification
**CRITICAL**: Before any packet capture:
- Confirm written authorization for network monitoring
- Verify legal compliance (wiretapping laws, privacy regulations)
- Understand data handling and retention requirements
- Document scope of capture (interfaces, duration, filters)
- Ensure secure storage for captured data
2. Interface Discovery
Identify available network interfaces:
# List all interfaces tshark -D # List with interface details sudo tshark -D # Capture on specific interface sudo tshark -i eth0 sudo tshark -i wlan0 # Capture on any interface sudo tshark -i any # Capture on multiple interfaces sudo tshark -i eth0 -i wlan0
**Interface types**:
- **eth0/ens33**: Ethernet interface
- **wlan0**: Wireless interface
- **lo**: Loopback interface
- **any**: All interfaces (Linux only)
- **mon0**: Monitor mode interface (wireless)
3. Basic Packet Capture
Capture network traffic:
# Capture indefinitely (Ctrl+C to stop) sudo tshark -i eth0 # Capture specific number of packets sudo tshark -i eth0 -c 1000 # Capture for specific duration (seconds) sudo tshark -i eth0 -a duration:60 # Capture to file sudo tshark -i eth0 -w capture.pcap # Capture with ring buffer (rotate files) sudo tshark -i eth0 -w capture.pcap -b filesize:100000 -b files:5
**Capture options**:
- `-c <count>`: Capture packet count
- `-a duration:<sec>`: Auto-stop after duration
- `-w <file>`: Write to file
- `-b filesize:<KB>`: Rotate at file size
- `-b files:<num>`: Keep N ring buffer files
4. Capture Filters
Apply BPF (Berkeley Packet Filter) during capture for efficiency:
# Capture only HTTP traffic sudo tshark -i eth0 -f "tcp port 80" # Capture specific host sudo tshark -i eth0 -f "host 192.168.1.100" # Capture subnet sudo tshark -i eth0 -f "net 192.168.1.0/24" # Capture multiple ports sudo tshark -i eth0 -f "tcp port 80 or tcp port 443" # Exclude specific traffic sudo tshark -i eth0 -f "not port 22" # Capture SYN packets only sudo tshark -i eth0 -f "tcp[tcpflags] & tcp-syn != 0"
**Common capture filters**:
- `host <ip>`: Traffic to/from IP
- `net <cidr>`: Traffic to/from network
- `port <port>`: Specific port
- `tcp|udp|icmp`: Protocol type
- `src|dst`: Direction filter
- `and|or|not`: Logical operators
5. Display Filters
Analyze captured traffic with Wireshark display filters:
# HTTP requests only tshark -r capture.pcap -Y "http.request" # HTTP responses tshark -r capture.pcap -Y "http.response" # DNS queries tshark -r capture.pcap -Y "dns.flags.response == 0" # TLS handshakes tshark -r capture.pcap -Y "tls.handshake.type == 1" # Suspicious traffic patterns tshark -r capture.pcap -Y "tcp.flags.syn==1 and tcp.flags.ack==0" # Failed connections tshark -r capture.pcap -Y "tcp.flags.reset==1"
**Advanced display filters**:
# HTTP POST requests with credentials tshark -r capture.pcap -Y "http.request.method == POST and (http contains \"password\" or http contains \"username\")" # SMB file transfers tshark -r capture.pcap -Y "smb2.cmd == 8 or smb2.cmd == 9" # Suspicious User-Agents tshark -r capture.pcap -Y "http.user_agent contains \"python\" or http.user_agent contains \"curl\"" # Large data transfers tshark -r capture.pcap -Y "tcp.len > 1400" # Beaconing detection (periodic traffic) tshark -r capture.pcap -Y "ht
An assortment of security operations skills for AI coding agents. A collaborative approach to shift-left security using Claude Code skills.
Other skills on secopsagentkit.
- /api-mitmproxy
Interactive HTTPS proxy for API security testing with traffic interception, modification, and replay capabilities. Supports HTTP/1, HTTP/2, HTTP/3, WebSockets, and TLS-protected protocols. Includes Python scripting API for automation and multiple interfaces (console, web, CLI).
Open skill - /api-spectral
API specification linting and security validation using Stoplight's Spectral with support for OpenAPI, AsyncAPI, and Arazzo specifications. Validates API definitions against security best practices, OWASP API Security Top 10, and custom organizational standards. Use when: (1)
Open skill - /dast-ffuf
Fast web fuzzer for DAST testing with directory enumeration, parameter fuzzing, and virtual host discovery. Written in Go for high-performance HTTP fuzzing with extensive filtering capabilities. Supports multiple fuzzing modes (clusterbomb, pitchfork, sniper) and recursive
Open skill - /dast-nuclei
Fast, template-based vulnerability scanning using ProjectDiscovery's Nuclei with extensive community templates covering CVEs, OWASP Top 10, misconfigurations, and security issues across web applications, APIs, and infrastructure. Use when: (1) Performing rapid vulnerability
Open skill - /dast-zap
Dynamic application security testing (DAST) using OWASP ZAP (Zed Attack Proxy) with passive and active scanning, API testing, and OWASP Top 10 vulnerability detection. Use when: (1) Performing runtime security testing of web applications and APIs, (2) Detecting vulnerabilities
Open skill - /sast-bandit
Python security vulnerability detection using Bandit SAST with CWE and OWASP mapping. Use when: (1) Scanning Python code for security vulnerabilities and anti-patterns, (2) Identifying hardcoded secrets, SQL injection, command injection, and insecure APIs, (3) Generating
Open skill

