Professional Documents
Culture Documents
1 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
Home
Nagios & Co
Rseau IP
GStreamer
Hbergement
Mes projets
Annonceurs
Contact
Mail
G+
Facebook
Twitter
RSS
(5584 abonns)
Auteur:
nicolargo
Date:
8/03/2010
Catgories:
Open-source
Planet-libre
Reseau
Tags:
cli
tshark
wireshark
Installation de TShark
Sous Ubuntu, il sut de l'installer partir des dpts avec la commande suivante:
sudo aptitude install tshark
Remarque: il est galement possible de faire l'installation depuis les sources.
20/09/2012 17:18
2 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
sudo tshark -D
1. eth0
2. wmaster0
3. wlan0
4. usbmon1 (USB bus number 1)
5. usbmon2 (USB bus number 2)
6. usbmon3 (USB bus number 3)
7. usbmon4 (USB bus number 4)
8. usbmon5 (USB bus number 5)
9. usbmon6 (USB bus number 6)
10. usbmon7 (USB bus number 7)
11. usbmon8 (USB bus number 8)
12. any (Pseudo-device that captures on all interfaces)
13. lo
Ainsi si l'on souhaite analyser les protocoles des ux transitant par l'interface ethernet par dfaut (eth0), il sut
de saisir la commande suivante:
sudo tshark -i eth0
Running as user "root" and group "root". This could be dangerous.
Capturing on eth0
0.000000 Xensourc_8b:f0:9e -> Broadcast ARP Who has 192.168.29.161? Tell 192.168.29.171
0.021079 Netgear_b7:46:4a -> Spanning-tree-(for-bridges)_00 STP RST. Root = 32768/0
/00:12:a9:81:5f:e0 Cost = 200000 Port = 0x8001
0.182159 HewlettP_64:6e:2c -> Broadcast ARP Who has 192.168.29.161? Tell 192.168.29.1
0.325894 HewlettP_64:6e:a0 -> Broadcast ARP Who has 192.168.29.161? Tell 192.168.29.2
...
Il est galement possible d'analyser les ux de manire "o-line". Pour cela, il faut dans un premier temps
capturer le trac dans un chier l'aide d'un logiciel comme Wireshark, TShark (ou tout autre logiciel dont le
format est pris en charge, voir la liste de ces formats avec la commande "sudo tshark -F"), puis fournir ce chier
en entre de TShark avec l'option -r:
sudo tshark -r capture.cap
1 0.000000 HewlettP_64:6e:a0 -> Broadcast ARP Who has 192.168.29.161? Tell 192.168.29.2
2 0.020195 HewlettP_64:6e:2c -> Broadcast ARP Who has 192.168.29.161? Tell 192.168.29.1
3 0.576826 192.168.29.75 -> 255.255.255.255 UDP Source port: 17500 Destination port: 17500
4 0.577044 192.168.29.75 -> 192.168.29.255 UDP Source port: 17500 Destination port: 17500
5 0.585752 Xensourc_8b:f0:9e -> Broadcast ARP Who has 192.168.29.120? Tell 192.168.29.171
6 0.589851 HewlettP_64:6e:2c -> Broadcast ARP Who has 192.168.29.120? Tell 192.168.29.1
...
20/09/2012 17:18
3 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
20/09/2012 17:18
4 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
20/09/2012 17:18
5 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
20/09/2012 17:18
6 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
209.172.41.53 80
192.168.29.1
192.168.29.148
209.172.41.53 80
192.168.29.148 34521
209.172.41.53 80
192.168.29.148 34522
209.172.41.53 80
192.168.29.148 34523
209.172.41.53 80
209.172.41.53 80
209.172.41.53 80
224.0.0.251
192.168.29.148 34523
...
20/09/2012 17:18
7 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
20/09/2012 17:18
8 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
20/09/2012 17:18
9 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
002.000-003.000 6 1146
003.000-004.000 61 18627
004.000-005.000 76 30832
005.000-006.000 45 16263
006.000-007.000 95 40326
007.000-008.000 107 50010
008.000-009.000 81 30109
009.000-010.000 125 58044
010.000-011.000 75 46597
011.000-012.000 236 155959
012.000-013.000 32 15852
013.000-014.000 2 531
===================================================================
On peut galement acher une table de trac IP (source <-> destination). Il est galement possible de faire de
mme seulment sur le trac TCP (-z conv,tcp) ou UDP (-z conv,udp):
sudo tshark -i eth0 -z conv,ip
=========================================================================
IPv4 Conversations
Filter:<No Filter>
| <- | | -> | | Total |
| Frames Bytes | | Frames Bytes | | Frames Bytes |
192.168.29.148 <-> 74.125.39.18 79 39420 93 36753 172 76173
192.168.29.148 <-> 74.125.39.17 45 27618 45 17223 90 44841
192.168.29.148 <-> 74.125.39.83 30 18291 26 11999 56 30290
192.168.29.148 <-> 74.125.39.106 6 751 11 8970 17 9721
192.168.29.148 <-> 74.125.39.101 7 2954 9 3012 16 5966
192.168.29.148 <-> 74.125.39.189 6 968 8 2382 14 3350
192.168.29.148 <-> 192.168.29.1 4 1198 4 311 8 1509
209.85.137.125 <-> 192.168.29.148 2 132 2 750 4 882
192.168.29.148 <-> 65.54.49.141 1 74 2 137 3 211
192.168.254.2 <-> 192.168.29.148 0 0 1 1506 1 1506
193.48.73.22 <-> 192.168.29.148 1 46 0 0 1 46
=========================================================================
Si vous devez faire une analyse d'un flux multimdia bas sur RTP, alors l'option suivante va vous permettre d'afficher un rapport sur ces flux:
1
2
Shell
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13p
20/09/2012 17:18
10 of 15
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
Shell
1 <span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px
20/09/2012 17:18
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
Conclusion
TShark est donc une trs bonne alternative tcpdump, l'outil standard des distributions GNU/Linux et BSD. Il
apporte un lot impressionnant de ltres d'achage et une gestion de rapport qui peut tre d'une grande utilit
pour certaines analyse rseau.
Annonces Google
Packet Sniffer
Network Security Firewall
FTP Server Firewall
Partager ce billet
Tweeter
1
Like
Billets similaires
11 of 15
20/09/2012 17:18
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
A propos de nicolargo
Crateur de blog de Nicolargo, je suis un partisan des logiciels libres et un passionn des nouvelles technologies.
Suivre @nicolargo sur Twitter S'abonner au ux RSS du blog
6 commentaires/rfrences
12 of 15
1.
20/09/2012 17:18
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
-s
Rpondre
2.
3.
Laisser un message
Les informations saisies resteront prives
NomVotre nom/pseudo *
13 of 15
Commentaire
20/09/2012 17:18
14 of 15
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
20/09/2012 17:18
http://blog.nicolargo.com/2010/03/tshark-lautre-tcpdump...
Les archives
2012
septembre
aot
juillet
juin
mai
avril
mars
fvrier
janvier
2011
2010
2009
2008
2007
2006
Licence
Sauf mention spciale, le contenu de ce site est distribu sous licence Creative Commons version BY 3.0.
Ici on parle
actualite
Informations
Open-source&Co depuis 2006
Email: contact {a} nicolargo {dot} com
Twitter: @nicolargo
Rss: http://blog.nicolargo.com/feed
15 of 15
20/09/2012 17:18