Wireshark analyst

From khalilbenaz/claude-skills-collection · View interactive version

Wireshark analyst is an AI agent skill from the GitHub repository khalilbenaz/claude-skills-collection. Analyse de trafic réseau avec Wireshark incluant capture, filtres, protocoles et diagnostic réseau. Se déclenche avec "Wireshark", "capture réseau", "analyse de trafic", "pcap", "packet capture", "tcpdump. Also triggers on "Wireshark capture", "analyze a pcap", "packet analysis".

How to use this skill

Skill file

Wireshark Analyst

Workflow

1. Définir le périmètre de capture

Décision — capture embarquée ou déportée ?

2. Configurer les filtres BPF (capture)

Limiter dès la capture réduit le bruit et protège la confidentialité.

# Capturer uniquement le trafic HTTP/HTTPS vers un serveur précis
tcpdump -i eth0 -w /tmp/capture.pcap \
  'host 10.1.2.3 and (port 80 or port 443)'

# Capturer avec rotation (100 MB max, 5 fichiers)
tcpdump -i eth0 -C 100 -W 5 -w /tmp/cap.pcap \
  'tcp and host 192.168.1.0/24'

# Exclure SSH pour ne pas capturer sa propre session
tcpdump -i eth0 -w /tmp/cap.pcap 'not port 22'

# Capturer DNS + réponses ICMP seulement
tcpdump -i any -w /tmp/dns.pcap 'port 53 or icmp'

Filtres BPF courants :

| Besoin | Filtre BPF |

|---|---|

| Un hôte uniquement | host 10.0.0.5 |

| Subnet | net 192.168.1.0/24 |

| Port source ou dest | port 8080 |

| TCP SYN uniquement | tcp[tcpflags] & tcp-syn != 0 |

| UDP + DNS | udp port 53 |

| ICMP | icmp |

3. Lancer la capture (Wireshark ou tcpdump)

# Capture headless longue durée, horodatage dans le nom de fichier
tcpdump -i eth0 -s 0 -w "/tmp/cap_$(date +%Y%m%dT%H%M%S).pcap" \
  'host 10.0.0.1'

# Capture Wireshark depuis la CLI (tshark)
tshark -i eth0 -a duration:60 -w /tmp/cap.pcap \
  -f 'port 443'

# Lire un pcap existant dans tshark (sans GUI)
tshark -r /tmp/cap.pcap -Y "http.response.code >= 400"

4. Appliquer les filtres d'affichage Wireshark

Les filtres d'affichage sont distincts des filtres BPF — syntaxe propre à Wireshark.

# Retransmissions TCP
tcp.analysis.retransmission

# Erreurs HTTP (4xx/5xx)
http.response.code >= 400

# Handshake TLS uniquement
tls.handshake

# Conversations d'un hôte
ip.addr == 10.0.0.5

# Paquets avec delta-time > 1 seconde (latence)
frame.time_delta > 1

# RST TCP (connexions coupées brutalement)
tcp.flags.reset == 1

# ICMP Destination Unreachable
icmp.type == 3

# Combiner : trafic HTTP d'un hôte précis sans les succès
ip.addr == 10.0.0.5 && http.response.code >= 400

# Requêtes DNS avec erreur NXDOMAIN
dns.flags.rcode == 3

5. Analyser les flux et statistiques

Outils Wireshark :

tshark — statistiques en ligne de commande :

# Top 10 conversations TCP par octets
tshark -r cap.pcap -q -z conv,tcp | sort -k6 -rn | head -10

# Statistiques HTTP
tshark -r cap.pcap -q -z http,tree

# Temps de réponse HTTP
tshark -r cap.pcap -T fields \
  -e http.request.uri -e http.time \
  -Y "http.time"

6. Identifier les anomalies réseau

Checklist rapide :

| Anomalie | Filtre d'affichage | Signification |

|---|---|---|

| Retransmissions TCP | tcp.analysis.retransmission | Perte de paquets, congestion |

| Fenêtre TCP à zéro | tcp.analysis.zero_window | Récepteur saturé |

| Duplicate ACK | tcp.analysis.duplicate_ack | Perte en transit |

| Reset inattendu | tcp.flags.reset==1 | Connexion refusée ou timeout |

| Latence DNS élevée | dns && frame.time_delta > 0.5 | Résolution lente |

| Retransmission SYN | tcp.flags==0x002 && tcp.analysis.retransmission | Serveur injoignable |

| TLS Alert | tls.alert_message | Erreur de certificat ou chiffrement |

Analyse de latence :

# Extraire RTT TCP (SYN → SYN-ACK) pour chaque connexion
tshark -r cap.pcap -T fields \
  -e ip.src -e ip.dst -e tcp.analysis.ack_rtt \
  -Y "tcp.analysis.ack_rtt > 0.1"

7. Croiser avec les logs applicatifs

# Extraire les timestamps et URLs d'erreur en CSV
tshark -r cap.pcap -T fields \
  -e frame.time -e http.request.uri -e http.response.code \
  -Y "http.response.code >= 500" \
  -E header=y -E separator=, > erreurs_http.csv

8. Produire le rapport

# Anonymiser un pcap avant partage
editcap --anonymize -r cap.pcap cap_anonymized.pcap

Garde-fous et pièges

Pièges courants :

Sécurité et conformité :


Bonnes pratiques 2026

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.