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

📄 tcpdump.1

📁 Windump3.6.2源代码
💻 1
📖 第 1 页 / 共 4 页
字号:
By default a fairly minimal decode is done, with a much more detaileddecode done if -v is used. Be warned that with -v a single SMB packetmay take up a page or more, so only use -v if you really want all thegory details.If you are decoding SMB sessions containing unicode strings then youmay wish to set the environment variable USE_UNICODE to 1. A patch toauto-detect unicode srings would be welcome.For information on SMB packet formats and what all te fields mean seewww.cifs.org or the pub/samba/specs/ directory on your favouritesamba.org mirror site. The SMB patches were written by Andrew Tridgell(tridge@samba.org)..HDNFS Requests and Replies.LPSun NFS (Network File System) requests and replies are printed as:.RS.nf.sp .5\fIsrc.xid > dst.nfs: len op args\fP\fIsrc.nfs > dst.xid: reply stat len op results\fP.sp .5\f(CWsushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165wrl.nfs > sushi.6709: reply ok 40 readlink "../var"sushi.201b > wrl.nfs:	144 lookup fh 9,74/4096.6878 "xcolors"wrl.nfs > sushi.201b:	reply ok 128 lookup fh 9,74/4134.3150\fR.sp .5.fi.REIn the first line, host \fIsushi\fP sends a transaction with id \fI6709\fPto \fIwrl\fP (note that the number following the src host is atransaction id, \fInot\fP the source port).  The request was 112 bytes,excluding the UDP and IP headers.  The operation was a \fIreadlink\fP(read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119.(If one is lucky, as in this case, the file handle can be interpretedas a major,minor device number pair, followed by the inode number andgeneration number.)\fIWrl\fP replies `ok' with the contents of the link..LPIn the third line, \fIsushi\fP asks \fIwrl\fP to lookup the name`\fIxcolors\fP' in directory file 9,74/4096.6878.  Note that the data printeddepends on the operation type.  The format is intended to be selfexplanatory if read in conjunction withan NFS protocol spec..LPIf the \-v (verbose) flag is given, additional information is printed.For example:.RS.nf.sp .5\f(CWsushi.1372a > wrl.nfs:	148 read fh 21,11/12.195 8192 bytes @ 24576wrl.nfs > sushi.1372a:	reply ok 1472 read REG 100664 ids 417/0 sz 29388\fP.sp .5.fi.RE(\-v also prints the IP header TTL, ID, length, and fragmentation fields,which have been omitted from this example.)  In the first line,\fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195,at byte offset 24576.  \fIWrl\fP replies `ok'; the packet shown on thesecond line is the first fragment of the reply, and hence is only 1472bytes long (the other bytes will follow in subsequent fragments, butthese fragments do not have NFS or even UDP headers and so might not beprinted, depending on the filter expression used).  Because the \-v flagis given, some of the file attributes (which are returned in additionto the file data) are printed: the file type (``REG'', for regular file),the file mode (in octal), the uid and gid, and the file size..LPIf the \-v flag is given more than once, even more details are printed..LPNote that NFS requests are very large and much of the detail won't be printedunless \fIsnaplen\fP is increased.  Try using `\fB\-s 192\fP' to watchNFS traffic..LPNFS reply packets do not explicitly identify the RPC operation.  Instead,\fItcpdump\fP keeps track of ``recent'' requests, and matches them to thereplies using the transaction ID.  If a reply does not closely follow thecorresponding request, it might not be parsable..HDAFS Requests and Replies.LPTransarc AFS (Andrew File System) requests and replies are printedas:.HD.RS.nf.sp .5\fIsrc.sport > dst.dport: rx packet-type\fP\fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP\fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP.sp .5\f(CWelvis.7001 > pike.afsfs:	rx data fs call rename old fid 536876964/1/1 ".newsrc.new"	new fid 536876964/1/1 ".newsrc"pike.afsfs > elvis.7001: rx data fs reply rename\fR.sp .5.fi.REIn the first line, host elvis sends a RX packet to pike.  This wasa RX data packet to the fs (fileserver) service, and is the start ofan RPC call.  The RPC call was a rename, with the old directory file idof 536876964/1/1 and an old filename of `.newsrc.new', and a new directoryfile id of 536876964/1/1 and a new filename of `.newsrc'.  The host pikeresponds with a RPC reply to the rename call (which was successful, becauseit was a data packet and not an abort packet)..LPIn general, all AFS RPCs are decoded at least by RPC call name.  MostAFS RPCs have at least some of the arguments decoded (generally onlythe `interesting' arguments, for some definition of interesting)..LPThe format is intended to be self-describing, but it will probablynot be useful to people who are not familiar with the workings ofAFS and RX..LPIf the -v (verbose) flag is given twice, acknowledgement packets andadditional header information is printed, such as the the RX call ID,call number, sequence number, serial number, and the RX packet flags..LPIf the -v flag is given twice, additional information is printed,such as the the RX call ID, serial number, and the RX packet flags.The MTU negotiation information is also printed from RX ack packets..LPIf the -v flag is given three times, the security index and service idare printed..LPError codes are printed for abort packets, with the exception of Ubikbeacon packets (because abort packets are used to signify a yes votefor the Ubik protocol)..LPNote that AFS requests are very large and many of the arguments won'tbe printed unless \fIsnaplen\fP is increased.  Try using `\fB-s 256\fP'to watch AFS traffic..LPAFS reply packets do not explicitly identify the RPC operation.  Instead,\fItcpdump\fP keeps track of ``recent'' requests, and matches them to thereplies using the call number and service ID.  If a reply does not closelyfollow thecorresponding request, it might not be parsable..HDKIP Appletalk (DDP in UDP).LPAppletalk DDP packets encapsulated in UDP datagrams are de-encapsulatedand dumped as DDP packets (i.e., all the UDP header information isdiscarded).  The file.I /etc/atalk.namesis used to translate appletalk net and node numbers to names.Lines in this file have the form.RS.nf.sp .5\fInumber	name\fP\f(CW1.254		ether16.1		icsd-net1.254.110	ace\fR.sp .5.fi.REThe first two lines give the names of appletalk networks.  The thirdline gives the name of a particular host (a host is distinguishedfrom a net by the 3rd octet in the number \-a net number \fImust\fP have two octets and a host number \fImust\fPhave three octets.)  The number and name should be separated bywhitespace (blanks or tabs).The.I /etc/atalk.namesfile may contain blank lines or comment lines (lines starting witha `#')..LPAppletalk addresses are printed in the form.RS.nf.sp .5\fInet.host.port\fP\f(CW144.1.209.2 > icsd-net.112.220office.2 > icsd-net.112.220jssmag.149.235 > icsd-net.2\fR.sp .5.fi.RE(If the.I /etc/atalk.namesdoesn't exist or doesn't contain an entry for some appletalkhost/net number, addresses are printed in numeric form.)In the first example, NBP (DDP port 2) on net 144.1 node 209is sending to whatever is listening on port 220 of net icsd node 112.The second line is the same except the full name of the source nodeis known (`office').  The third line is a send from port 235 onnet jssmag node 149 to broadcast on the icsd-net NBP port (note thatthe broadcast address (255) is indicated by a net name with no hostnumber \- for this reason it's a good idea to keep node names andnet names distinct in /etc/atalk.names)..LPNBP (name binding protocol) and ATP (Appletalk transaction protocol)packets have their contents interpreted.  Other protocols just dumpthe protocol name (or number if no name is registered for theprotocol) and packet size.\fBNBP packets\fP are formatted like the following examples:.RS.nf.sp .5\s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR\s+2.sp .5.fi.REThe first line is a name lookup request for laserwriters sent by net icsd host112 and broadcast on net jssmag.  The nbp id for the lookup is 190.The second line shows a reply for this request (note that it has thesame id) from host jssmag.209 saying that it has a laserwriterresource named "RM1140" registered on port 250.  The third line isanother reply to the same request saying host techpit has laserwriter"techpit" registered on port 186.\fBATP packet\fP formatting is demonstrated by the following example:.RS.nf.sp .5\s-2\f(CWjssmag.209.165 > helios.132: atp-req  12266<0-7> 0xae030001helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000jssmag.209.165 > helios.132: atp-req  12266<3,5> 0xae030001helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000jssmag.209.165 > helios.132: atp-rel  12266<0-7> 0xae030001jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR\s+2.sp .5.fi.REJssmag.209 initiates transaction id 12266 with host helios by requestingup to 8 packets (the `<0-7>').  The hex number at the end of the lineis the value of the `userdata' field in the request..LPHelios responds with 8 512-byte packets.  The `:digit' following thetransaction id gives the packet sequence number in the transactionand the number in parens is the amount of data in the packet,excluding the atp header.  The `*' on packet 7 indicates that theEOM bit was set..LPJssmag.209 then requests that packets 3 & 5 be retransmitted.  Heliosresends them then jssmag.209 releases the transaction.  Finally,jssmag.209 initiates the next request.  The `*' on the requestindicates that XO (`exactly once') was \fInot\fP set..HDIP Fragmentation.LPFragmented Internet datagrams are printed as.RS.nf.sp .5\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR.sp .5.fi.RE(The first form indicates there are more fragments.  The secondindicates this is the last fragment.).LP\fIId\fP is the fragment id.  \fISize\fP is the fragmentsize (in bytes) excluding the IP header.  \fIOffset\fP is thisfragment's offset (in bytes) in the original datagram..LPThe fragment information is output for each fragment.  The firstfragment contains the higher level protocol header and the fraginfo is printed after the protocol info.  Fragmentsafter the first contain no higher level protocol header and thefrag info is printed after the source and destination addresses.For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpaover a CSNET connection that doesn't appear to handle 576 byte datagrams:.RS.nf.sp .5\s-2\f(CWarizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328@0+)arizona > rtsg: (frag 595a:204@328)rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560\fP\s+2.sp .5.fi.REThere are a couple of things to note here:  First, addresses in the2nd line don't include port numbers.  This is because the TCPprotocol information is all in the first fragment and we have no ideawhat the port or sequence numbers are when we print the later fragments.Second, the tcp sequence information in the first line is printed as if therewere 308 bytes of user data when, in fact, there are 512 bytes (308 inthe first frag and 204 in the second).  If you are looking for holesin the sequence space or trying to match up ackswith packets, this can fool you..LPA packet with the IP \fIdon't fragment\fP flag is marked with atrailing \fB(DF)\fP..HDTimestamps.LPBy default, all output lines are preceded by a timestamp.  The timestampis the current clock time in the form.RS.nf\fIhh:mm:ss.frac\fP.fi.REand is as accurate as the kernel's clock.The timestamp reflects the time the kernel first saw the packet.  No attemptis made to account for the time lag between when theethernet interface removed the packet from the wire and when the kernelserviced the `new packet' interrupt..SH "SEE ALSO"traffic(1C), nit(4P), bpf(4), pcap(3).SH AUTHORSThe original authors are:.LPVan Jacobson,Craig Leres andSteven McCanne, all of theLawrence Berkeley National Laboratory, University of California, Berkeley, CA..LPIt is currently being maintained by tcpdump.org..LPThe current version is available via http:.LP.RS.I http://www.tcpdump.org/.RE.LPThe original distribution is available via anonymous ftp:.LP.RS.I ftp://ftp.ee.lbl.gov/tcpdump.tar.Z.RE.LPIPv6/IPsec support is added by WIDE/KAME project.This program uses Eric Young's SSLeay library, under specific configuration..SH BUGSPlease send problems, bugs, questions, desirable enhancements, etc. to:.LP.RStcpdump-workers@tcpdump.org.RE.LPPlease send source code contributions, etc. to:.LP.RSpatches@tcpdump.org.RE.LPNIT doesn't let you watch your own outbound traffic, BPF will.We recommend that you use the latter..LPOn Linux systems with 2.0[.x] kernels:.IPpackets on the loopback device will be seen twice;.IPpacket filtering cannot be done in the kernel, so that all packets mustbe copied from the kernel in order to be filtered in user mode;.IPall of a packet, not just the part that's within the snapshot length,will be copied from the kernel (the 2.0[.x] packet capture mechanism, ifasked to copy only part of a packet to userland, will not report thetrue length of the packet; this would cause most IP packets to get anerror from.BR tcpdump )..LPWe recommend that you upgrade to a 2.2 or later kernel..LPSome attempt should be made to reassemble IP fragments or, at leastto compute the right length for the higher level protocol..LPName server inverse queries are not dumped correctly: the (empty)question section is printed rather than real query in the answersection.  Some believe that inverse queries are themselves a bug andprefer to fix the program generating them rather than \fItcpdump\fP..LPA packet trace that crosses a daylight savings time change will giveskewed time stamps (the time change is ignored)..LPFilter expressions that manipulate FDDI or Token Ring headers assumethat all FDDI and Token Ring packets are SNAP-encapsulated Ethernetpackets.  This is true for IP, ARP, and DECNET Phase IV, but is not truefor protocols such as ISO CLNS.  Therefore, the filter may inadvertentlyaccept certain packets that do not properly match the filter expression..LPFilter expressions on fields other than those that manipulate Token Ringheaders will not correctly handle source-routed Token Ring packets..LP.BR "ip6 proto"should chase header chain, but at this moment it does not..BR "ip6 protochain"is supplied for this behavior..LPArithmetic expression against transport layer headers, like \fBtcp[0]\fP,does not work against IPv6 packets.It only looks at IPv4 packets.

⌨️ 快捷键说明

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