WinDump

WinDump : tcpdump for Windows

Utiliser windump

Les options de windump

C:\>WinDump.exe -help
WinDump.exe version 3.9.5, based on tcpdump version 3.9.5
WinPcap version 4.0.2 (packet.dll version 4.0.0.1040), based on libpcap version
0.9.5
Usage: WinDump.exe [-aAdDeflLnNOpqRStuUvxX] [ -B size ] [-c count] [ -C file_size ]
                [ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
                [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
                [ -W filecount ] [ -y datalinktype ] [ -Z user ]
                [ expression ]

Lister les interfaces réseaux disponibles

C:\>WinDump.exe -D
1.\Device\NPF_GenericDialupAdapter (Adapter for generic dialup and VPN capture)
2.\Device\NPF_{6CF3DDC0-E065-45E2-B9DC-FD7B17FB2413} (Attansic L2 Fast EthernetController)

Quelques exemples d'utilisation de windump

windump -D 
windump -i 2
 
windump -i 2 dst host 192.168.30.202 and tcp and not port 3389
windump -i 2 dst localhost and tcp and not port 3389
 
windump -i 2 dst host 192.168.30.202 and tcp and src host 192.168.30.202
windump -i 2 dst host 192.168.30.202 and src host 192.168.30.202
windump -i 2 -ln -v tcp and port 8080
 
WinDump -t -p -n -i 2 ip dst host 127.0.0.1
WinDump -t -p -n -i 2 ip port 8080
WinDump -i 2 ip dst port 8080
 
windump -x -X -s 0 -i 2 ip and dst port 8080
 
windump -w fichier_de_sortie

Remarque : Possibilité d'analyse des trames générées par windump dans wireshark et bien d'autres avec l'option "-w"

Plus d'exemples windump expliqués sur citic74.fr

Tcpdump

# tcpdump -h
tcpdump version 3.9.4
libpcap version 0.9.4
Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
               [ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
               [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
               [ -W filecount ] [ -y datalinktype ] [ -Z user ]
               [ expression ]
# Lister l'intégralité des paquets détaillés en provenance et destination du serveur "www.perdu.com"
tcpdump -A -s 2048 host www.perdu.com
-A     Print each packet (minus its link level header) in ASCII.  Handy for capturing web pages.
-s     Snarf  snaplen  bytes  of  data from each packet rather than the default of 68 (with SunOS's NIT, the minimum is actually 96).  68 bytes is adequate for IP, ICMP, TCP and UDP but may truncate protocol information from name server and NFS packets (see below). 

# Lister tout le trafic en excluant le serveur 82.242.241.8 , le port 28960 et le port 53 (domain)
tcpdump not host 82.242.241.8 and not port 28960 and not port domain

Ressources

Solution alternative

WireShark (anciennement Ethereal) est un très bon outil graphique reprenant les options de tcpdump. Description et téléchargement de WireShark sur Clubic.