版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2004/04/05/000244.html
D:\>windump -h windump version current-cvs.tcpdump.org, based on tcpdump version current-cvs.tcpdump.org WinPcap version 3.0 alpha, based on libpcap version current-cvs.tcpdump.org Usage: windump [-aAdDeflnNOpqRStuvxX] [-B size] [-c count] [ -C file_size ] [ -F file ] [ -i interface ] [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ] [ -E algo:secret ] [ expression ]
% tcpdump -h tcpdump version 3.6.3 libpcap version 0.6 Usage: tcpdump [-adeflnNOpqRStuvxX] [-c count] [ -F file ] [ -i interface ] [ -r file ] [ -s snaplen ] [ -T type ] [ -U user ] [ -w file ] [ expression ]
发信人: windtear (看成败 人生豪迈), 信区: THUNet 标 题: [简易FAQ] 怎么知道谁中毒了 发信站: BBS 水木清华站 (Sun Nov 2 21:22:21 2003), 转信
[简易FAQ] 怎么知道谁中毒了
Q: 怎么知道谁中毒了 A: 抓包
Q: 怎么抓包 A: WinDump
Q: 哪里有 A: http://windump.polito.it/
Q: 连不上 A: 用代理 或者 http://ipcn.org/windump/WinDump.exe http://ipcn.org/windump/WinPcap_3_0.exe
(如果不想用 alpha 版本 http://ipcn.org/windump/WinDump.v3.6.2.exe http://ipcn.org/windump/2.3-WinPcap.exe )
Q: 怎么用 A: 先装 WinPcap_3_0.exe 再装 WinDump.exe 开始->运行 %SystemRoot%
拷贝粘贴 WinDump.exe 开始->运行 cmd WinDump.exe -h
Q: 看不懂 A: http://windump.polito.it/docs/manual.htm http://windump.polito.it/misc/faq.htm
A: WinDump.exe -nn icmp
21:06:50.845294 IP 166.111.168.203 > 166.111.169.255: icmp 72: echo request seq 16436 21:06:51.023851 IP 166.111.168.203 > 166.111.170.17: icmp 72: echo request seq 21044 21:06:51.063603 IP 166.111.168.203 > 166.111.170.21: icmp 72: echo request seq 22068 21:06:51.133730 IP 166.111.168.203 > 166.111.170.28: icmp 72: echo request seq 23860 21:06:51.163858 IP 166.111.168.203 > 166.111.170.31: icmp 72: echo request seq 24628 Q: 谁中毒了 A: 166.111.168.203
Q: 我只想要 238 段的 A: WinDump.exe -nn icmp and src net 166.111.238.0/24 Q: 怎么知道中毒的166.111.168.203是谁 A: 如是静态IP:看静态IP分配信息 如不是: ping 166.111.168.203 arp -a 找到 166.111.168.203 的 mac 166.111.168.203 00-50-ba-45-91-6f dynamic 00-50-ba-45-91-6f
Q: 然后呢 A: 到 3900(3300) 1100 查哪个端口 A: --_--> 3900 Address found on port 17: Canonical address Type 00-50-ba-45-91-6f Dynamic or ----> 3900www Success! Address found on port 17 -----> 1100 Location VLAN ID Permanent Unit 1 Port 12 1 No
Q: 不会 A: 发信到 sns_noc@mails.tsinghua.edu.cn
-- http://ipcn.org/ ipchina.org proxy/ftp/domain/search/whois/BBS/XO/speed/mail/vpn
35#BBS (35# 从 2003-08-25 起为女研究生楼) telnet://bbs.35net.ipcn.org/ http://bbs.35net.ipcn.org/ 或者 telnet://ipcn.org/ telnet://ipchina.org/ 国内外均可访问 提供穿梭 个人文集等额外服务
※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.154.35]
D:\>windump -n src net 166.111.168.0/22 and not src host 166.111.168.100
D:\>WinDump.exe -n udp port 1434
TCPDUMP(8) TCPDUMP(8)
NAME tcpdump - dump traffic on a network
SYNOPSIS tcpdump [ -adeflnNOpqRStuvxX ] [ -c count ] [ -F file ] [ -i interface ] [ -m module ] [ -r file ] [ -s snaplen ] [ -T type ] [ -U user ] [ -w file ] [ -E algo:secret ] [ expression ]
DESCRIPTION Tcpdump prints out the headers of packets on a network interface that match the boolean expression.
Under SunOS with nit or bpf: To run tcpdump you must have read access to /dev/nit or /dev/bpf*. Under Solaris with dlpi: You must have read/write access to the network pseudo device, e.g. /dev/le. Under HP-UX with dlpi: You must be root or it must be installed setuid to root. Under IRIX with snoop: You must be root or it must be installed setuid to root. Under Linux: You must be root or it must be installed setuid to root. Under Ultrix and Digital UNIX: Once the super-user has enabled promiscuous- mode operation using pfconfig(8), any user may run tcp- dump. Under BSD: You must have read access to /dev/bpf*.
OPTIONS -a Attempt to convert network and broadcast addresses to names.
-c Exit after receiving count packets.
-d Dump the compiled packet-matching code in a human readable form to standard output and stop.
-dd Dump packet-matching code as a C program fragment.
-ddd Dump packet-matching code as decimal numbers (pre- ceded with a count).
-e Print the link-level header on each dump line.
-E Use algo:secret for decrypting IPsec ESP packets. Algorithms may be des-cbc, 3des-cbc, blowfish-cbc, rc3-cbc, cast128-cbc, or none. The default is des- cbc. The ability to decrypt packets is only pre- sent if tcpdump was compiled with cryptography enabled. secret the ascii text for ESP secret key. We cannot take arbitrary binary value at this moment. The option assumes RFC2406 ESP, not RFC1827 ESP. The option is only for debugging pur- poses, and the use of this option with truly `secret' key is discouraged. By presenting IPsec secret key onto command line you make it visible to others, via ps(1) and other occasions.
-f Print `foreign' internet addresses numerically rather than symbolically (this option is intended to get around serious brain damage in Sun's yp server -- usually it hangs forever translating non- local internet numbers).
-F Use file as input for the filter expression. An additional expression given on the command line is ignored.
-i Listen on interface. If unspecified, tcpdump searches the system interface list for the lowest numbered, configured up interface (excluding loop- back). Ties are broken by choosing the earliest match.
On Linux systems with 2.2 or later kernels, an interface argument of ``any'' can be used to cap- ture packets from all interfaces. Note that cap- tures on the ``any'' device will not be done in promiscuous mode.
-l Make stdout line buffered. Useful if you want to see the data while capturing it. E.g., ``tcpdump -l | tee dat'' or ``tcpdump -l > dat & tail -f dat''.
-n Don't convert host addresses to names. This can be used to avoid DNS lookups.
-nn Don't convert protocol and port numbers etc. to names either.
-N Don't print domain name qualification of host names. E.g., if you give this flag then tcpdump will print ``nic'' instead of ``nic.ddn.mil''.
-m Load SMI MIB module definitions from file module. This option can be used several times to load sev- eral MIB modules into tcpdump.
-O Do not run the packet-matching code optimizer. This is useful only if you suspect a bug in the optimizer.
-p Don't put the interface into promiscuous mode. Note that the interface might be in promiscuous mode for some other reason; hence, `-p' cannot be used as an abbreviation for `ether host {local-hw- addr} or ether broadcast'.
-q Quick (quiet?) output. Print less protocol infor- mation so output lines are shorter.
-r Read packets from file (which was created with the -w option). Standard input is used if file is ``-''.
-R Assume ESP/AH packets to be based on old specifica- tion (RFC1825 to RFC1829). If specified, tcpdump will not print replay prevention field. Since there is no protocol version field in ESP/AH speci- fication, tcpdump cannot deduce the version of ESP/AH protocol.
-s Snarf snaplen bytes of data from each packet rather than the default of 68 (with SunOS's NIT, the mini- mum is actually 96). 68 bytes is adequate for IP, ICMP, TCP and UDP but may truncate protocol infor- mation from name server and NFS packets (see below). Packets truncated because of a limited snapshot are indicated in the output with ``[|proto]'', where proto is the name of the protocol level at which the truncation has occurred. Note that taking larger snapshots both increases the amount of time it takes to process packets and, effectively, decreases the amount of packet buffering. This may cause packets to be lost. You should limit snaplen to the smallest number that will capture the protocol information you're interested in. Setting snaplen to 0 means use the required length to catch whole packets.
-S Print absolute, rather than relative, TCP sequence numbers.
-t Don't print a timestamp on each dump line.
-tt Print an unformatted timestamp on each dump line.
-ttt Print a delta (in micro-seconds) between current and previous line on each dump line.
-tttt Print a timestamp in default format proceeded by date on each dump line.
-U Drops root privileges and changes user ID to user and group ID to the primary group of user.
Note! Red Hat Linux automatically drops the privi- leges to user ``pcap'' if nothing else is speci- fied.
-T Force packets selected by "expression" to be inter- preted the specified type. Currently known types are cnfp (Cisco NetFlow protocol), rpc (Remote Pro- cedure Call), rtp (Real-Time Applications proto- col), rtcp (Real-Time Applications control proto- col), snmp (Simple Network Management Protocol), vat (Visual Audio Tool), and wb (distributed White Board).
-u Print undecoded NFS handles.
-v (Slightly more) verbose output. For example, the time to live, identification, total length and options in an IP packet are printed. Also enables additional packet integrity checks such as verify- ing the IP and ICMP header checksum. SMB packets are also printed in full.
-vv Even more verbose output. For example, additional fields are printed from NFS reply packets.
-vvv Even more verbose output. For example, telnet SB ... SE options are printed in full. With -X telnet options are printed in hex as well.
-w Write the raw packets to file rather than parsing and printing them out. They can later be printed with the -r option. Standard output is used if file is ``-''.
-x Print each packet (minus its link level header) in hex. The smaller of the entire packet or snaplen bytes will be printed.
-X When printing hex, print ascii too. Thus if -x is also set, the packet is printed in hex/ascii. This is very handy for analysing new protocols. Even if -x is not also set, some parts of some packets may be printed in hex/ascii.
expression selects which packets will be dumped. If no expression is given, all packets on the net will be dumped. Otherwise, only packets for which expres- sion is `true' will be dumped.
The expression consists of one or more primitives. Primitives usually consist of an id (name or num- ber) preceded by one or more qualifiers. There are three different kinds of qualifier:
type qualifiers say what kind of thing the id name or number refers to. Possible types are host, net and port. E.g., `host foo', `net 128.3', `port 20'. If there is no type qualifier, host is assumed.
dir qualifiers specify a particular transfer direction to and/or from id. Possible directions are src, dst, src or dst and src and dst. E.g., `src foo', `dst net 128.3', `src or dst port ftp-data'. If there is no dir qualifier, src or dst is assumed. For `null' link layers (i.e. point to point pro- tocols such as slip) the inbound and out- bound qualifiers can be used to specify a desired direction.
proto qualifiers restrict the match to a particu- lar protocol. Possible protos are: ether, fddi, tr, ip, ip6, arp, rarp, decnet, tcp and udp. E.g., `ether src foo', `arp net 128.3', `tcp port 21'. If there is no proto qualifier, all protocols consistent with the type are assumed. E.g., `src foo' means `(ip or arp or rarp) src foo' (except the latter is not legal syntax), `net bar' means `(ip or arp or rarp) net bar' and `port 53' means `(tcp or udp) port 53'.
[`fddi' is actually an alias for `ether'; the parser treats them identically as meaning ``the data link level used on the specified network interface.'' FDDI headers contain Ethernet-like source and destination addresses, and often contain Ethernet-like packet types, so you can filter on these FDDI fields just as with the analogous Ether- net fields. FDDI headers also contain other fields, but you cannot name them explicitly in a filter expression.
Similarly, `tr' is an alias for `ether'; the previ- ous paragraph's statements about FDDI headers also apply to Token Ring headers.]
In addition to the above, there are some special `primitive' keywords that don't follow the pattern: gateway, broadcast, less, greater and arithmetic expressions. All of these are described below.
More complex filter expressions are built up by using the words and, or and not to combine primitives. E.g., `host foo and not port ftp and not port ftp-data'. To save typing, identical qualifier lists can be omitted. E.g., `tcp dst port ftp or ftp-data or domain' is exactly the same as `tcp dst port ftp or tcp dst port ftp-data or tcp dst port domain'.
Allowable primitives are:
dst host host True if the IPv4/v6 destination field of the packet is host, which may be either an address or a name.
src host host True if the IPv4/v6 source field of the packet is host.
host host True if either the IPv4/v6 source or desti- nation of the packet is host. Any of the above host expressions can be prepended with the keywords, ip, arp, rarp, or ip6 as in: ip host host which is equivalent to: ether proto \ip and host host If host is a name with multiple IP addresses, each address will be checked for a match.
ether dst ehost True if the ethernet destination address is ehost. Ehost may be either a name from /etc/ethers or a number (see ethers(3N) for numeric format).
ether src ehost True if the ethernet source address is ehost.
ether host ehost True if either the ethernet source or desti- nation address is ehost.
gateway host True if the packet used host as a gateway. I.e., the ethernet source or destination address was host but neither the IP source nor the IP destination was host. Host must be a name and must be found in both /etc/hosts and /etc/ethers. (An equivalent expression is ether host ehost and not host host which can be used with either names or num- bers for host / ehost.) This syntax does not work in IPv6-enabled configuration at this moment.
dst net net True if the IPv4/v6 destination address of the packet has a network number of net. Net may be either a name from /etc/networks or a network number (see networks(4) for details).
src net net True if the IPv4/v6 source address of the packet has a network number of net.
net net True if either the IPv4/v6 source or desti- nation address of the packet has a network number of net.
net net mask mask True if the IP address matches net with the specific netmask. May be qualified with src or dst. Note that this syntax is not valid for IPv6 net.
net net/len True if the IPv4/v6 address matches net a netmask len bits wide. May be qualified with src or dst.
dst port port True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a destination port value of port. The port can be a num- ber or a name used in /etc/services (see tcp(4P) and udp(4P)). If a name is used, both the port number and protocol are checked. If a number or ambiguous name is used, only the port number is checked (e.g., dst port 513 will print both tcp/login traf- fic and udp/who traffic, and port domain will print both tcp/domain and udp/domain traffic).
src port port True if the packet has a source port value of port.
port port True if either the source or destination port of the packet is port. Any of the above port expressions can be prepended with the keywords, tcp or udp, as in: tcp src port port which matches only tcp packets whose source port is port.
less length True if the packet has a length less than or equal to length. This is equivalent to: len <= length.
greater length True if the packet has a length greater than or equal to length. This is equivalent to: len >= length.
ip proto protocol True if the packet is an IP packet (see ip(4P)) of protocol type protocol. Protocol can be a number or one of the names icmp, icmp6, igmp, igrp, pim, ah, esp, udp, or  
|
|