dumbnet is a simple test program for the dumbnet(3) library. It can be used to compose and transmit
network datagrams as a Unix-style filter (e.g. reading from or writing to files and pipes) or modify the
local system network configuration (including the ARP cache, firewall ruleset, network interfaces, and
routing table).
Payloadgenerationcommandsaddraddress [...]
Convert the address (specified as a hostname, IP address, or MAC address) into its binary
representation on standard output.
hexstring [...]
Convert the C-style escaped string (shellcode, for instance) into its binary representation on
standard output.
randlen
Write len random bytes to standard output.
Packetencapsulationcommandseth [typetype] [srcmac] [dstmac]
Prepend the data read from standard input with an Ethernet header on standard output. The Ethernet
type may be specified as ‘arp’, ‘ip’, or as a hex, octal, or decimal number.
arp [opop] [shamac] [spahost] [thamac] [tpahost]
Prepend the data read from standard input with an ARP header on standard output. The ARP op may be
specified as ‘req’, ‘rep’, ‘revreq’, ‘revrep’, or as a hex, octal, or decimal number.
ip [tosnum] [idnum] [offoffset] [ttlnum] [protoprotocol] [srchost] [dstdst]
Prepend the data read from standard input with an IP header on standard output. The fragmentation
offset may be specified as a decimal number (optionally concatenated with ‘+’ to indicate more
fragments) or as a hex number. The protocol may be specified by name, or as a hex, octal, or decimal
number.
icmp [typenum] [codenum]
Prepend the data read from standard input with an ICMP header on standard output.
tcp [sportport] [dportport] [flagsflags] [seqnum] [acknum] [winnum] [urpnum]
Prepend the data read from standard input with a TCP header on standard output. A port may be
specified by name or hex, octal, or decimal number. The TCP flags may be specified as some
combination of the characters in the set ‘SAFRPU’ or as a hex number.
udp [sportport] [dportport]
Prepend the data read from standard input with a UDP header on standard output. A port may be
specified by name or hex, octal, or decimal number.
Packettransmissioncommandssend [device]
Read a packet from standard input and send it over the network. If no device is specified, the
packet is assumed to be an IP datagram and routed to its destination. Otherwise, the packet is
assumed to be an Ethernet frame and is transmitted on the specified interface.
Kernelinterfacecommandsarpshow
Display the kernel ARP cache.
arpgethost
Display the kernel ARP entry for host.
arpaddhostmac
Add an ARP entry mapping the mac address for host.
arpdeletehost
Delete the ARP entry for host.
fwshow
Display the kernel firewall ruleset.
fwadd|deleteactiondirectiondeviceprotocolsrc[:port[-max]] dst[:port[-max]] [type[/code]]
Add a rule to or delete a rule from the active firewall ruleset. The action must be either ‘allow’
or ‘block’. The direction must be either ‘in’ or ‘out’. The device may specify an interface name,
or ‘any’. The protocol may be specified by name, or as a decimal number. For TCP and UDP protocols,
a port (or range, if specified with a max value) may be specified in decimal and appended to the
source and/or destination address. For ICMP, a type (and optional code) may be specified in decimal.
intfshow
Display the configuration of all network interfaces.
intfgetdevice
Display the configuration for the interface specified by device.
intfsetdevice [aliashost] [dsthost] [inethost] [linkmac] [up|down] [arp|noarp]
Configure the interface specified by device.
routeshow
Display the kernel routing table.
routegetdst
Display the route for the destination dst, specified as a hostname, IP address, or network prefix in
CIDR notation.
routeadddstgw
Add a route for the destination dst through the gateway gw.
routedeletedst
Delete the route for the destination dst.