首页/网络/抓包与流量分析速查/Wireshark contains 包含匹配
Wireshark 技巧75 条

Wireshark contains 包含匹配

contains 判断字段值是否包含子串或字节序列,适合搜索 URL、Host、User-Agent 等不确定完整值的内容。

用途字段包含子串/字节匹配
语法字段 contains "子串" 或 字段 contains 12:34:56

常用示例

常用示例
http.request.uri contains "/api/v2"
http.host contains "internal"
dns.qry.name contains "cdn"
tcp contains "password"
contains 对大小写敏感,需不区分大小写可在正则版用 matches "(?i)..."。

易错点

  • contains 会触发较重的字符串扫描,大文件先用端口/协议粗筛再叠加 contains
  • 对二进制 payload 用字节序列写法(如 contains 47:45:54)比字符串更稳

数据来源与参考

  • Wireshark User's Guide(contains)
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌