DNET(8) | System Manager's Manual | DNET(8) |
dumbnet
— dumb
networking library test program
dumbnet command
args [...] |
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).
addr
address [...]hex
string [...]rand
leneth
[type
type] [src
mac] [dst
mac]arp
’,
‘ip
’, or as a hex, octal, or decimal
number.arp
[op
op] [sha
mac] [spa
host] [tha
mac] [tpa
host]req
’,
‘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]+
’ 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
[type
num] [code
num]tcp
[sport
port] [dport
port] [flags
flags] [seq
num] [ack
num] [win
num] [urp
num]SAFRPU
’ or as a hex number.udp
[sport
port] [dport
port]send
[device]arp show
arp get
hostarp add
host
macarp delete
hostfw show
fw add
|delete
action direction
device protocol
src[:port[-max]]
dst[:port[-max]]
[type[/code]]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.intf show
intf get
deviceintf set
device
[alias
host]
[dst
host]
[inet
host]
[link
mac]
[up
|down
]
[arp
|noarp
]route show
route get
dstroute add
dst
gwroute delete
dstSend 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
The library was originally named dnet but was renamed to dumbnet due to a conflict with the DECnet library. This decision affects not only the filename of the shared library, but also the header file names and the library's SONAME tag, which means that 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.
Dug Song ⟨dugsong@monkey.org⟩
Oliver Falk ⟨oliver@linux-kernel.at⟩
October 17, 2001 | Debian |