⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dnet.8

📁 SinFP是一种新的识别对方计算机操作系统类型的工具
💻 8
字号:
.\" $Id: dnet.8,v 1.6 2002/04/01 07:11:34 dugsong Exp $.\".\" Copyright (c) 2001 Dug Song <dugsong@monkey.org>.\".Dd October 17, 2001.Dt DNET 8.Os.Sh NAME.Nm dnet.Nd dumb networking library test program.Sh SYNOPSIS.Nm dnet Ar command Ar args Op ....Sh DESCRIPTION.Nmis a simple test program for the .Xr dnet 3library. It can be used to compose and transmit network datagrams as aUnix-style filter (e.g. reading from or writing to files and pipes) ormodify the local system network configuration (including the ARPcache, firewall ruleset, network interfaces, and routing table)..Pp.Ss Payload generation commands.Bl -tag -width "foo".It Nm addr Ar address Op ...Convert the .Ar address(specified as a hostname, IP address, or MAC address)into its binary representation on standard output..It Nm hex Ar string Op ...Convert the C-style escaped.Ar string(shellcode, for instance) into its binary representation on standard output. .It Nm rand Ar lenWrite.Ar lenrandom bytes to standard output..El.Ss Packet encapsulation commands.Bl -tag -width "foo".It Xo.Nm eth.Op Nm type Ar type .Op Nm src Ar mac.Op Nm dst Ar mac.XcPrepend the data read from standard input with an Ethernet header onstandard output. The Ethernet.Ar typemay be specified as.Ql arp ,.Ql ip ,or as a hex, octal, or decimal number..It Xo.Nm arp.Op Nm op Ar op.Op Nm sha Ar mac.Op Nm spa Ar host.Op Nm tha Ar mac.Op Nm tpa Ar host.XcPrepend the data read from standard input with an ARP header onstandard output. The ARP.Ar opmay be specified as.Ql req ,.Ql rep ,.Ql revreq ,.Ql revrep ,or as a hex, octal, or decimal number..It Xo.Nm ip.Op Nm tos Ar num.Op Nm id Ar num.Op Nm off Ar offset.Op Nm ttl Ar num.Op Nm proto Ar protocol.Op Nm src Ar host.Bk -words.Op Nm dst Ar dst.Ek.XcPrepend the data read from standard input with an IP header onstandard output. The fragmentation.Ar offsetmay be specified as a decimal number (optionally concatenated with .Ql +to indicate more fragments) or as a hex number. The .Ar protocolmay be specified by name, or as a hex, octal, or decimal number..It Xo.Nm icmp.Op Nm type Ar num.Op Nm code Ar num.XcPrepend the data read from standard input with an ICMP header onstandard output..It Xo.Nm tcp.Op Nm sport Ar port.Op Nm dport Ar port.Op Nm flags Ar flags.Op Nm seq Ar num.Op Nm ack Ar num.Op Nm win Ar num.Op Nm urp Ar num.XcPrepend the data read from standard input with a TCP header onstandard output. A.Ar portmay be specified by name or hex, octal, or decimal number. The TCP .Ar flagsmay be specified as some combination of the characters in the set.Ql SAFRPUor as a hex number..It Xo.Nm udp.Op Nm sport Ar port.Op Nm dport Ar port.XcPrepend the data read from standard input with a UDP header onstandard output. A.Ar portmay be specified by name or hex, octal, or decimal number..El.Ss Packet transmission commands.Bl -tag -width "foo".It Nm send Op Ar deviceRead a packet from standard input and send it over the network. If no.Ar deviceis specified, the packet is assumed to be an IP datagram and routedto its destination. Otherwise, the packet is assumed to be an Ethernetframe and is transmitted on the specified interface..El.Ss Kernel interface commands.Bl -tag -width "foo".It Nm arp showDisplay the kernel ARP cache..It Nm arp get Ar hostDisplay the kernel ARP entry for.Ar host ..It Nm arp add Ar host Ar macAdd an ARP entry mapping the.Ar macaddress for.Ar host ..It Nm arp delete Ar hostDelete the ARP entry for.Ar host ..Pp.It Nm fw showDisplay the kernel firewall ruleset..It Xo.Nm fw add Ns \&| Ns Nm delete.Ar action Ar direction Ar device .Ar protocol .Ar src Ns Op \&: Ns Ar port[-max].Ar dst Ns Op \&: Ns Ar port[-max].Op Ar type Ns Op /code.XcAdd a rule to or delete a rule from the active firewall ruleset. The.Ar actionmust be either.Ql allowor.Ql block .The direction must be either.Ql inor.Ql out .The .Ar devicemay specify an interface name, or .Ql any .The .Ar protocolmay be specified by name, or as a decimal number. For TCP andUDP protocols, a .Ar port(or range, if specified with a.Ar maxvalue) may be specified in decimal and appended to the source and/ordestination address. For ICMP, a.Ar type(and optional.Ar code )may be specified in decimal..It Nm intf showDisplay the configuration of all network interfaces..It Nm intf get Ar deviceDisplay the configuration for the interface specified by.Ar device ..It Xo.Nm intf set.Ar device.Op Nm alias Ar host.Op Nm dst Ar host.Op Nm inet Ar host.Op Nm link Ar mac.Op Nm up Ns \&| Ns Nm down.Op Nm arp Ns \&| Ns Nm noarp.XcConfigure the interface specified by.Ar device ..It Nm route showDisplay the kernel routing table..It Nm route get Ar dstDisplay the route for the destination.Ar dst ,specified as a hostname, IP address, or network prefix in CIDR notation..It Nm route add Ar dst Ar gwAdd a route for the destination.Ar dstthrough the gateway.Ar gw ..It Nm route delete Ar dstDelete the route for the destination.Ar dst ..El.Sh EXAMPLESSend a UDP datagram containing random shellcode:.Bd -literal -offset indentdnet 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" | \\dnet udp sport 555 dport 666 | \\dnet ip proto udp src 1.2.3.4 dst 5.6.7.8 | dnet send.Ed.PpSave an ARP request in a file and send it twice:.Bd -literal -offset indentdnet arp op req sha 0:d:e:a:d:0 spa 10.0.0.3 tpa 10.0.0.4 | \\dnet eth type arp src 0:d:e:a:d:0 dst ff:ff:ff:ff:ff:ff > arp.pktdnet send fxp0 < arp.pktdnet send fxp0 < arp.pkt.Ed.PpSend a fragmented ping packet:.Bd -literal -offset indent# Create ping packet with IP header, to set ICMP checksumecho "monkey monkey monkey monkey" | dnet icmp type 8 code 0 | \\dnet ip proto icmp src 1.2.3.4 dst 5.6.7.8 > ping.pkt# Chop off IP headerdd if=ping.pkt of=ping.data bs=20 skip=1# Fragment IP payloadsplit -b 24 ping.data p.# Send fragmentsdnet ip id 1 off 0+ proto icmp src 1.2.3.4 dst 5.6.7.8 < p.aa | \\dnet senddnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 < p.ab | \\dnet send.Ed.Sh SEE ALSO.Xr dnet 3.Sh AUTHORSDug Song.Aq dugsong@monkey.org

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -