netsniff-ng: remove unnecessary zeroing of packet counters in init_ctx()
[netsniff-ng.git] / mausezahn.8
blob1ad7667408d17bbd5d125714d7efcab0f6017d8d
1 .\" netsniff-ng - the packet sniffing beast
2 .\" Copyright 2013 Herbert Haas, modified by Daniel Borkmann.
3 .\" Subject to the GPL, version 2.
4 .TH MAUSEZAHN 8 "03 March 2013" "Linux" "netsniff-ng toolkit"
5 .SH NAME
6 mausezahn \- a fast versatile packet generator with Cisco-cli
7 .PP
8 .SH SYNOPSIS
9 .PP
10 \fBmausezahn\fR { [\fIoptions\fR] "<arg-string> | <hex-string>" }
11 .PP
12 .SH DESCRIPTION
13 .PP
14 mausezahn is a fast traffic generator which allows you to send nearly every
15 possible and impossible packet. In contrast to trafgen(8), mausezahn's packet
16 configuration is on a protocol-level instead of byte-level and mausezahn also
17 comes with a built-in Cisco-like command-line interface, making it suitable
18 as a network traffic generator box in your network lab.
19 .PP
20 Next to network labs, it can also be used as a didactical tool and for security
21 audits including penetration and DoS testing. As a traffic generator, mausezahn
22 is also able to test IP multicast or VoIP networks. Packet rates close to the
23 physical limit are reachable, depending on the hardware platform.
24 .PP
25 mausezahn supports two modes, ''direct mode'' and a multi-threaded ''interactive
26 mode''.
27 .PP
28 The ''direct mode'' allows you to create a packet directly on the command line
29 and every packet parameter is specified in the argument list when calling
30 mausezahn.
31 .PP
32 The ''interactive mode'' is an advanced multi-threaded configuration mode with
33 its own command line interface (CLI). This mode allows you to create an arbitrary
34 number of packet types and streams in parallel, each with different parameters.
35 .PP
36 The interactive mode utilizes a completely redesigned and more flexible protocol
37 framework called ''mops'' (mausezahn's own packet system). The look and feel of
38 the CLI is very close to the Cisco IOS^tm command line interface.
39 .PP
40 You can start the interactive mode by executing mausezahn with the ''\-x''
41 argument (an optional port number may follow, otherwise it is 25542). Then use
42 telnet(1) to connect to this mausezahn instance. If not otherwise specified,
43 the default login and password combination is mz:mz and the enable password is: mops.
44 This can be changed in /etc/netsniff-ng/mausezahn.conf.
45 .PP
46 The direct mode supports two specification schemes: The ''raw-layer-2'' scheme,
47 where every single byte to be sent can be specified, and ''higher-layer'' scheme,
48 where packet builder interfaces are used (using the ''\-t'' option).
49 .PP
50 To use the ''raw-layer-2'' scheme, simply specify the desired frame as a
51 hexadecimal sequence (the ''hex-string''), such as:
52 .PP
53   mausezahn eth0 "00:ab:cd:ef:00 00:00:00:00:00:01 08:00 ca:fe:ba:be"
54 .PP
55 In this example, whitespaces within the byte string are optional and separate
56 the Ethernet fields (destination and source address, type field, and a short
57 payload). The only additional options supported are ''\-a'', ''\-b'', ''\-c'',
58 and ''\-p''. The frame length must be greater than or equal to 15 bytes.
59 .PP
60 The ''higher-layer'' scheme is enabled using the ''\-t <packet-type>'' option.
61 This option activates a packet builder, and besides the ''packet-type'', an
62 optional ''arg-string'' can be specified. The ''arg-string'' contains packet-
63 specific parameters, such as TCP flags, port numbers, etc. (see example section).
64 .PP
65 .SH OPTIONS
66 .PP
67 mausezahn provides a built-in context-specific help. Append the keyword
68  ''help'' after the configuration options. The most important options
69 are:
70 .PP
71 .SS -x [<port>]
72 Start mausezahn in interactive mode with a Cisco-like CLI. Use telnet to log
73 into the local mausezahn instance. If no port has been specified, port 25542
74 is used by default.
75 .PP
76 .SS -6
77 Specify IPv6 mode (IPv4 is the default).
78 .PP
79 .SS -l <IP>
80 Specify the IP address mausezahn should bind to when in interactive mode, default: 0.0.0.0.
81 .PP
82 .SS -v
83 Verbose mode. Capital \-V is even more verbose.
84 .PP
85 .SS -S
86 Simulation mode, i.e. don't put anything on the wire. This is typically combined
87 with the verbose mode.
88 .PP
89 .SS -q
90 Quiet mode where only warnings and errors are displayed.
91 .PP
92 .SS -c <count>
93 Send the packet count times (default: 1, infinite: 0).
94 .PP
95 .SS -d <delay>
96 Apply delay between transmissions. The delay value can be specified in usec
97 (default, no additional unit needed), or in msec (e.g. 100m or 100msec), or
98 in seconds (e.g. 100s or 100sec). Note: mops also supports nanosecond delay
99 resolution if you need it (see interactive mode).
101 .SS -p <length>
102 Pad the raw frame to specified length using zero bytes. Note that for raw
103 layer 2 frames the specified length defines the whole frame length, while for
104 higher layer packets the number of additional padding bytes are specified.
106 .SS -a <src-mac|keyword>
107 Use specified source MAC address with hexadecimal notation such as 00:00:aa:bb:cc:dd.
108 By default the interface MAC address will be used. The keywords ''rand'' and
109  ''own'' refer to a random MAC address (only unicast addresses are created)
110 and the own address, respectively. You can also use the keywords mentioned
111 below although broadcast-type source addresses are officially invalid.
113 .SS -b <dst-mac|keyword>
114 Use specified destination MAC address. By default, a broadcast is sent in raw
115 layer 2 mode or to the destination hosts or gateway interface MAC address in normal
116 (IP) mode. You can use the same keywords as mentioned above, as well as
117  ''bc'' or ''bcast'', ''cisco'', and ''stp''. Please note that for the destination
118 MAC address the ''rand'' keyword is supported but creates a random address only
119 once, even when you send multiple packets.
121 .SS -A <src-ip|range|rand>
122 Use specified source IP address, default is own interface address. Optionally, the
123 keyword ''rand'' can again be used for a random source IP address or a range
124 can be specified, such as ''192.168.1.1-192.168.1.100'' or ''10.1.0.0/16''.
125 Also, a DNS name can be specified for which mausezahn tries to determine the
126 corresponding IP address automatically.
128 .SS -B <dst-ip|range>
129 Use specified destination IP address (default is broadcast i.e. 255.255.255.255).
130 As with the source address (see above) you can also specify a range or a DNS name.
132 .SS -t <packet-type [help] | help>
133 Create the specified packet type using the built-in packet builder. Currently,
134 supported packet types are: ''arp'', ''bpdu'', ''ip'', ''udp'', ''tcp'', ''rtp'',
135 and ''dns''. Currently, there is also limited support for ''icmp''. Type
136  ''\-t help'' to verify which packet builders your actual mausezahn version
137 supports. Also, for any particular packet type, for example ''tcp'' type
138  ''mausezahn \-t tcp help'' to receive a more in-depth context specific help.
140 .SS -T <packet-type>
141 Make this mausezahn instance the receiving station. Currently, only ''rtp'' is
142 an option here and provides precise jitter measurements. For this purpose, start
143 another mausezahn instance on the sending station and the local receiving station
144 will output jitter statistics. See ''mausezahn \-T rtp help'' for a detailed help.
146 .SS -Q <[CoS:]vlan> [, <[CoS:]vlan>, ...]
147 Specify 802.1Q VLAN tag and optional Class of Service. An arbitrary number of
148 VLAN tags can be specified (that is, you can simulate QinQ or even QinQinQinQ..).
149 Multiple tags must be separated via a comma or a period (e.g. "5:10,20,2:30").
150 VLAN tags are not supported for ARP and BPDU packets (in which case you could
151 specify the whole frame in hexadecimal using the raw layer 2 interface of mausezahn).
153 .SS -M <label[:cos[:ttl]][bos]> [, <label...>]
154 Specify a MPLS label or even a MPLS label stack. Optionally, for each label the
155 experimental bits (usually the Class of Service, CoS) and the Time To Live
156 (TTL) can be specified. If you are really crazy you can set and unset the
157 Bottom of Stack (BoS) bit for each label using the ''S'' (set) and ''s''
158 (unset) option. By default, the BoS is set automatically and correctly. Any other
159 setting will lead to invalid frames. Enter ''\-M help'' for detailed instructions
160 and examples.
162 .SS -P <ascii-payload>
163 Specify a cleartext payload. Alternatively, each packet type supports a
164 hexadecimal specification of the payload (see for example ''\-t udp help'').
166 .SS -f <filename>
167 Read the ASCII payload from the specified file.
169 .SS -F <filename>
170 Read the hexadecimal payload from the specified file. Actually, this file must be also
171 an ASCII text file, but must contain hexadecimal digits, e.g. "aa:bb:cc:0f:e6...".
172 You can use also spaces as separation characters.
174 .SH USAGE EXAMPLE
176 For more comprehensive examples, have a look at the two following HOWTO sections.
178 .SS mausezahn eth0 \-c 0 \-d 2s \-t bpdu vlan=5
179 Send BPDU frames for VLAN 5 as used with Cisco's PVST+ type of STP. By default
180 mausezahn assumes that you want to become the root bridge.
182 .SS mausezahn eth0 \-c 128000 \-a rand \-p 64
183 Perform a CAM table overflow attack.
185 .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
186 Perform a SYN flood attack to another VLAN using VLAN hopping. This only works
187 if you are connected to the same VLAN which is configured as native VLAN on the
188 trunk. We assume that the victim VLAN is VLAN 100 and the native VLAN is VLAN 5.
189 Lets attack every host in VLAN 100 which use an IP prefix of 10.100.100.0/24, also
190 try out all ports between 1 and 1023 and use a random source IP address.
192 .SS mausezahn eth0 \-c 0 \-d 10msec \-B 230.1.1.1 \-t udp "dp=32000,dscp=46" \-P "Multicast test packet"
193 Send IP multicast packets to the multicast group 230.1.1.1 using a UDP header
194 with destination port 32000 and set the IP DSCP field to EF (46). Send one
195 frame every 10 msec.
197 .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
198 Send UDP packets to the destination host target.anynetwork.foo using all
199 possible destination ports and send every packet with all possible source
200 addresses of the range 172.30.0.0/16; additionally use a source port of 666
201 and three MPLS labels, 100, 200, and 300, the outer (300) with QoS field 5.
202 Send the frame with a VLAN tag 420 and CoS 6; eventually pad with 1000 bytes
203 and repeat the whole thing 10 times.
205 .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
206 Send six forged syslog messages with severity 3 to a Syslog server 10.1.1.9; use
207 a forged source IP address 192.168.33.42 and let mausezahn decide which local
208 interface to use. Use an inter-packet delay of 10 seconds.
210 .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
211 Send an invalid TCP packet with only a 5 byte payload as layer-2 broadcast and
212 also use the broadcast MAC address as source address. The target should be
213 10.1.1.6 but use a broadcast source address. The source and destination port
214 shall be 145 and the window size 0. Set the TCP flags SYN, URG, and RST
215 simultaneously and sweep through the whole TCP sequence number space with an
216 increment of 1500. Finally set the urgent pointer to 666, i.e. pointing to
217 nowhere.
219 .SH CONFIGURATION FILE
221 When mausezahn is run in interactive mode it automatically looks for and reads
222 a configuration file located at /etc/netsniff-ng/mausezahn.conf for custom options
223 if the file is available, otherwise it uses defaults set at compile time.
224 .SS Config file: /etc/netsniff-ng/mausezahn.conf
226 The configuration file contains lines of the form:
228         option = value
230 Options supported in the configuration file are:
231    Option:              Description:
233    user                 Username for authentication (default: mz)
234    password             Password for authentication (default: mz)
235    enable                    Password to enter privilege mode (default: mops)
236    port                 The listening port for the CLI (default: 25542)
237    listen-addr          IP address to bind CLI to (default: 0.0.0.0)
238    management-only      Set management interface (no data traffic is allowed to pass through)
239    cli-device           Interface to bind CLI to (default: all) *not fully implemented*
240    automops         Path to automops file (contains XML data describing protocols) *in development*
242 .SS Example:
244  $ cat /etc/netsniff-ng/mausezahn.conf
245  user = mzadmin
246  password = mzpasswd
247  enable = privilege-mode-passwd
248  port = 65000
249  listen-addr = 127.0.0.1
251 .SH INTERACTIVE MODE HOWTO
253 .SS Telnet:
255 Using the interactive mode requires starting mausezahn as a server:
257   # mausezahn \-x
259 Now you can telnet(1) to that server using the default port number 25542, but also
260 an arbitrary port number can be specified:
262   # mausezahn \-x 99
263   mausezahn accepts incoming telnet connections on port 99.
264   mz: Problems opening config file. Will use defaults
267 Either from another terminal or from another host try to telnet to the
268 mausezahn server:
270   caprica$ telnet galactica 99
271   Trying 192.168.0.4...
272   Connected to galactica.
273   Escape character is '^]'.
274   mausezahn <version>
276   Username: mz
277   Password: mz
279   mz> enable
280   Password: mops
281   mz#
283 It is recommended to configure your own login credentials in
284 /etc/netsniff-ng/mausezahn.conf, (see configuration file section)
285 .SS Basics:
287 Since you reached the mausezahn prompt, lets try some common commands. You can
288 use the '?' character at any time for context-specific help. Note that Cisco-like
289 short form of commands are accepted in interactive mode. For example, one
290 can use "sh pac" instead of "show packet"; another common example is to use
291 "config t" in place of "configure terminal". For readability, this manual will
292 continue with the full commands.
294 First try out the show command:
296   mz# show ?
298 mausezahn maintains its own ARP table and observes anomalies. There is an entry
299 for every physical interface (however this host has only one):
301   mz# show arp
302   Intf    Index     IP address     MAC address       last       Ch  UCast BCast Info
303   ----------------------------------------------------------------------------------
304   eth0    [1] D     192.168.0.1  00:09:5b:9a:15:84  23:44:41     1     1     0  0000
306 The column Ch tells us that the announced MAC address has only changed one time
307 (= when it was learned). The columns Ucast and BCast tell us how often this
308 entry was announced via unicast or broadcast respectively.
310 Let's check our interfaces:
312   mz# show interface
313   Available network interfaces:
314                  real             real                  used (fake)      used (fake)
315    device        IPv4 address     MAC address           IPv4 address     MAC address
316   ---------------------------------------------------------------------------------------
317   > eth0         192.168.0.4      00:30:05:76:2e:8d     192.168.0.4      00:30:05:76:2e:8d
318     lo           127.0.0.1        00:00:00:00:00:00     127.0.0.1        00:00:00:00:00:00
319   2 interfaces found.
320   Default interface is eth0.
322 .SS Defining packets:
324 Let's check the current packet list:
326   mz# show packet
327   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
328   PktID  PktName           Layers  Proto    Size  State      Device      Delay       Count/CntX
329       1  sysARP_servic...  E-----  ARP        60  config     lo          100 msec        1/0 (100%)
330   1 packets defined, 0 active.
332 We notice that there is already one system-defined packet process; it has been
333 created and used only once (during startup) by mausezahn's ARP service.
334 Currently, its state is config which means that the process is sleeping.
336 .SS General packet options:
338 Now let's create our own packet process and switch into the global
339 configuration mode:
341   mz# configure terminal
342   mz(config)# packet
343   Allocated new packet PKT0002 at slot 2
344   mz(config-pkt-2)# ?
345   ...
346   name                 Assign a unique name
347   description          Assign a packet description text
348   bind                 Select the network interface
349   count                Configure the packet count value
350   delay                Configure the inter-packet delay
351   interval             Configure a greater interval
352   type                 Specify packet type
353   mac                  Configure packet's MAC addresses
354   tag                  Configure tags
355   payload              Configure a payload
356   port                 Configure packet's port numbers
357   end                  End packet configuration mode
358   ethernet             Configure frame's Ethernet, 802.2, 802.3, or SNAP settings
359   ip                   Configure packet's IP settings
360   udp                  Configure packet's UDP header parameters
361   tcp                  Configure packet's TCP header parameters
363 Here are a lot of options but normally you only need a few of them. When you
364 configure lots of different packets you might assign a reasonable name and
365 description for them:
367   mz(config-pkt-2)# name Test
368   mz(config-pkt-2)# description This is just a test
370 You can, for example, change the default settings for the source and destination MAC or IP
371 addresses using the mac and ip commands:
373   mz(config-pkt-2)# ip address destination 10.1.1.0 /24
374   mz(config-pkt-2)# ip address source random
376 In the example above, we configured a range of addresses (all hosts in the
377 network 10.1.1.0 should be addressed). Additionally we spoof our source IP
378 address. Of course, we can also add one or more VLAN and, or, MPLS tag(s):
380   mz(config-pkt-2)# tag ?
381   dot1q                Configure 802.1Q (and 802.1P) parameters
382   mpls                 Configure MPLS label stack
383   mz(config-pkt-2)# tag dot ?
384   Configure 802.1Q tags:
385   VLAN[:CoS] [VLAN[:CoS]] ...   The leftmost tag is the outer tag in the frame
386   remove <tag-nr> | all         Remove one or more tags (<tag-nr> starts with 1),
387                                 by default the first (=leftmost,outer) tag is removed,
388                                 keyword 'all' can be used instead of tag numbers.
389   cfi | nocfi [<tag-nr>]        Set or unset the CFI-bit in any tag (by default
390                                 assuming the first tag).
391   mz(config-pkt-2)# tag dot 1:7 200:5
393 .SS Configure count and delay:
395   mz(config-pkt-2)# count 1000
396   mz(config-pkt-2)# delay ?
397   delay <value> [hour | min | sec | msec | usec | nsec]
399 Specify the inter-packet delay in hours, minutes, seconds, milliseconds,
400 microseconds or nanoseconds. The default unit is milliseconds (i.e. when no
401 unit is given).
403   mz(config-pkt-2)# delay 1 msec
404   Inter-packet delay set to 0 sec and 1000000 nsec
405   mz(config-pkt-2)#
407 .SS Configuring protocol types:
409 mausezahn's interactive mode supports a growing list of protocols and only
410 relies on the MOPS architecture (and not on libnet as is the case with
411 the legacy direct mode):
413   mz(config-pkt-2)# type
414   Specify a packet type from the following list:
415   arp
416   bpdu
417   igmp
418   ip
419   lldp
420   tcp
421   udp
422   mz(config-pkt-2)# type tcp
423   mz(config-pkt-2-tcp)#
424   ....
425   seqnr                Configure the TCP sequence number
426   acknr                Configure the TCP acknowledgement number
427   hlen                 Configure the TCP header length
428   reserved             Configure the TCP reserved field
429   flags                Configure a combination of TCP flags at once
430   cwr                  Set or unset the TCP CWR flag
431   ece                  Set or unset the TCP ECE flag
432   urg                  Set or unset the TCP URG flag
433   ack                  set or unset the TCP ACK flag
434   psh                  set or unset the TCP PSH flag
435   rst                  set or unset the TCP RST flag
436   syn                  set or unset the TCP SYN flag
437   fin                  set or unset the TCP FIN flag
438   window               Configure the TCP window size
439   checksum             Configure the TCP checksum
440   urgent-pointer       Configure the TCP urgent pointer
441   options              Configure TCP options
442   end                  End TCP configuration mode
443   mz(config-pkt-2-tcp)# flags syn fin rst
444   Current setting is: --------------------RST-SYN-FIN
445   mz(config-pkt-2-tcp)# end
446   mz(config-pkt-2)# payload ascii This is a dummy payload for my first packet
447   mz(config-pkt-2)# end
449 Now configure another packet, for example let's assume we want an LLDP process:
451   mz(config)# packet
452   Allocated new packet PKT0003 at slot 3
453   mz(config-pkt-3)# type lldp
454   mz(config-pkt-3-lldp)# exit
455   mz(config)# exit
457 In the above example we only use the default LLDP settings and don't configure
458 further LLDP options or TLVs. Back in the top level of the CLI let's verify
459 what we had done:
461   mz# show packet
462   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
463   PktID  PktName            Layers  Proto    Size  State      Device   Delay      Count/CntX
464      1   sysARP_servic...   E-----  ARP        60  config     lo       100 msec       1/0 (100%)
465      2   Test               E-Q-IT            125  config     eth0    1000 usec    1000/1000 (0%)
466      3   PKT0003            E-----  LLDP       36  config     eth0      30 sec        0/0 (0%)
467   3 packets defined, 0 active.
469 The column Layers indicates which major protocols have been combined. For
470 example the packet with packet-id 2 ("Test") utilizes Ethernet (E),
471 IP (I), and TCP (T). Additionally an 802.1Q tag (Q) has been inserted. Now
472 start one of these packet processes:
474   mz# start slot 3
475   Activate [3]
476   mz# show packet
477   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
478   PktID  PktName            Layers  Proto    Size  State      Device   Delay      Count/CntX
479      1   sysARP_servic...   E-----  ARP        60  config     lo       100 msec       1/0 (100%)
480      2   Test               E-Q-IT            125  config     eth0    1000 usec    1000/1000 (0%)
481      3   PKT0003            E-----  LLDP       36  config     eth0      30 sec        0/1 (0%)
482   3 packets defined, 1 active.
484 Let's have a more detailed look at a specific packet process:
486   mz# show packet 2
487   Packet [2] Test
488   Description: This is just a test
489   State: config, Count=1000, delay=1000 usec (0 s 1000000 nsec), interval= (undefined)
490   Headers:
491    Ethernet: 00-30-05-76-2e-8d => ff-ff-ff-ff-ff-ff  [0800 after 802.1Q tag]
492    Auto-delivery is ON (that is, the actual MAC is adapted upon transmission)
493    802.1Q: 0 tag(s);  (VLAN:CoS)
494    IP:  SA=192.168.0.4 (not random) (no range)
495         DA=255.255.255.255 (no range)
496         ToS=0x00  proto=17  TTL=255  ID=0  offset=0  flags: -|-|-
497         len=49664(correct)  checksum=0x2e8d(correct)
498    TCP: 83 bytes segment size (including TCP header)
499         SP=0 (norange) (not random), DP=0 (norange) (not random)
500         SQNR=3405691582 (start 0, stop 4294967295, delta 0) -- ACKNR=0 (invalid)
501         Flags: ------------------------SYN----, reserved field is 00, urgent pointer= 0
502         Announced window size= 100
503         Offset= 0 (times 32 bit; value is valid), checksum= ffff (valid)
504         (No TCP options attached) - 0 bytes defined
505    Payload size: 43 bytes
506    Frame size: 125 bytes
507     1  ff:ff:ff:ff:ff:ff:00:30  05:76:2e:8d:81:00:e0:01  81:00:a0:c8:08:00:45:00  00:67:00:00:00:00:ff:06
508    33  fa:e4:c0:a8:00:04:ff:ff  ff:ff:00:00:00:00:ca:fe  ba:be:00:00:00:00:a0:07  00:64:f7:ab:00:00:02:04
509    65  05:ac:04:02:08:0a:19:35  90:c3:00:00:00:00:01:03  03:05:54:68:69:73:20:69  73:20:61:20:64:75:6d:6d
510    97  79:20:70:61:79:6c:6f:61  64:20:66:6f:72:20:6d:79  20:66:69:72:73:74:20:70  61:63:6b:65:74
511   mz#
513 If you want to stop one or more packet processes, use the stop command. The
514 "emergency stop" is when you use stop all:
516   mz# stop all
517   Stopping
518   [3] PKT0003
519   Stopped 1 transmission processe(s)
521 The launch command provides a shortcut for commonly used packet processes. For
522 example to behave like a STP-capable bridge we want to start an BPDU process
523 with typical parameters:
525   mz# launch bpdu
526   Allocated new packet sysBPDU at slot 5
527   mz# show packet
528   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
529   PktID  PktName           Layers  Proto    Size  State      Device      Delay       Count/CntX
530       1  sysARP_servic...  E-----  ARP        60  config     lo          100 msec        1/0 (100%)
531       2  Test              E-Q-IT            125  config     eth0       1000 usec     1000/1000 (0%)
532       3  PKT0003           E-----  LLDP       36  config     eth0          30 sec        0/12 (0%)
533       4  PKT0004           E---I-  IGMP       46  config     eth0        100 msec        0/0 (0%)
534       5  sysBPDU           ES----  BPDU       29  active     eth0           2 sec        0/1 (0%)
535   5 packets defined, 1 active.
537 Now a Configuration BPDU is sent every 2 seconds, claiming to be the root
538 bridge (and usually confusing the LAN. Note that only packet 5 (i.e. the
539 last row) is active and therefore sending packets while all other packets
540 are in state config (i.e. they have been configured but they are not doing
541 anything at the moment).
543 .SS Configuring a greater interval:
545 Sometimes you may want to send a burst of packets at a greater interval:
547   mz(config)# packet 2
548   Modify packet parameters for packet Test [2]
549   mz(config-pkt-2)# interval
550   Configure a greater packet interval in days, hours, minutes, or seconds
551   Arguments: <value>  <days | hours | minutes | seconds>
552   Use a zero value to disable an interval.
553   mz(config-pkt-2)# interval 1 hour
554   mz(config-pkt-2)# count 10
555   mz(config-pkt-2)# delay 15 usec
556   Inter-packet delay set to 0 sec and 15000 nsec
558 Now this packet is sent ten times with an inter-packet delay of 15 microseconds
559 and this is repeated every hour. When you look at the packet list, an interval
560 is indicated with the additional flag 'i' when inactive or 'I' when active:
562   mz# show packet
563   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
564   PktID  PktName           Layers  Proto    Size  State      Device      Delay       Count/CntX
565       1  sysARP_servic...  E-----  ARP        60  config     lo          100 msec        1/0 (100%)
566       2  Test              E-Q-IT            125  config-i   eth0         15 usec       10/10 (0%)
567       3  PKT0003           E-----  LLDP       36  config     eth0          30 sec        0/12 (0%)
568       4  PKT0004           E---I-  IGMP       46  config     eth0        100 msec        0/0 (0%)
569       5  sysBPDU           ES----  BPDU       29  active     eth0           2 sec        0/251 (0%)
570   5 packets defined, 1 active.
571   mz# start slot 2
572   Activate [2]
573   mz# show packet
574   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
575   PktID  PktName           Layers  Proto    Size  State      Device      Delay       Count/CntX
576       1  sysARP_servic...  E-----  ARP        60  config     lo          100 msec        1/0 (100%)
577       2  Test              E-Q-IT            125  config+I   eth0         15 usec       10/0 (100%)
578       3  PKT0003           E-----  LLDP       36  config     eth0          30 sec        0/12 (0%)
579       4  PKT0004           E---I-  IGMP       46  config     eth0        100 msec        0/0 (0%)
580       5  sysBPDU           ES----  BPDU       29  active     eth0           2 sec        0/256 (0%)
581   5 packets defined, 1 active.
583 Note that the flag 'I' indicates that an interval has been specified for
584 packet 2. The process is not active at the moment (only packet 5 is active
585 here) but it will become active at a regular interval. You can verify the
586 actual interval when viewing the packet details via the 'show packet 2' command.
588 .SS Load prepared configurations:
590 You can prepare packet configurations using the same commands as you would
591 type them in on the CLI and then load them to the CLI. For example, assume we
592 have prepared a file 'test.mops' containing:
594   configure terminal
595   packet
596   name IGMP_TEST
597   desc This is only a demonstration how to load a file to mops
598   type igmp
600 Then we can add this packet configuration to our packet list using the load
601 command:
603   mz# load test.mops
604   Read commands from test.mops...
605   Allocated new packet PKT0002 at slot 2
606   mz# show packet
607   Packet layer flags: E=Ethernet, S=SNAP, Q=802.1Q, M=MPLS, I/i=IP/delivery_off, U=UDP, T=TCP
608   PktID  PktName           Layers  Proto    Size  State      Device      Delay       Count/CntX
609       1  sysARP_servic...  E-----  ARP        60  config     lo          100 msec        1/0 (100%)
610       2  IGMP_TEST         E---I-  IGMP       46  config     eth0        100 msec        0/0 (0%)
611   2 packets defined, 0 active.
613 The file src/examples/mausezahn/example_lldp.conf contains another example
614 list of commands to create a bogus LLDP packet. You can load this
615 configuration from the mausezahn command line as follows:
617   mz# load /home/hh/tmp/example_lldp.conf
619 In case you copied the file in that path. Now when you enter 'show packet' you
620 will see a new packet entry in the packet list. Use the 'start slot <nr>'
621 command to activate this packet.
623 You can store your own packet creations in such a file and easily load them when
624 you need them. Every command within such configuration files is executed on the
625 command line interface as if you had typed it in -- so be careful about the
626 order and don't forget to use 'configure terminal' as first command.
628 You can even load other files from within a central config file.
630 .SH DIRECT MODE HOWTO
632 .SS How to specify hexadecimal digits:
634 Many arguments allow direct byte input. Bytes are represented as two
635 hexadecimal digits. Multiple bytes must be separated either by spaces, colons,
636 or dashes - whichever you prefer. The following byte strings are equivalent:
638   "aa:bb cc-dd-ee ff 01 02 03-04 05"
639   "aa bb cc dd ee ff:01:02:03:04 05"
641 To begin with, you may want to send an arbitrary fancy (possibly invalid)
642 frame right through your network card:
644   mausezahn ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:08:00:ca:fe:ba:be
646  or equivalent but more readable:
648   mausezahn ff:ff:ff:ff:ff:ff-ff:ff:ff:ff:ff:ff-08:00-ca:fe:ba:be
650 .SS Basic operations:
652 All major command line options are listed when you execute mausezahn without
653 arguments. For practical usage, keep the following special (not so widely
654 known) options in mind:
656   \-r                    Multiplies the specified delay with a random value.
657   \-p <length>           Pad the raw frame to specified length (using random bytes).
658   \-P <ASCII Payload>    Use the specified ASCII payload.
659   \-f <filename>         Read the ASCII payload from a file.
660   \-F <filename>         Read the hexadecimal payload from a file.
661   \-S                    Simulation mode: DOES NOT put anything on the wire.
662                         This is typically combined with one of the verbose
663                         modes (\-v or V).
665 Many options require a keyword or a number but the \-t option is an exception
666 since it requires both a packet type (such as ip, udp, dns, etc) and an
667 argument string which is specific for that packet type. Here are some simple
668 examples:
670   mausezahn \-t help
671   mausezahn \-t tcp help
672   mausezahn eth3 \-t udp sp=69,dp=69,p=ca:fe:ba:be
674 Note: Don't forget that on the CLI the Linux shell (usually the Bash)
675 interprets spaces as a delimiting character. That is, if you are specifying
676 an argument that consists of multiple words with spaces in between, you MUST
677 group these within quotes. For example, instead of
679   mausezahn eth0 \-t udp sp=1,dp=80,p=00:11:22:33
681  you could either omit the spaces
683   mausezahn eth0 \-t udp sp=1,dp=80,p=00:11:22:33
685  or, for greater safety, use quotes:
687   mausezahn eth0 \-t udp "sp=1,dp=80,p=00:11:22:33"
689 In order to monitor what's going on, you can enable the verbose mode using
690 the \-v option. The opposite is the quiet mode (\-q) which will keep mausezahn
691 absolutely quiet (except for error messages and warnings.)
693 Don't confuse the payload argument p=... with the padding option \-p. The latter
694 is used outside the quotes!
696 .SS The automatic packet builder:
698 An important argument is \-t which invokes a packet builder. Currently there
699 are packet builders for ARP, BPDU, CDP, IP, partly ICMP, UDP, TCP, RTP, DNS,
700 and SYSLOG. (Additionally you can insert a VLAN tag or a MPLS label stack but
701 this works independently of the packet builder.)
703 You get context specific help for every packet builder using the help keyword,
704 such as:
706   mausezahn \-t bpdu help
707   mausezahn \-t tcp help
709 For every packet you may specify an optional payload. This can be done either
710 via hexadecimal notation using the payload (or short p) argument or directly as ASCII
711 text using the \-P option:
713   mausezahn eth0 \-t ip \-P "Hello World"                        # ASCII payload
714   mausezahn eth0 \-t ip p=68:65:6c:6c:6f:20:77:6f:72:6c:64       # hex payload
715   mausezahn eth0 \-t ip "proto=89,                           \\
716                         p=68:65:6c:6c:6f:20:77:6f:72:6c:64, \\   # same with other
717                         ttl=1"                                   # IP arguments
719 Note: The raw link access mode only accepts hexadecimal payloads (because you specify
720 everything in hexadecimal here.)
722 .SS Packet count and delay:
724 By default only one packet is sent. If you want to send more packets then
725 use the count option \-c <count>. When count is zero then mausezahn will send
726 forever. By default, mausezahn sends at maximum speed (and this is really
727 fast ;-)). If you don't want to overwhelm your network devices or have other
728 reasons to send at a slower rate then you might want to specify a delay using
729 the \-d <delay> option.
731 If you only specify a numeric value it is interpreted in microsecond units.
732 Alternatively, for easier use, you might specify units such as seconds, sec,
733 milliseconds, or msec. (You can also abbreviate this with s or m.)
734 Note: Don't use spaces between the value and the unit! Here are typical examples:
736 Send an infinite number of frames as fast as possible:
738   mausezahn \-c 0  "aa bb cc dd ...."
740 Send 100,000 frames with a 50 msec interval:
742   mausezahn \-c 100000 \-d 50msec "aa bb cc dd ...."
744 Send an unlimited number of BPDU frames in a 2 second interval:
746   mausezahn \-c 0 \-d 2s \-t bpdu conf
748 Note: mausezahn does not support fractional numbers. If you want to specify for
749 example 2.5 seconds then express this in milliseconds (2500 msec).
751 .SS Source and destination addresses:
753 As a mnemonic trick keep in mind that all packets run from "A" to "B". You can
754 always specify source and destination MAC addresses using the \-a and \-b
755 options, respectively. These options also allow keywords such as rand, own,
756 bpdu, cisco, and others.
758 Similarly, you can specify source and destination IP addresses using the \-A
759 and \-B options, respectively. These options also support FQDNs (i.e. domain
760 names) and ranges such as 192.168.0.0/24 or 10.0.0.11-10.0.3.22. Additionally,
761 the source address option supports the rand keyword (ideal for "attacks").
763 Note: When you use the packet builder for IP-based packets (e.g. UDP or TCP)
764 then mausezahn automatically cares about correct MAC and IP addresses (i.e.
765 it performs ARP, DHCP, and DNS for you). But when you specify at least a single
766 link-layer address (or any other L2 option such as a VLAN tag or MPLS header)
767 then ARP is disabled and you must care for the Ethernet destination address for
768 yourself.
770 .SS Layer-2:
772 .SS `-- Direct link access:
774 mausezahn allows you to send ANY chain of bytes directly through your Ethernet
775 interface:
777   mausezahn eth0 "ff:ff:ff:ff:ff:ff ff:ff:ff:ff:ff:ff 00:00 ca:fe:ba:be"
779 This way you can craft every packet you want but you must do it by hand. Note:
780 On Wi-Fi interfaces the header is much more complicated and automatically
781 created by the Wi-Fi driver. As an example to introduce some interesting options,
782 lets continuously send frames at max speed with random source MAC address and
783 broadcast destination address, additionally pad the frame to 1000 bytes:
785   mausezahn eth0 \-c 0 \-a rand \-b bcast \-p 1000 "08 00 aa bb cc dd"
787 The direct link access supports automatic padding using the \-p <total frame
788 length> option. This allows you to pad a raw L2 frame to the desired length.
789 You must specify the total length, and the total frame length must have at
790 least 15 bytes for technical reasons. Zero bytes are used for padding.
792 .SS `-- ARP:
794 mausezahn provides a simple interface to the ARP packet. You can specify the
795 ARP method (request|reply) and up to four arguments: sendermac, targetmac,
796 senderip, targetip, or short smac, tmac, sip, tip. By default, an ARP reply is
797 sent with your own interface addresses as source MAC and IP address, and a
798 broadcast destination MAC and IP address. Send a gratuitous ARP request (as used for
799 duplicate IP address detection):
801   mausezahn eth0 \-t arp
803 ARP cache poisoning:
805   mausezahn eth0 \-t arp "reply, senderip=192.168.0.1, targetmac=00:00:0c:01:02:03, \\
806                           targetip=172.16.1.50"
808  where by default your interface MAC address will be used as sendermac,
809 senderip denotes the spoofed IP address, targetmac and targetip identifies the
810 receiver. By default, the Ethernet source address is your interface MAC and the
811 destination address is the broadcast address. You can change this
812 using the flags \-a and \-b.
814 .SS `-- BPDU:
816 mausezahn provides a simple interface to the 802.1D BPDU frame format (used to
817 create the Spanning Tree in bridged networks). By default, standard IEEE 802.1D
818 BPDUs are sent and it is assumed that your computer wants to become the
819 root bridge (rid=bid). Optionally the 802.3 destination address can be a
820 specified MAC address, broadcast, own MAC, or Cisco's PVST+ MAC address. The
821 destination MAC can be specified using the \-b command which, besides MAC
822 addresses, accepts keywords such as bcast, own, pvst, or stp (default). PVST+
823 is supported as well. Simply specify the VLAN for which you want to send a BPDU:
825   mausezahn eth0 \-t bpdu "vlan=123, rid=2000"
827 See mausezahn \-t bpdu help for more details.
829 .SS `-- CDP:
831 mausezahn can send Cisco Discovery Protocol (CDP) messages since this protocol
832 has security relevance. Of course lots of dirty tricks are possible; for
833 example arbitrary TLVs can be created (using the hex-payload argument for
834 example p=00:0e:00:07:01:01:90) and if you want to stress the CDP database of
835 some device, mausezahn can send each CDP message with another system-id using
836 the change keyword:
838   mausezahn \-t cdp change \-c 0
840 Some routers and switches may run into deep problems ;-) See
841 mausezahn \-t cdp help for more details.
843 .SS `-- 802.1Q VLAN Tags:
845 mausezahn allows simple VLAN tagging for IP (and other higher layer) packets.
846 Simply use the option \-Q <[CoS:]VLAN>, such as \-Q 10 or \-Q 3:921. By
847 default CoS=0. For example send a TCP packet in VLAN 500 using CoS=7:
849   mausezahn eth0 \-t tcp \-Q 7:500 "dp=80, flags=rst, p=aa:aa:aa"
851 You can create as many VLAN tags as you want! This is interesting to create
852 QinQ encapsulations or VLAN hopping: Send a UDP packet with VLAN tags 100
853 (outer) and 651 (inner):
855   mausezahn eth0 \-t udp "dp=8888, sp=13442" \-P "Mausezahn is great" \-Q 100,651
857 Don't know if this is useful anywhere but at least it is possible:
859   mausezahn eth0 \-t udp "dp=8888, sp=13442" \-P "Mausezahn is great"  \\
860                  \-Q 6:5,7:732,5:331,5,6
862 Mix it with MPLS:
864   mausezahn eth0 \-t udp "dp=8888, sp=13442" \-P "Mausezahn is great" \-Q 100,651 \-M 314
866 When in raw Layer 2 mode you must create the VLAN tag completely by yourself.
867 For example if you want to send a frame in VLAN 5 using CoS 0 simply specify
868 81:00 as type field and for the next two bytes the CoS (PCP), DEI (CFI), and
869 VLAN ID values (all together known as TCI):
871   mausezahn eth0 \-b bc \-a rand "81:00 00:05 08:00 aa-aa-aa-aa-aa-aa-aa-aa-aa"
873 .SS `-- MPLS labels:
875 mausezahn allows you to insert one or more MPLS headers. Simply use the option
876 \-M <label:CoS:TTL:BoS> where only the label is mandatory. If you specify a
877 second number it is interpreted as the experimental bits (the CoS usually). If
878 you specify a third number it is interpreted as TTL. By default the TTL is
879 set to 255. The Bottom of Stack flag is set automatically, otherwise the frame
880 would be invalid, but if you want you can also set or unset it using the
881 S (set) and s (unset) argument. Note that the BoS must be the last argument in
882 each MPLS header definition. Here are some examples:
884 Use MPLS label 214:
886   mausezahn eth0 \-M 214 \-t tcp "dp=80" \-P "HTTP..." \-B myhost.com
888 Use three labels (the 214 is now the outer):
890   mausezahn eth0 \-M 9999,51,214 \-t tcp "dp=80" \-P "HTTP..." \-B myhost.com
892 Use two labels, one with CoS=5 and TTL=1, the other with CoS=7:
894   mausezahn eth0 \-M 100:5:1,500:7 \-t tcp "dp=80" \-P "HTTP..." \-B myhost.com
896 Unset the BoS flag (which will result in an invalid frame):
898   mausezahn eth0 \-M 214:s \-t tcp "dp=80" \-P "HTTP..." \-B myhost.com
900 .SS Layer 3-7:
902 IP, UDP, and TCP packets can be padded using the \-p option. Currently 0x42 is
903 used as padding byte ('the answer'). You cannot pad DNS packets (would be
904 useless anyway).
906 .SS `-- IP:
908 mausezahn allows you to send any malformed or correct IP packet. Every field
909 in the IP header can be manipulated. The IP addresses can be specified via
910 the \-A and \-B options, denoting the source and destination address,
911 respectively. You can also specify an address range or a host name (FQDN).
912 Additionally, the source address can also be random. By default the source
913 address is your interface IP address and the destination address is a
914 broadcast address. Here are some examples:
916 ASCII payload:
918   mausezahn eth0 \-t ip \-A rand \-B 192.168.1.0/24  \-P "hello world"
920 Hexadecimal payload:
922   mausezahn eth0 \-t ip \-A 10.1.0.1-10.1.255.254 \-B 255.255.255.255 p=ca:fe:ba:be
924 Will use correct source IP address:
926   mausezahn eth0 \-t ip \-B www.xyz.com
928 The Type of Service (ToS) byte can either be specified directly by two
929 hexadecimal digits, which means you can also easily set the Explicit
930 Congestion Notification (ECN) bits (LSB 1 and 2), or you may only want to
931 specify a common DSCP value (bits 3-8) using a decimal number (0..63):
933 Packet sent with DSCP = Expedited Forwarding (EF):
935   mausezahn eth0 \-t ip dscp=46,ttl=1,proto=1,p=08:00:5a:a2:de:ad:be:af
937 If you leave the checksum as zero (or unspecified) the correct checksum will
938 be automatically computed. Note that you can only use a wrong checksum when
939 you also specify at least one L2 field manually.
941 .SS `-- UDP:
943 mausezahn supports easy UDP datagram generation. Simply specify the
944 destination address (\-B option) and optionally an arbitrary source address
945 (\-A option) and as arguments you may specify the port numbers using the
946 dp (destination port) and sp (source port) arguments and a payload. You can
947 also easily specify a whole port range which will result in sending multiple
948 packets. Here are some examples:
950 Send test packets to the RTP port range:
952   mausezahn eth0 \-B 192.168.1.1 \-t udp "dp=16384-32767, \\
953                    p=A1:00:CC:00:00:AB:CD:EE:EE:DD:DD:00"
955 Send a DNS request as local broadcast (often a local router replies):
957   mausezahn eth0 \-t udp dp=53,p=c5-2f-01-00-00-01-00-00-00-00-00-00-03-77-77-\\
958                                  77-03-78-79-7a-03-63-6f-6d-00-00-01-00-01"
960 Additionally you may specify the length and checksum using the len and sum
961 arguments (will be set correctly by default). Note: several protocols have same
962 arguments such as len (length) and sum (checksum). If you specified a UDP type
963 packet (via \-t udp) and want to modify the IP length, then use the alternate
964 keyword iplen and ipsum. Also note that you must specify at least one L2 field
965 which tells mausezahn to build everything without the help of your kernel (the
966 kernel would not allow modifying the IP checksum and the IP length).
968 .SS `-- ICMP:
970 mausezahn currently only supports the following ICMP methods: PING (echo
971 request), Redirect (various types), Unreachable (various types). Additional
972 ICMP types will be supported in future. Currently you would need to tailor them
973 by yourself, e.g. using the IP packet builder (setting proto=1). Use the
974 mausezahn \-t icmp help for help on currently implemented options.
976 .SS `-- TCP:
978 mausezahn allows you to easily tailor any TCP packet. Similarly as with UDP you
979 can specify source and destination port (ranges) using the sp and dp arguments.
980 Then you can directly specify the desired flags using an "|" as delimiter if
981 you want to specify multiple flags. For example, a SYN-Flood attack against
982 host 1.1.1.1 using a random source IP address and periodically using all 1023
983 well-known ports could be created via:
985   mausezahn eth0 \-A rand \-B 1.1.1.1 \-c 0 \-t tcp "dp=1-1023, flags=syn"  \\
986                  \-P "Good morning! This is a SYN Flood Attack.             \\
987                      We apologize for any inconvenience."
989 Be careful with such SYN floods and only use them for firewall testing. Check
990 your legal position! Remember that a host with an open TCP session only accepts
991 packets with correct socket information (addresses and ports) and a valid TCP
992 sequence number (SQNR). If you want to try a DoS attack by sending a RST-flood
993 and you do NOT know the target's initial SQNR (which is normally the case) then
994 you may want to sweep through a range of sequence numbers:
996   mausezahn eth0 \-A legal.host.com \-B target.host.com \\
997                  \-t tcp "sp=80,dp=80,s=1-4294967295"
999 Fortunately, the SQNR must match the target host's acknowledgement number plus
1000 the announced window size. Since the typical window size is something between
1001 40000 and 65535 you are MUCH quicker when using an increment via the ds argument:
1003   mausezahn eth0 \-A legal.host.com \-B target.host.com \\
1004                  \-t tcp "sp=80, dp=80, s=1-4294967295, ds=40000"
1006 In the latter case mausezahn will only send 107375 packets instead of
1007 4294967295 (which results in a duration of approximately 1 second compared to
1008 11 hours!). Of course you can tailor any TCP packet you like. As with other L4
1009 protocols mausezahn builds a correct IP header but you can additionally access
1010 every field in the IP packet (also in the Ethernet frame).
1012 .SS `-- DNS:
1014 mausezahn supports UDP-based DNS requests or responses. Typically you may want
1015 to send a query or an answer. As usual, you can modify every flag in the header.
1016 Here is an example of a simple query:
1018   mausezahn eth0 \-B mydns-server.com \-t dns "q=www.ibm.com"
1020 You can also create server-type messages:
1022   mausezahn eth0 \-A spoofed.dns-server.com \-B target.host.com \\
1023                  "q=www.topsecret.com, a=172.16.1.1"
1025 The syntax according to the online help (\-t dns help) is:
1027   query|q = <name>[:<type>]  ............. where type is per default "A"
1028                                            (and class is always "IN")
1029   answer|a = [<type>:<ttl>:]<rdata> ...... ttl is per default 0.
1030            = [<type>:<ttl>:]<rdata>/[<type>:<ttl>:]<rdata>/...
1032 Note: If you only use the 'query' option then a query is sent. If you
1033 additionally add an 'answer' then an answer is sent. Examples:
1035   q = www.xyz.com
1036   q = www.xyz.com, a=192.168.1.10
1037   q = www.xyz.com, a=A:3600:192.168.1.10
1038   q = www.xyz.com, a=CNAME:3600:abc.com/A:3600:192.168.1.10
1040 Please try out mausezahn \-t dns help to see the many other optional command
1041 line options.
1043 .SS `-- RTP and VoIP path measurements:
1045 mausezahn can send arbitrary Real Time Protocol (RTP) packets. By default a
1046 classical G.711 codec packet of 20 ms segment size and 160 bytes is assumed. You
1047 can measure jitter, packet loss, and reordering along a path between two hosts
1048 running mausezahn. The jitter measurement is either done following the variance
1049 low-pass filtered estimation specified in RFC 3550 or using an alternative
1050 "real-time" method which is even more precise (the RFC-method is used by
1051 default). For example on Host1 you start a transmission process:
1053   mausezahn \-t rtp \-B 192.168.1.19
1055 And on Host2 (192.168.1.19) a receiving process which performs the measurement:
1057   mausezahn \-T rtp
1059 Note that the option flag with the capital "T" means that it is a server RTP
1060 process, waiting for incoming RTP packets from any mausezahn source. In case
1061 you want to restrict the measurement to a specific source or you want to
1062 perform a bidirectional measurement, you must specify a stream identifier.
1063 Here is an example for bidirectional measurements which logs the running
1064 jitter average in a file:
1066   Host1# mausezahn \-t rtp id=11:11:11:11 \-B 192.168.2.2 &
1067   Host1# mausezahn \-T rtp id=22:22:22:22 "log, path=/tmp/mz/"
1069   Host2# mausezahn \-t rtp id=22:22:22:22 \-B 192.168.1.1 &
1070   Host2# mausezahn \-T rtp id=11:11:11:11 "log, path=/tmp/mz/"
1072 In any case the measurements are printed continuously onto the screen; by
1073 default it looks like this:
1075   0.00                     0.19                      0.38                      0.57
1076   |-------------------------|-------------------------|-------------------------|
1077   #########                                                                      0.07 msec
1078   ####################                                                           0.14 msec
1079   ##                                                                             0.02 msec
1080   ###                                                                            0.02 msec
1081   #########                                                                      0.07 msec
1082   ####                                                                           0.03 msec
1083   #########                                                                      0.07 msec
1084   #############                                                                  0.10 msec
1085   ##                                                                             0.02 msec
1086   ###########################################                                    0.31 msec
1087   #########                                                                      0.07 msec
1088   ##############################################                                 0.33 msec
1089   ###############                                                                0.11 msec
1090   ##########                                                                     0.07 msec
1091   ###############                                                                0.11 msec
1092   ##########################################################                     0.42 msec
1093   #####                                                                          0.04 msec
1095 More information is shown using the txt keyword:
1097   mausezahn \-T rtp txt
1098   Got 100 packets from host 192.168.0.3: 0 lost (0 absolute lost), 1 out of order
1099     Jitter_RFC (low pass filtered) = 30 usec
1100     Samples jitter (min/avg/max)   = 1/186/2527 usec
1101     Delta-RX (min/avg/max)         = 2010/20167/24805 usec
1102   Got 100 packets from host 192.168.0.3: 0 lost (0 absolute lost), 1 out of order
1103     Jitter_RFC (low pass filtered) = 17 usec
1104     Samples jitter (min/avg/max)   = 1/53/192 usec
1105     Delta-RX (min/avg/max)         = 20001/20376/20574 usec
1106   Got 100 packets from host 192.168.0.3: 0 lost (0 absolute lost), 1 out of order
1107     Jitter_RFC (low pass filtered) = 120 usec
1108     Samples jitter (min/avg/max)   = 0/91/1683 usec
1109     Delta-RX (min/avg/max)         = 18673/20378/24822 usec
1111 See mausezahn \-t rtp help and mz \-T rtp help for more details.
1113 .SS `-- Syslog:
1115 The traditional Syslog protocol is widely used even in professional networks
1116 and is sometimes vulnerable. For example you might insert forged Syslog
1117 messages by spoofing your source address (e.g. impersonate the address of a
1118 legit network device):
1120   mausezahn \-t syslog sev=3 \-P "You have been mausezahned." \-A 10.1.1.109 \-B 192.168.7.7
1122 See mausezahn \-t syslog help for more details.
1124 .SH NOTE
1126 When multiple ranges are specified, e.g. destination port ranges and
1127 destination address ranges, then all possible combinations of ports and
1128 addresses are used for packet generation. Furthermore, this can be mixed with
1129 other ranges e.g. a TCP sequence number range. Note that combining ranges
1130 can lead to a very huge number of frames to be sent. As a rule of thumb you
1131 can assume that about 100,000 frames and more are sent in a fraction of one
1132 second, depending on your network interface.
1134 mausezahn has been designed as a fast traffic generator so you might easily
1135 overwhelm a LAN segment with myriads of packets. And because mausezahn could
1136 also support security audits it is possible to create malicious or invalid
1137 packets, SYN floods, port and address sweeps, DNS and ARP poisoning, etc.
1139 Therefore, don't use this tool when you are not aware of the possible
1140 consequences or have only a little knowledge about networks and data
1141 communication. If you abuse mausezahn for 'unallowed' attacks and get caught,
1142 or damage something of your own, then this is completely your fault. So the
1143 safest solution is to try it out in a lab environment.
1145 Also have a look at the netsniff-ng(8) note section on how you can properly
1146 setup and tune your system.
1148 .SH LEGAL
1149 mausezahn is licensed under the GNU GPL version 2.0.
1151 .SH HISTORY
1152 .B mausezahn
1153 was originally written by Herbert Haas. According to his website [1], he
1154 unfortunately passed away in 2011 thus leaving this tool unmaintained.
1155 It has been adopted and integrated into the netsniff-ng toolkit and is further
1156 being maintained and developed from there. Maintainers are Tobias Klauser
1157 <tklauser@distanz.ch> and Daniel Borkmann <dborkma@tik.ee.ethz.ch>.
1159   [1] http://www.perihel.at/
1161 .SH SEE ALSO
1162 .BR netsniff-ng (8),
1163 .BR trafgen (8),
1164 .BR ifpps (8),
1165 .BR bpfc (8),
1166 .BR flowtop (8),
1167 .BR astraceroute (8),
1168 .BR curvetun (8)
1170 .SH AUTHOR
1171 Manpage was written by Herbert Haas and modified by Daniel Borkmann.
1173 .SH COLOPHON
1174 This page is part of the Linux netsniff-ng toolkit project. A description of the project,
1175 and information about reporting bugs, can be found at http://netsniff-ng.org/.