wireshark简单使用

一、IP过滤:包括来源IP或者目标IP等于某个IP
比如:ip.src addr==192.168.0.208  or ip.src addr eq 192.168.0.208 显示来源IP
      ip.dst addr==192.168.0.208  or ip.dst addr eq 192.168.0.208 显示目标IP


二、端口过滤:
比如: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


过滤端口范围
tcp.port >= 1 and tcp.port <= 80


三、协议过滤:tcp
udp
arp
icmp
http
smtp
ftp
dns
msnms
ip
ssl
等等
排除ssl包,如!ssl 或者  not ssl


四、包长度过滤:
比如:
udp.length == 26 这个长度是指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"
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: "
一定包含如下
Content-Type:


六、连接符 and / or


七、表达式:!(arp.src==192.168.1.1) and !(arp.dst.proto_ipv4==192.168.1.243)




wireshark匹配规则很强大。
还有一个规则应用是关于数据包内容的字节匹配的。
例如:
//匹配TCP的payload(TCP的实际数据内容),前6个字节为 E3 11 00 00 00 48 (电驴协议)
//20是TCP头部的长度,21-~为TCP的有效数据
TCP[20:6] == E3:11:00:00:00:56  and TCP[29] == 54


还可以matches匹配一些正则表达式




//匹配UDP的payload(UDP的实际数据内容),匹配 第1和第2字节分别是0xF1、0x0; 第4和第5字节分别为0x00、0x00 (电驴协议)
//8是UDP的头部长度,8-~为UDP包的有效数据
UDP[8:2] == F1:0D and UDP[10:2] ==00:00
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值