Release new version 0.14.1
[grml-network.git] / docs / grml-sniff.8.txt
1 grml-sniff(8)
2 ============
3
4 NAME
5 ----
6 grml-sniff - script for configuring a network sniffing setup
7
8 SYNOPSIS
9 --------
10 *grml-sniff* [OPTIONS]
11
12 DESCRIPTION
13 -----------
14 This manual page documents briefly the *grml-sniff* command.
15 *grml-sniff* is a script for configuring a network sniffing setup.
16 It does NOT sniff on a hub/switch but instead sets up a man-in-the-middle (MITM)
17 configuration using a bridge device with two network devices.
18
19 OPTIONS
20 -------
21
22   *start*::
23
24 Start sniffing setup.
25
26   *stop*::
27
28 Stop sniffing setup (set interfaces down and remove bridge device).
29
30   *restart*::
31
32 Restart grml-sniff.
33
34   *status*::
35
36 Display status of configuration.
37
38   *info*|*-h*|*--help*::
39
40 Show usage information.
41
42 Usage example
43 -------------
44
45 This section describes the setup and configuration for capturing network traffic
46 on a setup like follows (assuming the 'Sniffing Computer' is the box where
47 you are using Grml with grml-sniff):
48
49   Hub/Switch/Router
50          ^
51          |
52          | Interface known as 'eth0' in the documentation
53          |
54          |
55          v            Interface known as 'eth2'
56   Sniffing Computer <---------------------------> Control Computer (optional,
57          ^                                        providing GUI, Wireshark,
58          |                                        Backup of dumpfiles, etc)
59          |
60          | Interface known as 'eth1' in the documentation
61          |
62          v
63    Client System
64
65 Disable DHCP
66 ~~~~~~~~~~~~
67
68 Start with booting Grml using the 'nodhcp' bootoption. This makes sure that no
69 network configuration is being executed automatically while booting. If you
70 booted your Grml system without the nodhcp option by accident, just execute
71 'killall pump; killall dhclient' after booting finished to make sure there
72 aren’t any running DHCP clients anymore.
73
74 After booting finished check out the available network interfaces:
75
76   ifconfig -a
77
78 At least two interfaces should be present (usually named eth0 and eth1, that’s
79 what we are using in this documentation as well). Make sure the network cards
80 are connected with the hub/switch/router and the client accordingly! The third
81 interface (known as eth2 in this documentation) is just optional and not
82 necessary for sniffing itself.
83
84 Simple (but not necessarily 100% reliable) check for network connection using a
85 software command:
86
87   ethtool eth0
88   ethtool eth1
89   ethtool eth2
90
91 Look for 'Advertised auto-negotiation: Yes' and 'Link detected: yes'.
92
93 Configuration
94 ~~~~~~~~~~~~~
95
96 Make sure the according network interfaces are configured as BRIDGE_DEVICES in
97 /etc/grml/router-setup. If you are using eth0 and eth1 you don't have to do
98 anything (the default is just fine)! Otherwise adjust BRIDGE_DEVICES in
99 /etc/grml/router-setup accordingly. For example if the devices you would like to
100 use within the sniffing bridge are named eth2 and eth4 use:
101
102   BRIDGE_DEVICES='eth2 eth4'
103
104 Start sniffing setup
105 ~~~~~~~~~~~~~~~~~~~~
106
107 Assuming you configured /etc/grml/router-setup as documented in the previous
108 section, finally invoke grml-sniff:
109
110   grml-sniff start
111
112 That's it. Now your system should be set up accordingly for capturing network
113 traffic.
114
115 Capturing traffic
116 ~~~~~~~~~~~~~~~~~
117
118 Execute:
119
120   tcpdump -s0 -C 50 -v -w pcap -i br0
121
122 to generate files named pcap, pcap1, pcap2,... each with a file size of ~50MB.
123 Press CTRL-C to stop capturing traffic. You can analyse the generated pcap files
124 for example using wireshark(1).
125
126 See also
127 --------
128 grml-ap(8), grml-bridge(8), grml-router(8)
129
130 AUTHOR
131 ------
132 grml-sniff was written by Michael Prokop <mika@grml.org>.