RANDPKT(1)
π RANDPKT β random packet generator, she's a chaos gremlin and we love her π
Okay so real quick β this whole page is from the randpkt(1) manual, bestie. It's a tiny little Unix utility that just... makes garbage packets on purpose. Iconic behavior honestly.
β¨ SYNOPSIS β¨
randpkt [ -b <maxbytes> ] [ -c <count> ] [ -F <file format> ] [ -r ]
[ -t <type> ] <filename>
randpkt -h|--help
randpkt -v|--version
Like, that's the whole vibe. You give her a <filename> and some flags and she goes off. π
π DESCRIPTION π
Okay so randpkt is a small utility that creates a trace file full of random packets. Literally just chaos in a file.
And why would you want that? Because by creating many randomized packets of a certain type, you can test packet sniffers to see how well they handle malformed packets. Think of it as a vibe check for your sniffer π₯ β the sniffer can never trust the data that it sees in the packet, because you can always sniff a very bad packet that doesn't conform to any standard. And randpkt? She produces very bad packets. On purpose. That's her whole thing. Periodt. π
Here's the trick, though: when creating packets of a certain type, randpkt uses a sample packet that is stored internally to randpkt. She uses this as the starting point for your random packets, and then adds extra random bytes to the end of this sample packet. So it's like... structured chaos. Main character energy. πΈ
For example, if you choose to create random ARP packets, randpkt 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. Chef's kiss. π«Ά
π¦ OPTIONS π¦
-b <maxbytes>β default5000, bestie. This defines the maximum number of bytes added to the sample packet. Here's the important part: if you choose amaxbytesvalue that is less than the size of the sample packet, then your packets would contain only the sample packet... not much variance there! Andrandpktexits on that condition. So don't do that. π-c <count>β default1000. Defines the number of packets to generate. Simple as that. β¨-F <file format>β defaultpcapng. Sets the file format of the output capture file.randpktcan write the file in several formats;randpkt -Fprovides a list of the available output formats. Heads up though β note that not all output formats support all packet types. F in the chat for the combos that just don't work π-h|--helpβ Print the version number and options and exit. Your classic "help me bestie" flag. π-rβ The packet type is determined randomly for each packet. This requires an output format that can support different encapsulations per packet, likepcapng. So if you want maximum chaos β random type per packet β this is the slay. π₯-t <type>β default is an Ethernet II frame. Defines the type of packet to generate, and here's the full menu:arpβ Address Resolution Protocolbgpβ Border Gateway Protocolbvlcβ BACnet Virtual Link Controldnsβ Domain Name Serviceethβ Ethernetfddiβ Fiber Distributed Data Interfacegiopβ General Inter-ORB Protocolicmpβ Internet Control Message Protocolipβ Internet Protocolipv6β Internet Protocol Version 6llcβ Logical Link Controlm2mβ WiMAX M2M Encapsulation Protocolmegacoβ MEGACOnbnsβ NetBIOS-over-TCP Name Servicencp2222β NetWare Core Protocolsctpβ Stream Control Transmission Protocolsyslogβ Syslog messagetdsβ TDS NetLibtcpβ Transmission Control Protocoltrβ Token-Ringudpβ User Datagram Protocolusbβ Universal Serial Bususb-linuxβ Universal Serial Bus with Linux specific header
Obsessed with this list ngl. π
-v|--versionβ Print the full version information and exit. Gotta know which version ate. π
π DIAGNOSTIC OPTIONS π
These are the log-gremlin options, iykyk. π§
--log-level <level>β 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. π--log-fatal <level>β 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. Dramatic but valid. π--log-fatal-count <count>β The amount of fatal log messages which may pass before the program is aborted. Like a little grace period. π--log-domains <list>β 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). β--log-debug <list>β 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). π¦--log-noisy <list>β 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). π£--log-fatal-domains <list>β Abort the program if any messages are logged for the specified log domains. List of domains must be comma-separated. No negation here, just vibes. π--log-file <path>β Write log messages andstderroutput to the specified file. Everything into one file, neat and tidy. β¨
πΈ EXAMPLES πΈ
Bestie, let's actually do stuff.
To see a description of the randpkt options use:
randpkt
To generate a capture file with 1000 DNS packets use:
randpkt -b 500 -t dns rand_dns.pcapng
To generate a small capture file with just a single LLC frame use:
randpkt -b 100 -c 1 -t llc single_llc.pcapng
Literally so easy. Go forth and generate bad packets. π₯
π SEE ALSO π
pcap(3), editcap(1) β go read those too, they're part of the family. π
Ok that's the whole page, no cap. Every flag, every default, every domain, every byte count β it's all up there. π«Ά
Signing off with love: this was the RANDPKT(1) manual page, and the date on her little name tag says 2026-10-08. Mwah. ππ
π¦ where this page comes from
- arch rolling: wireshark-cli 4.7.4-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms