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.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
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.
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.
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 detailssudo tshark -D
# Capture on specific interface
tshark -i eth0
tshark -i wlan0
tshark -i any
tshark -i eth0 -i wlan0
sudo
sudo
# Capture on any interface
sudo
# Capture on multiple interfaces
sudo
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 packetssudo tshark -i eth0 -c 1000
# Capture for specific duration (seconds)sudo tshark -i eth0 -a duration:60
# Capture to filesudo 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 trafficsudo tshark -i eth0 -f "tcp port 80"# Capture specific hostsudo tshark -i eth0 -f "host 192.168.1.100"# Capture subnetsudo tshark -i eth0 -f "net 192.168.1.0/24"# Capture multiple portssudo tshark -i eth0 -f "tcp port 80 or tcp port 443"# Exclude specific trafficsudo tshark -i eth0 -f "not port 22"# Capture SYN packets onlysudo 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:
# Run with sudosudo tshark -i eth0
# Or add user to wireshark group (Linux)sudo usermod -a -G wireshark $USERsudosetcap cap_net_raw,cap_net_admin+eip /usr/bin/tshark
# Logout and login for group changes to take effect
Issue: "No interfaces found"
Solutions:
# Verify tshark installation
tshark --version
# List interfaces with sudosudo tshark -D
# Check interface status
ip link show
ifconfig -a
Issue: Capture file is huge
Solutions:
# Use capture filters to reduce sizesudo tshark -i eth0 -f "not port 22" -w capture.pcap
# Use ring buffersudo tshark -i eth0 -w capture.pcap -b filesize:100000 -b files:5
# Limit packet size (snaplen)sudo tshark -i eth0 -s 128 -w capture.pcap