A utility for sending arbitrary packets.
$ packet-sender --help
Send packets
Usage: packet-sender [-i|--intf INTF] [-v|--verbose] [-n|--dry-run] COMMAND
Available options:
-h,--help Show this help text
-i,--intf INTF Network interface to send on (default: "lo")
-v,--verbose Print the packet contents to stdout before sending
-n,--dry-run Don't actually send the packet, just print it
Available commands:
ether Send ethernet packet
raw Raw payload
Raw packet data can be specified with simple expressions.
$ packets-sender -n raw 0123456789abcde
Length: 8 (0x8) bytes
0000: 01 23 45 67 89 ab cd ef .#Eg....
$ packet-sender -n raw "64 * aa"
Length: 64 (0x40) bytes
0000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0010: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0020: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0030: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
$ packet-sender -n raw "16#d12345678"
Length: 16 (0x10) bytes
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 bc 61 4e ..............aN
$ packet-sender -n raw "'abcdefghijkl'"
Length: 12 (0xc) bytes
0000: 61 62 63 64 65 66 67 68 69 6a 6b 6c abcdefghijkl
Concatenation has precedence over *
$ packet-sender -n raw "'abcdefghijkl' 5 * (2#d10 abab)"
Length: 32 (0x20) bytes
0000: 61 62 63 64 65 66 67 68 69 6a 6b 6c 00 0a ab ab abcdefghijkl....
0010: 00 0a ab ab 00 0a ab ab 00 0a ab ab 00 0a ab ab ................
$ packet-sender -n ether -s aa:aa:aa:aa:aa:aa ip -s 12.12.12.12 -l 28 udp -l 8 "'aaaaaa'"
Length: 48 (0x30) bytes
0000: ff ff ff ff ff ff aa aa aa aa aa aa 08 00 45 00 ..............E.
0010: 00 1c 00 00 00 00 00 11 00 00 0c 0c 0c 0c 7f 00 ................
0020: 00 01 00 00 00 00 00 08 00 00 61 61 61 61 61 61 ..........aaaaaa