ifpps: Add __noreturn attribute to exiting functions
[netsniff-ng.git] / mausezahn.8
blob1c89b29e5ed1ae102ff41772d0ce0938094a52ad
1 .\" netsniff-ng - the packet sniffing beast
2 .\" Copyright 2013 Herbert Haas, modified by Daniel Borkmann.
3 .\" Subject to the GPL, version 2.
5 .TH MAUSEZAHN 8 "03 March 2013" "Linux" "netsniff-ng toolkit"
6 .SH NAME
7 mausezahn \- a fast versatile packet generator with Cisco-cli
9 .SH SYNOPSIS
11 \fB mausezahn\fR { [\fIoptions\fR] "<arg-string> | <hex-string>" }
13 .SH DESCRIPTION
15 mausezahn is a fast traffic generator which allows you to send nearly every
16 possible and impossible packet. In contrast to trafgen(8), mausezahn's packet
17 configuration is on protocol-level instead of byte-level and mausezahn also
18 comes with a built-in Cisco-like command-line interface, making it suitable
19 as a network traffic generator box in your network lab.
21 Next to network labs, it can also be used as a didactical tool and for security
22 audits including penetration and DoS testing. As a traffic generator, mausezahn
23 is also able to test IP multicast or VoIP networks. Packet rates close to the
24 physical limit are reachable, depending on the hardware platform.
26 mausezahn supports two modes, ``direct mode'' and a multi-threaded ``interactive
27 mode''.
29 The ``direct mode'' allows you to create a packet directly on the command line
30 and every packet parameter is specified in the argument list when calling
31 mausezahn.
33 The ``interactive mode'' is an advanced multi-threaded configuration mode with
34 its own command line interface (cli). This mode allows you to create an arbitrary
35 number of packet types and streams in parallel, each with different parameters.
37 The interactive mode utilizes a completely redesigned and more flexible protocol
38 framework called ``mops'' (mausezahn's own packet system). The look and feel of
39 the cli is very close to the Cisco IOS^tm command line.
41 You can start the interactive mode by executing mausezahn with the ``-x''
42 argument (an optional port number may follow, otherwise it is 25542). Then use
43 telnet(1) to connect to this mausezahn instance. If not otherwise specified,
44 the default login/password combination is mz:mz, enable password is: mops.
45 This can be changed in /etc/netsniff-ng/mausezahn.conf.
47 The direct mode supports two specification schemes: The ``raw-layer-2'' scheme,
48 where every single byte to be sent can be specified, and ``higher-layer'' scheme,
49 where packet builder interfaces are used (using the ``-t'' option).
51 To use the ``raw-layer-2'' scheme, simply specify the desired frame as
52 hexadecimal sequence (the ``hex-string''), such as:
54   mausezahn eth0 "00:ab:cd:ef:00 00:00:00:00:00:01 08:00 ca:fe:ba:be"
56 In this example, whitespaces within the byte string are optional and separate
57 the Ethernet fields (destination and source address, type field, and a short
58 payload). The only additional options supported are ``-a'', ``-b'', ``-c'', and
59 ``-p''. The frame length must be greater or equal 15 bytes.
61 The ``higher-layer'' scheme is enabled using the ``-t <packet-type>'' option.
62 This option activates a packet builder and besides the ``packet-type'' an
63 optional ``arg-string'' can be specified. The ``arg-string'' contains
64 packet-specific parameters, such as TCP flags, port numbers, etc (see example
65 section).
67 .SH OPTIONS
68 mausezahn provides a built-in context-specific help. Thus, simply append the
69 keyword ``help'' after the configuration options. The most important options
70 are:
72 .SS -x [<port>]
73 Start mausezahn in interactive mode with a Cisco-like cli. Use telnet to log
74 into the local mausezahn instance. If no port has been specified, port 25542
75 is used as default.
77 .SS -v
78 Verbose mode. Capital -V is even more verbose.
80 .SS -S
81 Simulation mode, i.e. don't put anything on the wire. This is typically combined
82 with the verbose mode.
84 .SS -q
85 Quiet mode where only warnings and errors are displayed.
87 .SS -c <count>
88 Send the packet count times (default: 1, infinite: 0).
90 .SS -d <delay>
91 Apply delay between transmissions. The delay value can be specified in usec
92 (default, no additional unit needed), or in msec (e.g. 100m or 100msec), or
93 in seconds (e.g. 100s or 100sec). Note: mops also supports nanosecond delay
94 granulation if you need it (see interactive mode).
96 .SS -p <lenght>
97 Pad the raw frame to specified length using zero bytes. Note that for raw
98 layer 2 frames the specified length defines the whole frame length, while for
99 higher layer packets the number of additional padding bytes are specified.
101 .SS -a <src-mac|keyword>
102 Use specified source MAC address with hex notation such as 00:00:aa:bb:cc:dd.
103 By default the interface MAC address will be used. The keywords ``rand'' and
104 ``own'' refer to a random MAC address (only unicast addresses are created)
105 and the own address, respectively. You can also use the keywords mentioned
106 below although broadcast-type source addresses are officially invalid.
108 .SS -b <dst-mac|keyword>
109 Use specified destination MAC address. By default, a broadcast is sent in raw
110 layer 2 mode or the destination hosts/gateways interface MAC address in normal
111 (IP) mode. You can use the same keywords as mentioned above, as well as
112 ``bc'' or ``bcast'', ``cisco'', and ``stp''. Please note that for the destination
113 MAC address the ``rand'' keyword is supported but creates a random address only
114 once, even when you send multiple packets.
116 .SS -A <src-ip|range|rand>
117 Use specified source IP address, default is own interface IP. Optionally, the
118 keyword ``rand'' can again be used for a random source IP address or a range
119 can be specified, such as ``192.168.1.1-192.168.1.100'' or ``10.1.0.0/16''.
120 Also, a DNS name can be specified for which mausezahn tries to determine the
121 corresponding IP address automatically.
123 .SS -B <dst-ip|range>
124 Use specified destination IP address (default is broadcast i.e. 255.255.255.255).
125 As with the source address (see above) you can also specify a range or a DNS name.
127 .SS -t <packet-type>
128 Create the specified packet type using the built-in packet builder. Currently,
129 supported packet types are: ``arp'', ``bpdu'', ``ip'', ``udp'', ``tcp'', ``rtp'',
130 and ``dns''. There is currently also a limited support for ``icmp''. Type
131 ``-t help'' to verify which packet builders your actual mausezahn version
132 supports. Also, for any particular packet type, for example ``tcp'' type
133 ``mausezahn -t tcp help'' to receive a more in-depth context specific help.
135 .SS -T <packet-type>
136 Make this mausezahn instance the receiving station. Currently, only ``rtp'' is
137 an option here and provides precise jitter measurements. For this purpose, start
138 another mausezahn instance on the sending station and the local receiving station
139 will output jitter statistics. See ``mausezahn \-T rtp help'' for a detailed help.
141 .SS -Q <[CoS:]vlan> [, <[CoS:]vlan>, ...]
142 Specify 802.1Q VLAN tag and optional Class of Service. An arbitrary number of
143 VLAN tags can be specified (that is you can simulate QinQ or even QinQinQinQ..).
144 Multiple tags must be separated via a comma or a period (e.g. "5:10,20,2:30").
145 VLAN tags are not supported for ARP and BPDU packets (in which case you could
146 specify the whole frame in hex using the raw layer 2 interface of mausezahn).
148 .SS -M <label[:cos[:ttl]][bos]> [, <label...>] 
149 Specify a MPLS label or even a MPLS label stack. Optionally, for each label the
150 experimental bits (usually the Class of Service, CoS) and the Time To Live
151 (TTL) can be specified. And if you are really crazy you can set/unset the
152 Bottom of Stack (BoS) bit at each label using the ``S'' (set) and ``s''
153 (unset) option. By default, the BoS is set automatically and correct. Any other
154 setting will lead to invalid frames. Enter ``-M help'' for detailed instructions
155 and examples.
157 .SS -P <ascii-payload>
158 Specify a cleartext payload. Alternatively, each packet type supports a
159 hexadecimal specification of the payload (see for example ``-t udp help'').
161 .SS -f <filename>
162 Read the ascii payload from the specified file.
164 .SS -F <filename>
165 Read the hex payload from the specified file. Actually, this file must be also
166 an ascii text file, but must contain hexadecimal digits, e.g. "aa:bb:cc:0f:e6...".
167 You can use also spaces as separation characters.
169 .SH USAGE EXAMPLE
171 .SS mausezahn eth0 \-c 0 \-d 2s \-t bpdu vlan=5
172 Send BPDU frames for VLAN 5 as used with Cisco's PVST+ type of STP. By default
173 mausezahn assumes that you want to become the root bridge.
175 .SS mausezahn eth0 \-c 128000 \-a rand \-p 64
176 Perform a CAM table overflow attack.
178 .SS mausezahn eth0 \-c 0 \-Q 5,100 \-t tcp "flags=syn,dp=1-1023" \-p 20 \-A rand \-B 10.100.100.0/24
179 Perform a SYN flood attack to another VLAN using VLAN hopping. This only works
180 if you are connected to the same VLAN which is configured as native VLAN on the
181 trunk. We assume that the victim VLAN is VLAN 100 and the native VLAN is VLAN 5.
182 Lets attack every host in VLAN 100 which use a IP prefix of 10.100.100.0/24, also
183 try out all ports between 1 and 1023 and use a random source IP address.
185 .SS mausezahn eth0 \-c 0 \-d 10msec \-B 230.1.1.1 \-t udp "dp=32000,dscp=46" \-P "Multicast test packet"
186 Send IP multicast packets to the multicast group 230.1.1.1 using a UDP header
187 with destination port 32000 and set the IP DSCP field to EF (46). Send one
188 frame every 10 msec.
190 .SS mausezahn eth0 \-Q 6:420 \-M 100,200,300:5 \-A 172.30.0.0/16 \-B target.anynetwork.foo \-t udp "sp=666,dp=1-65535" \-p 1000 \-c 10
191 Send UDP packets to the destination host target.anynetwork.foo using all
192 possible destination ports and send every packet with all possible source
193 addresses of the range 172.30.0.0/16; additionally use a source port of 666
194 and three MPLS labels, 100, 200, and 300, the outer (300) with QoS field 5.
195 Send the frame with a VLAN tag 420 and CoS 6; eventually pad with 1000 bytes
196 and repeat the whole thing 10 times.
198 .SS mausezahn \-t syslog sev=3 \-P "Main reactor reached critical temperature." \-A 192.168.33.42 \-B 10.1.1.9 \-c 6 \-d 10s
199 Send six forged syslog messages with severity 3 to a Syslog server 10.1.1.9; use
200 a forged source IP address 192.168.33.42 and let mausezahn decide which local
201 interface to use. Use an inter-packet delay of 10 seconds.
203 .SS mausezahn \-t tcp "flags=syn|urg|rst, sp=145, dp=145, win=0, s=0-4294967295, ds=1500, urg=666" \-a bcast \-b bcast \-A bcast \-B 10.1.1.6 \-p 5
204 Send an invalid TCP packet with only a 5 byte payload as layer-2 broadcast and
205 also use the broadcast MAC address as source address. The target should be
206 10.1.1.6 but use a broadcast source address. The source and destination port
207 shall be 145 and the window size 0. Set the TCP flags SYN, URG, and RST
208 simultaneously and sweep through the whole TCP sequence number space with an
209 increment of 1500. Finally set the urgent pointer to 666, i.e. pointing to
210 nowhere.
212 .SH NOTE
213 When multiple ranges are specified, e.g. destination port ranges and
214 destination address ranges, then all possible combinations of ports and
215 addresses are used for packet generation. Furthermore, this can be mixed with
216 other ranges e.g. a TCP sequence number range. Note that combining ranges
217 can lead to a very huge number of frames to be sent. As a rule of thumb you
218 can assume that about 100,000 frames and more are sent in a fraction of one
219 second, depending on your network interface.
221 mausezahn has been designed as fast traffic generator so you might easily
222 overwhelm a LAN segment with myriads of packets. And because mausezahn should
223 also support security audits it is also possible to create malicious or
224 invalid packets, SYN floods, port and address sweeps, DNS and ARP poisoning,
225 etc.
227 Therefore, don't use this tool when you are not aware of possible consequences
228 or have only little knowledge about networks and data communication. If you
229 abuse mausezahn for 'unallowed' attacks and get caught, or damage something of
230 your own, then this is completely your fault. So the safest solution is to try
231 it out in a lab environment.
233 .SH LEGAL
234 mausezahn is licensed under the GNU GPL version 2.0.
236 .SH HISTORY
237 .B mausezahn
238 was originally written by Herbert Haas. According to his website [1], he
239 unfortunately passed away in 2011. Thus, having this tool unmaintained as well.
240 It has been adopted and integrated into the netsniff-ng toolkit and is further
241 being maintained and developed from there. Maintainers are Tobias Klauser
242 <tklauser@distanz.ch> and Daniel Borkmann <dborkma@tik.ee.ethz.ch>.
244   [1] http://www.perihel.at/
246 .SH SEE ALSO
247 .BR netsniff-ng (8),
248 .BR trafgen (8),
249 .BR ifpps (8),
250 .BR bpfc (8),
251 .BR flowtop (8),
252 .BR astraceroute (8),
253 .BR curvetun (8)
255 .SH AUTHOR
256 Manpage was written by Herbert Haas and modified by Daniel Borkmann.