1237N/A--- libdnet-1.12/test/dnet/dnet.8.orig 2012-05-23 08:30:25.629791399 -0700
1237N/A+++ libdnet-1.12/test/dnet/dnet.8 2012-05-23 08:47:33.464415318 -0700
1237N/A@@ -2,240 +2,235 @@
1237N/A .\"
1237N/A .\" Copyright (c) 2001 Dug Song <dugsong@monkey.org>
1237N/A .\"
1237N/A-.Dd October 17, 2001
1237N/A-.Dt DNET 8
1237N/A-.Os
1237N/A-.Sh NAME
1237N/A-.Nm dnet
1237N/A-.Nd dumb networking library test program
1237N/A-.Sh SYNOPSIS
1237N/A-.Nm dnet Ar command Ar args Op ...
1237N/A-.Sh DESCRIPTION
1237N/A-.Nm
1237N/A-is a simple test program for the
1237N/A-.Xr dnet 3
5005N/A+.TH "DNET" "8" "October 21, 2015" "SunOS 5.12" "System Manager's Manual"
1237N/A+.SH "NAME"
1237N/A+\fBdnet\fP
1237N/A+\- dumb networking library test program
1237N/A+.SH "SYNOPSIS"
1237N/A+\fBdnet \fIcommand\fP \fIargs\fP [...]\fP
1237N/A+.SH "DESCRIPTION"
1237N/A+\fBdnet\fP
1237N/A+is a simple test program for the
1237N/A+dnet(3)
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-.Pp
1237N/A-.Ss Payload generation commands
1237N/A-.Bl -tag -width "foo"
1237N/A-.It Nm addr Ar address Op ...
1237N/A-Convert the
1237N/A-.Ar address
1237N/A+.PP
1237N/A+.SS "Payload generation commands"
1237N/A+.TP foo
1237N/A+\fBaddr\fP \fIaddress\fP [...]
1237N/A+Convert the
1237N/A+\fIaddress\fP
1237N/A (specified as a hostname, IP address, or MAC address)
1237N/A into its binary representation on standard output.
1237N/A-.It Nm hex Ar string Op ...
1237N/A+.TP foo
1237N/A+\fBhex\fP \fIstring\fP [...]
1237N/A Convert the C-style escaped
1237N/A-.Ar string
1237N/A-(shellcode, for instance) into its binary representation on standard output.
1237N/A-.It Nm rand Ar len
1237N/A+\fIstring\fP
1237N/A+(shellcode, for instance) into its binary representation on standard output.
1237N/A+.TP foo
1237N/A+\fBrand\fP \fIlen\fP
1237N/A Write
1237N/A-.Ar len
1237N/A+\fIlen\fP
1237N/A random bytes to standard output.
1237N/A-.El
1237N/A-.Ss Packet encapsulation commands
1237N/A-.Bl -tag -width "foo"
1237N/A-.It Xo
1237N/A-.Nm eth
1237N/A-.Op Nm type Ar type
1237N/A-.Op Nm src Ar mac
1237N/A-.Op Nm dst Ar mac
1237N/A-.Xc
1237N/A+.SS "Packet encapsulation commands"
1237N/A+.TP foo
1237N/A+\fBeth\fP
1237N/A+[\fBtype\fP \fItype\fP]
1237N/A+[\fBsrc\fP \fImac\fP]
1237N/A+[\fBdst\fP \fImac\fP]
1237N/A Prepend the data read from standard input with an Ethernet header on
1237N/A standard output. The Ethernet
1237N/A-.Ar type
1237N/A+\fItype\fP
1237N/A may be specified as
1237N/A-.Ql arp ,
1237N/A-.Ql ip ,
1237N/A+`arp',
1237N/A+`ip',
1237N/A or as a hex, octal, or decimal number.
1237N/A-.It Xo
1237N/A-.Nm arp
1237N/A-.Op Nm op Ar op
1237N/A-.Op Nm sha Ar mac
1237N/A-.Op Nm spa Ar host
1237N/A-.Op Nm tha Ar mac
1237N/A-.Op Nm tpa Ar host
1237N/A-.Xc
1237N/A+.TP foo
1237N/A+\fBarp\fP
1237N/A+[\fBop\fP \fIop\fP]
1237N/A+[\fBsha\fP \fImac\fP]
1237N/A+[\fBspa\fP \fIhost\fP]
1237N/A+[\fBtha\fP \fImac\fP]
1237N/A+[\fBtpa\fP \fIhost\fP]
1237N/A Prepend the data read from standard input with an ARP header on
1237N/A standard output. The ARP
1237N/A-.Ar op
1237N/A+\fIop\fP
1237N/A may be specified as
1237N/A-.Ql req ,
1237N/A-.Ql rep ,
1237N/A-.Ql revreq ,
1237N/A-.Ql revrep ,
1237N/A+`req',
1237N/A+`rep',
1237N/A+`revreq',
1237N/A+`revrep',
1237N/A or as a hex, octal, or decimal number.
1237N/A-.It Xo
1237N/A-.Nm ip
1237N/A-.Op Nm tos Ar num
1237N/A-.Op Nm id Ar num
1237N/A-.Op Nm off Ar offset
1237N/A-.Op Nm ttl Ar num
1237N/A-.Op Nm proto Ar protocol
1237N/A-.Op Nm src Ar host
1237N/A-.Bk -words
1237N/A-.Op Nm dst Ar dst
1237N/A-.Ek
1237N/A-.Xc
1237N/A+.TP foo
1237N/A+\fBip\fP
1237N/A+[\fBtos\fP \fInum\fP]
1237N/A+[\fBid\fP \fInum\fP]
1237N/A+[\fBoff\fP \fIoffset\fP]
1237N/A+[\fBttl\fP \fInum\fP]
1237N/A+[\fBproto\fP \fIprotocol\fP]
1237N/A+[\fBsrc\fP \fIhost\fP]
1237N/A+[\fBdst\fP \fIdst\fP]
1237N/A Prepend the data read from standard input with an IP header on
1237N/A standard output. The fragmentation
1237N/A-.Ar offset
1237N/A-may be specified as a decimal number (optionally concatenated with
1237N/A-.Ql +
1237N/A-to indicate more fragments) or as a hex number. The
1237N/A-.Ar protocol
1237N/A+\fIoffset\fP
1237N/A+may be specified as a decimal number (optionally concatenated with
1237N/A+`+'
1237N/A+to indicate more fragments) or as a hex number. The
1237N/A+\fIprotocol\fP
1237N/A may be specified by name, or as a hex, octal, or decimal number.
1237N/A-.It Xo
1237N/A-.Nm icmp
1237N/A-.Op Nm type Ar num
1237N/A-.Op Nm code Ar num
1237N/A-.Xc
1237N/A+.TP foo
1237N/A+\fBicmp\fP
1237N/A+[\fBtype\fP \fInum\fP]
1237N/A+[\fBcode\fP \fInum\fP]
1237N/A Prepend the data read from standard input with an ICMP header on
1237N/A standard output.
1237N/A-.It Xo
1237N/A-.Nm tcp
1237N/A-.Op Nm sport Ar port
1237N/A-.Op Nm dport Ar port
1237N/A-.Op Nm flags Ar flags
1237N/A-.Op Nm seq Ar num
1237N/A-.Op Nm ack Ar num
1237N/A-.Op Nm win Ar num
1237N/A-.Op Nm urp Ar num
1237N/A-.Xc
1237N/A+.TP foo
1237N/A+\fBtcp\fP
1237N/A+[\fBsport\fP \fIport\fP]
1237N/A+[\fBdport\fP \fIport\fP]
1237N/A+[\fBflags\fP \fIflags\fP]
1237N/A+[\fBseq\fP \fInum\fP]
1237N/A+[\fBack\fP \fInum\fP]
1237N/A+[\fBwin\fP \fInum\fP]
1237N/A+[\fBurp\fP \fInum\fP]
1237N/A Prepend the data read from standard input with a TCP header on
1237N/A standard output. A
1237N/A-.Ar port
1237N/A-may be specified by name or hex, octal, or decimal number. The TCP
1237N/A-.Ar flags
1237N/A+\fIport\fP
1237N/A+may be specified by name or hex, octal, or decimal number. The TCP
1237N/A+\fIflags\fP
1237N/A may be specified as some combination of the characters in the set
1237N/A-.Ql SAFRPU
1237N/A+`SAFRPU'
1237N/A or as a hex number.
1237N/A-.It Xo
1237N/A-.Nm udp
1237N/A-.Op Nm sport Ar port
1237N/A-.Op Nm dport Ar port
1237N/A-.Xc
1237N/A+.TP foo
1237N/A+\fBudp\fP
1237N/A+[\fBsport\fP \fIport\fP]
1237N/A+[\fBdport\fP \fIport\fP]
1237N/A Prepend the data read from standard input with a UDP header on
1237N/A standard output. A
1237N/A-.Ar port
1237N/A+\fIport\fP
1237N/A may be specified by name or hex, octal, or decimal number.
1237N/A-.El
1237N/A-.Ss Packet transmission commands
1237N/A-.Bl -tag -width "foo"
1237N/A-.It Nm send Op Ar device
1237N/A+.SS "Packet transmission commands"
1237N/A+.TP foo
1237N/A+\fBsend\fP [\fIdevice\fP]
1237N/A Read a packet from standard input and send it over the network. If no
1237N/A-.Ar device
1237N/A+\fIdevice\fP
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-.El
1237N/A-.Ss Kernel interface commands
1237N/A-.Bl -tag -width "foo"
1237N/A-.It Nm arp show
1237N/A+.SS "Kernel interface commands"
1237N/A+.TP foo
1237N/A+\fBarp show\fP
1237N/A Display the kernel ARP cache.
1237N/A-.It Nm arp get Ar host
1237N/A+.TP foo
1237N/A+\fBarp get\fP \fIhost\fP
1237N/A Display the kernel ARP entry for
1237N/A-.Ar host .
1237N/A-.It Nm arp add Ar host Ar mac
1237N/A+\fIhost\fP.
1237N/A+.TP foo
1237N/A+\fBarp add\fP \fIhost\fP \fImac\fP
1237N/A Add an ARP entry mapping the
1237N/A-.Ar mac
1237N/A+\fImac\fP
1237N/A address for
1237N/A-.Ar host .
1237N/A-.It Nm arp delete Ar host
1237N/A+\fIhost\fP.
1237N/A+.TP foo
1237N/A+\fBarp delete\fP \fIhost\fP
1237N/A Delete the ARP entry for
1237N/A-.Ar host .
1237N/A-.Pp
1237N/A-.It Nm fw show
1237N/A+\fIhost\fP.
1237N/A+.sp
1237N/A+.TP foo
1237N/A+\fBfw show\fP
1237N/A Display the kernel firewall ruleset.
1237N/A-.It Xo
1237N/A-.Nm fw add Ns \&| Ns Nm delete
1237N/A-.Ar action Ar direction Ar device
1237N/A-.Ar protocol
1237N/A-.Ar src Ns Op \&: Ns Ar port[-max]
1237N/A-.Ar dst Ns Op \&: Ns Ar port[-max]
1237N/A-.Op Ar type Ns Op /code
1237N/A-.Xc
1237N/A+.TP foo
1237N/A+\fBfw add\fP\&|\fBdelete\fP
1237N/A+\fIaction\fP \fIdirection\fP \fIdevice\fP
1237N/A+\fIprotocol\fP
1237N/A+\fIsrc\fP[\&:\fIport[-max]\fP]
1237N/A+\fIdst\fP[\&:\fIport[-max]\fP]
1237N/A+[\fItype\fP[/code]]
1237N/A Add a rule to or delete a rule from the active firewall ruleset. The
1237N/A-.Ar action
1237N/A+\fIaction\fP
1237N/A must be either
1237N/A-.Ql allow
1237N/A+`allow'
1237N/A or
1237N/A-.Ql block .
1237N/A+`block'.
1237N/A The direction must be either
1237N/A-.Ql in
1237N/A+`in'
1237N/A or
1237N/A-.Ql out .
1237N/A-The
1237N/A-.Ar device
1237N/A-may specify an interface name, or
1237N/A-.Ql any .
1237N/A-The
1237N/A-.Ar protocol
1237N/A+`out'.
1237N/A+The
1237N/A+\fIdevice\fP
1237N/A+may specify an interface name, or
1237N/A+`any'.
1237N/A+The
1237N/A+\fIprotocol\fP
1237N/A may be specified by name, or as a decimal number. For TCP and
1237N/A-UDP protocols, a
1237N/A-.Ar port
1237N/A+UDP protocols, a
1237N/A+\fIport\fP
1237N/A (or range, if specified with a
1237N/A-.Ar max
1237N/A+\fImax\fP
1237N/A value) may be specified in decimal and appended to the source and/or
1237N/A destination address. For ICMP, a
1237N/A-.Ar type
1237N/A+\fItype\fP
1237N/A (and optional
1237N/A-.Ar code )
1237N/A+\fIcode\fP)
1237N/A may be specified in decimal.
1237N/A-.It Nm intf show
1237N/A+.TP foo
1237N/A+\fBintf show\fP
1237N/A Display the configuration of all network interfaces.
1237N/A-.It Nm intf get Ar device
1237N/A+.TP foo
1237N/A+\fBintf get\fP \fIdevice\fP
1237N/A Display the configuration for the interface specified by
1237N/A-.Ar device .
1237N/A-.It Xo
1237N/A-.Nm intf set
1237N/A-.Ar device
1237N/A-.Op Nm alias Ar host
1237N/A-.Op Nm dst Ar host
1237N/A-.Op Nm inet Ar host
1237N/A-.Op Nm link Ar mac
1237N/A-.Op Nm up Ns \&| Ns Nm down
1237N/A-.Op Nm arp Ns \&| Ns Nm noarp
1237N/A-.Xc
1237N/A+\fIdevice\fP.
1237N/A+.TP foo
1237N/A+\fBintf set\fP
1237N/A+\fIdevice\fP
1237N/A+[\fBalias\fP \fIhost\fP]
1237N/A+[\fBdst\fP \fIhost\fP]
1237N/A+[\fBinet\fP \fIhost\fP]
1237N/A+[\fBlink\fP \fImac\fP]
1237N/A+[\fBup\fP\&|\fBdown\fP]
1237N/A+[\fBarp\fP\&|\fBnoarp\fP]
1237N/A Configure the interface specified by
1237N/A-.Ar device .
1237N/A-.It Nm route show
1237N/A+\fIdevice\fP.
1237N/A+.TP foo
1237N/A+\fBroute show\fP
1237N/A Display the kernel routing table.
1237N/A-.It Nm route get Ar dst
1237N/A+.TP foo
1237N/A+\fBroute get\fP \fIdst\fP
1237N/A Display the route for the destination
1237N/A-.Ar dst ,
1237N/A+\fIdst\fP,
1237N/A specified as a hostname, IP address, or network prefix in CIDR notation.
1237N/A-.It Nm route add Ar dst Ar gw
1237N/A+.TP foo
1237N/A+\fBroute add\fP \fIdst\fP \fIgw\fP
1237N/A Add a route for the destination
1237N/A-.Ar dst
1237N/A+\fIdst\fP
1237N/A through the gateway
1237N/A-.Ar gw .
1237N/A-.It Nm route delete Ar dst
1237N/A+\fIgw\fP.
1237N/A+.TP foo
1237N/A+\fBroute delete\fP \fIdst\fP
1237N/A Delete the route for the destination
1237N/A-.Ar dst .
1237N/A-.El
1237N/A-.Sh EXAMPLES
1237N/A+\fIdst\fP.
1237N/A+.SH "EXAMPLES"
1237N/A Send a UDP datagram containing random shellcode:
1237N/A-.Bd -literal -offset indent
1237N/A+.nf
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 "\\x31\\xdb\\x89\\xd8\\x40\\xcd\\x80\\xe8\\xdc\\xff\\xff\\xff/bin/sh" | \\
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-.Ed
1237N/A-.Pp
1237N/A+.fi
1237N/A+.PP
1237N/A Save an ARP request in a file and send it twice:
1237N/A-.Bd -literal -offset indent
1237N/A+.nf
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 dnet send fxp0 < arp.pkt
1237N/A dnet send fxp0 < arp.pkt
1237N/A-.Ed
1237N/A-.Pp
1237N/A+.fi
1237N/A+.PP
1237N/A Send a fragmented ping packet:
1237N/A-.Bd -literal -offset indent
1237N/A+.nf
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 proto icmp src 1.2.3.4 dst 5.6.7.8 > ping.pkt
1237N/A@@ -251,9 +246,9 @@
1237N/A dnet send
1237N/A dnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 < p.ab | \\
1237N/A dnet send
1237N/A-.Ed
1237N/A-.Sh SEE ALSO
1237N/A-.Xr dnet 3
1237N/A-.Sh AUTHORS
1237N/A+.fi
1237N/A+.SH "SEE ALSO"
1237N/A+dnet(3)
1237N/A+.SH "AUTHORS"
1237N/A Dug Song
1237N/A-.Aq dugsong@monkey.org
1237N/A+<dugsong@monkey.org>