wireshark抓包

例:1 查找目的地址为192.168.101.8的包, ip.dst==192.168.101.8;查找源地址为 ip.src==1.1.1.1
       2 http模式过滤。如过滤get包, http.request.method==”GET”;过滤post包, http.request.method==”POST”
       3 如过滤80端口,在Filter中输入, tcp.port==80,这条规则是把源端口和目的端口为80的都过滤出来。使用 tcp.dstport==80只过滤目的端口为80的 ,tcp.srcport==80只过滤源端口为80的包;
       4  使用and连接,如过滤ip为192.168.101.8并且为http协议的, ip.src==192.168.101.8 and http

1. 过滤IP,如来源IP或者目标IP等于某个IP

例:
ip.src eq 192.168.1.107 or ip.dst eq 192.168.1.107
或者
ip.addr eq 192.168.1.107
// 都能显示来源IP和目标IP

2. 过滤端口

例:
tcp.port eq 80 // 不管端口是源的还是目标的都显示
tcp.port == 80
tcp.port eq 2722
tcp.port eq 80 or udp.port eq 80
tcp.dstport == 80 // 只显tcp协议的目标端口80
tcp.srcport == 80 // 只显tcp协议的源端口80
udp.port eq 15000
过滤端口范围
tcp.port >= 1 and tcp.port <= 80

3. 过滤协议

例:
tcp
udp
arp
icmp
http
smtp
ftp
dns
msnms
ip
ssl
oicq
bootp
…… …… ……
排除arp包,如 !arp 或者  not arp

4. 过滤MAC

太以网头过滤
eth.dst == A0:00:00:04:C5:84 // 过滤目标mac
eth.src eq A0:00:00:04:C5:84 // 过滤源mac
eth.dst==A0:00:00:04:C5:84
eth.dst==A0-00-00-04-C5-84
eth.addr eq A0:00:00:04:C5:84 // 过滤源MAC和目标MAC都等于A0:00:00:04:C5:84的
less than
 小于  < lt
小于等于  le
等于  eq
大于  gt
大于等于  ge
不等  ne

5. 包长度过滤

例:
udp.length == 26
 这个长度是指udp本身固定长度8加上udp下面那块数据包之和
tcp.len >= 7 
指的是ip数据包(tcp下面那块数据),不包括tcp本身
ip.len == 94 
除了以太网头固定长度14,其它都算是ip.len,即从ip本身到最后
frame.len == 119
 整个数据包长度,从eth开始到最后
eth —> ip or arp —> tcp or udp —> data

6. http模式过滤

例:
http.request.method == “GET”
http.request.method == “POST”
http.request.uri == “/img/logo-edu.gif”
http contains “GET”
http contains “HTTP/1.”
// GET包
http.request.method == “GET” && http contains “Host: “
http.request.method == “GET” && http contains “User-Agent: “
// POST包
http.request.method == “POST” && http contains “Host: “
http.request.method == “POST” && http contains “User-Agent: “
// 响应包
http contains “HTTP/1.1 200 OK” && http contains “Content-Type: “
http contains “HTTP/1.0 200 OK” && http contains “Content-Type: “
ps:一定包含如下 Content-Type:

7. TCP参数过滤

tcp.flags 显示包含TCP标志的封包。
tcp.flags.syn == 0x02   显示包含TCP SYN标志的封包。
tcp.window_size == 0 && tcp.flags.reset != 1
如何判断数据包是含有命令编码的MSN数据包?
  • 端口为1863或者80

如:tcp.port == 1863 || tcp.port == 80

  • 数据这段前三个是大写字母

如:tcp[20:1] >= 41 && tcp[20:1] <= 5A && tcp[21:1] >= 41 && tcp[21:1] <= 5A && tcp[22:1] >= 41 && tcp[22:1] <= 5A

  • 第四个为0x20

如:tcp[23:1] == 20

  • msn是属于TCP协议的

tcp

猜你喜欢

转载自blog.csdn.net/ever_peng/article/details/80221226