MDstable
NoteSnippetChecklistPlaybook

Wireshark — Analyse de Trafic Réseau

Référence Wireshark : filtres de capture, filtres d'affichage, analyse protocolaire, forensique réseau

snippetintermediate 2026-05-30 4 min read
wiresharktsharkpacket-analysisforensicsnetworkpcap

Capture

Interface graphique

Capture > Interfaces > Slectionner eth0/wlan0 > Start
Arrt bouton rouge ou CtrlE
Sauvegarde File > Save As > pcap pcapng

tshark (CLI)

bash
# Capture sur interface
tshark -i eth0
# Durée limitée (60s)
tshark -i eth0 -a duration60 -w capturepcap
# Taille limitée (100MB)
tshark -i eth0 -b filesize102400 -w capturepcap
# Capture avec filtre BPF
tshark -i eth0 -f "tcp port 80 or tcp port 443" -w webpcap
# Lire un pcap
tshark -r capturepcap

Filtres de capture (BPF)

bash
# Par hôte
host 192168110
src host 100050
dst host 8888
# Par port
port 443
portrange 8080-8090
not port 22
# Par protocole
tcp
udp
icmp
arp
# Combinaisons
tcp and host 192168110 and port 443
not arp and not broadcast
tcptcpflags & tcp-syn 0 # Paquets SYN uniquement

Filtres d'affichage (Display Filters)

Réseau

ipsrc 192168110
ipdst 10000/8
ipaddr 19216810/24
not ipaddr 10000/8

Transport

tcpport 443
tcpflagssyn 1 and tcpflagsack 0 # SYN scan
tcpflagsreset 1 # RST
udpport 53
tcpanalysisretransmission # Retransmissions

Application

httprequestmethod "POST"
httpresponsecode 200
httprequesturi contains "login"
dnsqryname contains "evil"
tlshandshaketype 1 # Client Hello
smtpreqcommand "AUTH"
ftprequestcommand "PASS"

Forensique

# Credentials en clair
httpauthbasic
ftprequestcommand "PASS"
telnet
# Anomalies
tcpanalysisduplicate_ack
icmptype 8 and icmpcode 0 # Ping sweep
arpduplicate-address-detected
# Grand volume
framelen > 1400

Analyse protocolaire

HTTP — Reconstituer une session

1 Edit > Find Packet > "HTTP/1.1 200 OK"
2 Clic droit sur un paquet HTTP > Follow > TCP Stream
3 Voir la requte ET la rponse compltes
# Export objets HTTP (fichiers téléchargés)
File > Export Objects > HTTP

DNS — Détecter l'exfiltration

# Filtrer requêtes DNS longues
dns and framelen > 100
# Visualiser : Statistics > DNS
# Chercher : sous-domaines encodés en base64 (exfil DNS)
dnsqryname matches "[A-Za-z0-9+/]{20,}\\."

TLS — Déchiffrement (si clé dispo)

Edit > Preferences > Protocols > TLS
> Pre-Master-Secret log filename sslkeyloglog
# Générer avec Firefox/Chrome
export SSLKEYLOGFILE/sslkeylog.log
firefox &

ARP — Détection empoisonnement

# Deux MACs différentes pour la même IP
arpduplicate-address-detected
# Flood ARP
arp and ethsrc XXXXXXXXXXXX

Statistiques utiles

Statistics > Protocol Hierarchy # Répartition des protocoles
Statistics > Conversations # Flux TCP/UDP par paire d'hôtes
Statistics > Endpoints # Hôtes actifs avec volumes
Statistics > IO Graph # Débit dans le temps
Statistics > Flow Graph # Séquence de paquets
Analyze > Expert Information # Anomalies détectées auto

tshark — Extraction en ligne de commande

bash
# Extraire champs spécifiques
tshark -r capturepcap -T fields
-e ipsrc -e ipdst -e tcpdstport -e httprequesturi
-Y "http.request"
# Compter par IP source
tshark -r capturepcap -T fields -e ipsrc -Y "tcp" | sort | uniq -c | sort -rn
# Extraire URLs visitées
tshark -r capturepcap -Y httprequest -T fields
-e httphost -e httprequesturi | sort -u
# Extraire credentials FTP
tshark -r capturepcap -Y "ftp.request.command == PASS"
-T fields -e ftprequestarg
# Extraire fichiers HTTP
tshark -r capturepcap --export-objects http/extracted/
# Statistiques DNS
tshark -r capturepcap -Y dns -T fields
-e dnsqryname | sort | uniq -c | sort -rn | head -20

Scénarios d'investigation

Scan de ports

tcpflagssyn 1 and tcpflagsack 0
# Observer : même source, ports dst variés
# SYN seuls sans réponse SYN-ACK → port fermé

Exécution de malware (C2)

# Beaconing régulier vers une IP externe
ipdst IP_SUSPECTE
# Vérifier intervalles réguliers dans Time colonne

Mouvement latéral SMB

smb or smb2
smb2cmd 5 # CREATE (accès fichier)

Credential harvesting (HTTP)

httprequestmethod POST and httprequesturi contains "login"
# Follow TCP Stream pour voir les credentials
OPS·BRAIN v1.028 notes · Networklocal