说明:以下内容部分来自网络,部分本人的实践总结,如有问题,请留言,谢谢。
一、符号:
and(&&) //并且
or(||) //或者
not(!) //取反
==(eq) //等于
matches //模糊匹配某字符串
contains //包含某字符串
二、IP过滤:包括来源IP或者目标IP等于某个IP
ip.src == 102.198.10.20 //显示源IP为102.198.10.20
ip.dst == 102.198.10.20 //显示目的IP为102.198.10.20
ip.src eq 102.198.10.20 && ip.dst eq 108.201.1.80 //显示源IP为102.198.10.20,并且目的IP为108.201.1.80
三、端口过滤:
tcp.port eq 80 //显示80的tcp端口,不管是源端口还是目标端口
udp.port == 694 //显示694的udp端口,不管是源端口还是目标端口
tcp.port eq 80 or udp.port eq 80 //显示80的tcp端口或者80的udp端口
tcp.dstport == 80 //只显示tcp协议的目标端口80
tcp.srcport == 80 //只显示tcp协议的来源端口80
tcp.port >= 1 and tcp.port <= 80 //过滤tcp端口范围[1-80]
ip.src == 102.198.10.20 and http //过滤ip为102.198.10.20并且为http协议的包
四、协议过滤:直接在Filter栏输入即可。
tcp
udp
arp
icmp
http
smtp
ftp
dns
msnms
ip
ssl
ssh
等等
五、包长度过滤:
udp.length == 225 //这个长度是指udp本身固定长度8加上udp下面那块数据包之和
tcp.len >= 7 //指的是ip数据包(tcp下面那块数据),不包括tcp本身
ip.len == 94 //除了以太网头固定长度14,其它都算是ip.len,即从ip本身到最后
frame.len == 119 //整个数据包长度,从eth开始到最后
六、http模式过滤:
http.request.method == "GET" //只显示GET方法的HTTP请求,GET要大写。
http.request.method == "POST" //只显示POST方法的HTTP请求,POST要大写。
http.request.uri matches "gif" //模糊匹配(搜索)URL请求gif图片的包
http.request.uri matches ".gif$" //匹配过滤HTTP的请求URI中含有".gif"字符串,并且以.gif结尾(4个字节)的http请求数据包($是正则表达式中的结尾表示符)
http.request.uri contains ".gif$" //contains是包含字符串".gif$"(5个字节)。匹配过滤HTTP的请求URI中含有".gif$"字符串的http请求数据包(这里$是字符,不是结尾符)
http contains "GET" //匹配过滤HTTP协议含有"GET"字符串的包
http contains "HTTP/1." //匹配过滤HTTP协议含有"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: "
原文地址:http://wenku.baidu.com/view/e8afe23143323968011c925f.html