DNET(8)
β¨ DNET(8) β¨
okay bestie, welcome to the DNET(8) glow-up π
this one lives in the System Manager's Manual section and it's basically the lil test-driver bestie for the whole dumbnet universe. let's get into it π«Ά
π NAME π
dumbnet β the dumb networking library test program π
π SYNOPSIS π
dumbnet command args [...]
πΈ DESCRIPTION πΈ
so dumbnet is a simple test program for the dumbnet(3) library. you can use it to compose and transmit network datagrams as a Unix-style filter β think reading from or writing to files and pipes, the classic glow β¨ β or to modify the local system network configuration, which includes the ARP cache, the firewall ruleset, network interfaces, and the routing table. it's giving "one binary, so many side quests" π
π« Payload generation commands π«
addr address [...]β turns the address (which you can hand it as a hostname, an IP address, or a MAC address) into its binary representation on standard output π¦hex string [...]β turns the C-style escaped string (shellcode, for instance π) into its binary representation on standard outputrand lenβ writeslenrandom bytes to standard output, no thoughts, just entropy π²
π§ Packet encapsulation commands π§
eth [type type] [src mac] [dst mac]β prepends the data read from standard input with an Ethernet header on standard output. the Ethernet type can be given asarp,ip, or as a hex, octal, or decimal number β¨arp [op op] [sha mac] [spa host] [tha mac] [tpa host]β prepends the data read from standard input with an ARP header on standard output. the ARP op can be given asreq,rep,revreq,revrep, or as a hex, octal, or decimal number πip [tos num] [id num] [off offset] [ttl num] [proto protocol] [src host] [dst dst]β prepends the data read from standard input with an IP header on standard output. the fragmentation offset can be given as a decimal number (optionally concatenated with+to indicate more fragments) or as a hex number. the protocol can be given by name, or as a hex, octal, or decimal number π₯icmp [type num] [code num]β prepends the data read from standard input with an ICMP header on standard output πtcp [sport port] [dport port] [flags flags] [seq num] [ack num] [win num] [urp num]β prepends the data read from standard input with a TCP header on standard output. a port can be given by name or as a hex, octal, or decimal number. the TCP flags can be given as some combination of the characters in the setSAFRPU, or as a hex number πudp [sport port] [dport port]β prepends the data read from standard input with a UDP header on standard output. a port can be given by name or as a hex, octal, or decimal number π
π Packet transmission commands π
send [device]β reads a packet from standard input and sends it over the network. if you don't specify a device, the packet is assumed to be an IP datagram and gets routed to its destination. if you do specify a device, the packet is assumed to be an Ethernet frame and is transmitted on that interface. choose your fighter π
π Kernel interface commands π
arp showβ displays the kernel ARP cachearp get hostβ displays the kernel ARP entry for hostarp add host macβ adds an ARP entry mapping the mac address for hostarp delete hostβ deletes the ARP entry for hostfw showβ displays the kernel firewall rulesetfw add|delete action direction device protocol src[:port[-max]] dst[:port[-max]] [type[/code]]β adds a rule to, or deletes a rule from, the active firewall ruleset. the action must be eitheralloworblock. the direction must be eitherinorout. the device can be an interface name, orany. the protocol can be given by name, or as a decimal number. for TCP and UDP protocols, a port (or a range, if you specify it with a max value) can be given in decimal and appended to the source and/or destination address. for ICMP, a type (and an optional code) can be given in decimal. it's giving very "build your own firewall, main character energy" β¨intf showβ displays the configuration of all network interfacesintf get deviceβ displays the configuration for the interface specified by deviceintf set device [alias host] [dst host] [inet host] [link mac] [up|down] [arp|noarp]β configures the interface specified by deviceroute showβ displays the kernel routing tableroute get dstβ displays the route for the destination dst, given as a hostname, an IP address, or a network prefix in CIDR notationroute add dst gwβ adds a route for the destination dst through the gateway gwroute delete dstβ deletes the route for the destination dst
π EXAMPLES π
send a UDP datagram containing random shellcode:
dumbnet hex "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89" \
"\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80" \
"\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh" | \
dumbnet udp sport 555 dport 666 | \
dumbnet ip proto udp src 1.2.3.4 dst 5.6.7.8 | dumbnet send
save an ARP request in a file and send it twice:
dumbnet arp op req sha 0:d:e:a:d:0 spa 10.0.0.3 tpa 10.0.0.4 | \
dumbnet eth type arp src 0:d:e:a:d:0 dst ff:ff:ff:ff:ff:ff > arp.pkt
dumbnet send fxp0 < arp.pkt
dumbnet send fxp0 < arp.pkt
send a fragmented ping packet:
# Create ping packet with IP header, to set ICMP checksum
echo "monkey monkey monkey monkey" | dumbnet icmp type 8 code 0 | \
dumbnet ip proto icmp src 1.2.3.4 dst 5.6.7.8 > ping.pkt
# Chop off IP header
dd if=ping.pkt of=ping.data bs=20 skip=1
# Fragment IP payload
split -b 24 ping.data p.
# Send fragments
dumbnet ip id 1 off 0+ proto icmp src 1.2.3.4 dst 5.6.7.8 < p.aa | \
dumbnet send
dumbnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 < p.ab | \
dumbnet send
β οΈ COMPATIBILITY β οΈ
okay so listen, this is the drama tea β the library was originally named dnet but got renamed to dumbnet because of a conflict with the DECnet library. and bestie, that decision is not small β it affects not only the filename of the shared library, but also the header file names and the library's SONAME tag. which means: software built on a non-Debian-derived distribution will not run with this library, and recompiling the software will only work if some adjustments to header include directives and compiler/linker flags are made. so yeah, heads up π
π SEE ALSO π
π«Ά AUTHORS π«Ά
- Dug Song β¨
dugsong@monkey.orgβ© - Oliver Falk β¨
oliver@linux-kernel.atβ©
and that's the whole vibe check, bestie π this lil Debian release dates all the way back to October 17, 2001 β vintage, iconic, no cap πΈ go forth and packet-sling responsibly β¨
π¦ where this page comes from
- debian bookworm: libdumbnet-dev 1.16.3-1 Β· BSD-3-Clause
- debian trixie: libdumbnet-dev 1.18.0-2 Β· BSD-3-Clause
- ubuntu noble: libdumbnet-dev 1.17.0-1ubuntu2 Β· BSD-3-Clause
- ubuntu questing: libdumbnet-dev 1.18.0-2
- ubuntu resolute: libdumbnet-dev 1.18.2-1 Β· BSD-3-Clause
- ubuntu stonking: libdumbnet-dev 1.18.2-1 Β· BSD-3-Clause
- Copyright (c) 2001 Dug Song <dugsong@monkey.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms