Wireshark 过滤器使用

捕获过滤器:

 在抓包之前就设定好过滤条件,然后只抓取符合条件的数据包。

显示过滤器:

在已捕获的数据包集合中设置过滤条件,隐藏不想显示的数据包,只显示符合条件的数据包。

过滤器比较符号

在这里插入图片描述

过滤ip和mac地址

ip 改成 eth,就是过滤 mac 地址

ip.addr == 8.8.8.8
ip.src == 8.8.8.8
ip.dst == 8.8.8.8
ip.addr == 10.0.0.0/16

 过滤端口

下面的 tcp 可以改成 udp

tcp.port == 9090
tcp.dstport == 9090
tcp.srcport == 9090
tcp.port >=1 and tcp.port <= 80

根据长度过滤

tcp.len >= 7      (tcp data length)
ip.len == 88      (except fixed header length)
udp.length == 26  (fixed header length 8 and data length)
frame.len == 999  (all data packet length)

HTTP 数据包过滤

http.host == xxx.com
// 过滤 host

http.response == 1
// 过滤所有的 http 响应包

http.response.code == 302
// 过滤状态码 202

http.request.method==POST 
// 过滤 POST 请求包

http.cookie contains xxx
// cookie 包含 xxx

http.request.uri=="/robots.txt"
//过滤请求的uri,取值是域名后的部分

http.request.full_uri=="http://1.com"
// 过滤含域名的整个url

http.server contains "nginx"
//过滤http头中server字段含有nginx字符的数据包

http.content_type == "text/html"
//过滤content_type是text/html

http.content_encoding == "gzip"
//过滤content_encoding是gzip的http包

http.transfer_encoding == "chunked"
//根据transfer_encoding过滤

http.content_length == 279

http.content_length_header == "279"
//根据content_length的数值过滤

http.request.version == "HTTP/1.1"
//过滤HTTP/1.1版本的http包,包括请求和响应

获取特定的请求响应对:

以状态码500的响应及其响应为例子

  1. 先筛选出不想要显示的响应:http.response.code < 500
  2. edit ——> Ignore All Displayed
  3. http.request_in && http.response.code ==500
  • 4
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值