1237N/A .\" Copyright (c) 2001 Dug Song <dugsong@monkey.org>
1237N/A-is a simple test program for the
5005N/A+.TH "DNET" "8" "October 21, 2015" "SunOS 5.12" "System Manager's Manual"
1237N/A+\- dumb networking library test program
1237N/A+\fBdnet \fIcommand\fP \fIargs\fP [...]\fP
1237N/A+is a simple test program for the
1237N/A library. It can be used to compose and transmit network datagrams as a
1237N/A Unix-style filter (
e.g. reading from or writing to files and pipes) or
1237N/A modify the local system network configuration (including the ARP
1237N/A cache, firewall ruleset, network interfaces, and routing table).
1237N/A+.SS "Payload generation commands"
1237N/A+\fBaddr\fP \fIaddress\fP [...]
1237N/A (specified as a hostname, IP address, or MAC address)
1237N/A into its binary representation on standard output.
1237N/A+\fBhex\fP \fIstring\fP [...]
1237N/A Convert the C-style escaped
1237N/A-(shellcode, for instance) into its binary representation on standard output.
1237N/A+(shellcode, for instance) into its binary representation on standard output.
1237N/A random bytes to standard output.
1237N/A+.SS "Packet encapsulation commands"
1237N/A Prepend the data read from standard input with an Ethernet header on
1237N/A standard output. The Ethernet
1237N/A or as a hex, octal, or decimal number.
1237N/A Prepend the data read from standard input with an ARP header on
1237N/A or as a hex, octal, or decimal number.
1237N/A+[\fBproto\fP \fIprotocol\fP]
1237N/A Prepend the data read from standard input with an IP header on
1237N/A standard output. The fragmentation
1237N/A-may be specified as a decimal number (optionally concatenated with
1237N/A-to indicate more fragments) or as a hex number. The
1237N/A+may be specified as a decimal number (optionally concatenated with
1237N/A+to indicate more fragments) or as a hex number. The
1237N/A may be specified by name, or as a hex, octal, or decimal number.
1237N/A Prepend the data read from standard input with an ICMP header on
1237N/A Prepend the data read from standard input with a TCP header on
1237N/A-may be specified by name or hex, octal, or decimal number. The TCP
1237N/A+may be specified by name or hex, octal, or decimal number. The TCP
1237N/A may be specified as some combination of the characters in the set
1237N/A Prepend the data read from standard input with a UDP header on
1237N/A may be specified by name or hex, octal, or decimal number.
1237N/A+.SS "Packet transmission commands"
1237N/A Read a packet from standard input and send it over the network. If no
1237N/A is specified, the packet is assumed to be an IP datagram and routed
1237N/A to its destination. Otherwise, the packet is assumed to be an Ethernet
1237N/A frame and is transmitted on the specified interface.
1237N/A+.SS "Kernel interface commands"
1237N/A Display the kernel ARP cache.
1237N/A Display the kernel ARP entry for
1237N/A+\fBarp add\fP \fIhost\fP \fImac\fP
1237N/A Add an ARP entry mapping the
1237N/A+\fBarp delete\fP \fIhost\fP
1237N/A Display the kernel firewall ruleset.
1237N/A+\fBfw add\fP\&|\fBdelete\fP
1237N/A+\fIaction\fP \fIdirection\fP \fIdevice\fP
1237N/A+\fIsrc\fP[\&:\fIport[-max]\fP]
1237N/A+\fIdst\fP[\&:\fIport[-max]\fP]
1237N/A Add a rule to or delete a rule from the active firewall ruleset. The
1237N/A The direction must be either
1237N/A-may specify an interface name, or
1237N/A+may specify an interface name, or
1237N/A may be specified by name, or as a decimal number. For TCP and
1237N/A (or range, if specified with a
1237N/A value) may be specified in decimal and appended to the source
and/or 1237N/A destination address. For ICMP, a
1237N/A may be specified in decimal.
1237N/A Display the configuration of all network interfaces.
1237N/A+\fBintf get\fP \fIdevice\fP
1237N/A Display the configuration for the interface specified by
1237N/A Configure the interface specified by
1237N/A Display the kernel routing table.
1237N/A Display the route for the destination
1237N/A specified as a hostname, IP address, or network prefix in CIDR notation.
1237N/A+\fBroute add\fP \fIdst\fP \fIgw\fP
1237N/A Add a route for the destination
1237N/A+\fBroute delete\fP \fIdst\fP
1237N/A Delete the route for the destination
1237N/A Send a UDP datagram containing random shellcode:
1237N/A dnet hex "\\xeb\\x1f\\x5e\\x89\\x76\\x08\\x31\\xc0\\x88\\x46\\x07\\x89" \\
1237N/A "\\x46\\x0c\\xb0\\x0b\\x89\\xf3\\x8d\\x4e\\x08\\x8d\\x56\\x0c\\xcd\\x80" \\
1237N/A dnet udp sport 555 dport 666 | \\
1237N/A dnet ip proto udp src 1.2.3.4 dst 5.6.7.8 | dnet send
1237N/A Save an ARP request in a file and send it twice:
1237N/A dnet arp op req sha 0:d:e:a:d:0 spa 10.0.0.3 tpa 10.0.0.4 | \\
1237N/A dnet eth type arp src 0:d:e:a:d:0 dst ff:ff:ff:ff:ff:ff >
arp.pkt 1237N/A Send a fragmented ping packet:
1237N/A # Create ping packet with IP header, to set ICMP checksum
1237N/A echo "monkey monkey monkey monkey" | dnet icmp type 8 code 0 | \\
1237N/A dnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 <
p.ab | \\