'\" t .\" Title: randpkt .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-05 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "RANDPKT" "1" "2024-01-05" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" randpkt \- Random packet generator .SH "SYNOPSIS" .sp \fBrandpkt\fP [\~\fB\-b\fP\~\~] [\~\fB\-c\fP\~\~] [\~\fB\-F\fP\~\~] [\~\fB\-r\fP\~] [\~\fB\-t\fP\~\~] .sp \fBrandpkt\fP \fB\-h|\-\-help\fP .sp \fBrandpkt\fP \fB\-v|\-\-version\fP .SH "DESCRIPTION" .sp \fBrandpkt\fP is a small utility that creates a trace file full of random packets. .sp By creating many randomized packets of a certain type, you can test packet sniffers to see how well they handle malformed packets. The sniffer can never trust the data that it sees in the packet because you can always sniff a very bad packet that conforms to no standard. \fBrandpkt\fP produces \fIvery bad\fP packets. .sp When creating packets of a certain type, \fBrandpkt\fP uses a sample packet that is stored internally to \fBrandpkt\fP. It uses this as the starting point for your random packets, and then adds extra random bytes to the end of this sample packet. .sp For example, if you choose to create random ARP packets, \fBrandpkt\fP will create a packet which contains a predetermined Ethernet II header, with the Type field set to ARP. After the Ethernet II header, it will put a random number of bytes with random values. .SH "OPTIONS" .sp \-b .RS 4 .sp Default 5000. .sp Defines the maximum number of bytes added to the sample packet. If you choose a \fBmaxbytes\fP value that is less than the size of the sample packet, then your packets would contain only the sample packet... not much variance there! \fBrandpkt\fP exits on that condition. .RE .sp \-c .RS 4 .sp Default 1000. .sp Defines the number of packets to generate. .RE .sp \-F .RS 4 .sp Default \fBpcapng\fP. .sp Sets the file format of the output capture file. \fBrandpkt\fP can write the file in several formats; \fBrandpkt \-F\fP provides a list of the available output formats. Note that not all output formats support all packet types. .RE .sp \-h|\-\-help .RS 4 Print the version number and options and exit. .RE .sp \-r .RS 4 .sp The packet type is determined randomly for each packet. This requires an output format that can support different encapsulations per packet, like \fBpcapng\fP. .RE .sp \-t .RS 4 .sp Default Ethernet II frame. .sp Defines the type of packet to generate: .sp .if n .RS 4 .nf .fam C arp Address Resolution Protocol bgp Border Gateway Protocol bvlc BACnet Virtual Link Control dns Domain Name Service eth Ethernet fddi Fiber Distributed Data Interface giop General Inter\-ORB Protocol icmp Internet Control Message Protocol ip Internet Protocol ipv6 Internet Protocol Version 6 llc Logical Link Control m2m WiMAX M2M Encapsulation Protocol megaco MEGACO nbns NetBIOS\-over\-TCP Name Service ncp2222 NetWare Core Protocol sctp Stream Control Transmission Protocol syslog Syslog message tds TDS NetLib tcp Transmission Control Protocol tr Token\-Ring udp User Datagram Protocol usb Universal Serial Bus usb\-linux Universal Serial Bus with Linux specific header .fam .fi .if n .RE .RE .sp \-v|\-\-version .RS 4 Print the full version information and exit. .RE .SH "DIAGNOSTIC OPTIONS" .sp \-\-log\-level .RS 4 Set the active log level. Supported levels in lowest to highest order are "noisy", "debug", "info", "message", "warning", "critical", and "error". Messages at each level and higher will be printed, for example "warning" prints "warning", "critical", and "error" messages and "noisy" prints all messages. Levels are case insensitive. .RE .sp \-\-log\-fatal .RS 4 Abort the program if any messages are logged at the specified level or higher. For example, "warning" aborts on any "warning", "critical", or "error" messages. .RE .sp \-\-log\-domains .RS 4 Only print messages for the specified log domains, e.g. "GUI,Epan,sshdump". List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-debug .RS 4 Force the specified domains to log at the "debug" level. List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-noisy .RS 4 Force the specified domains to log at the "noisy" level. List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-fatal\-domains .RS 4 Abort the program if any messages are logged for the specified log domains. List of domains must be comma\-separated. .RE .sp \-\-log\-file .RS 4 Write log messages and stderr output to the specified file. .RE .SH "EXAMPLES" .sp To see a description of the randpkt options use: .sp .if n .RS 4 .nf .fam C randpkt .fam .fi .if n .RE .sp To generate a capture file with 1000 DNS packets use: .sp .if n .RS 4 .nf .fam C randpkt \-b 500 \-t dns rand_dns.pcapng .fam .fi .if n .RE .sp To generate a small capture file with just a single LLC frame use: .sp .if n .RS 4 .nf .fam C randpkt \-b 100 \-c 1 \-t llc single_llc.pcapng .fam .fi .if n .RE .SH "SEE ALSO" .sp pcap(3), editcap(1)