首页 > 技术文章 > wireshark语法小结

andy9468 2019-09-18 19:08 原文

wireshark过滤命令小结

1、ip过滤

(1)滤出含有ip的包

ip.addr == ip1

双等号两边,有无空格均可。

(2)滤出以ip1为源IP的包

ip.src == ip1

(3)滤出以ip2为目标IP的包

ip.dst == ip2

2、端口过滤

(1)滤出端口25

tcp.port == 25

(2)滤出源端口为25的包

tcp.srcport == 25

(3)滤出目的端口为25的包

tcp.dstport == 25

3、协议过滤

(1)滤出http协议

http

(2)滤出tcp协议

tcp

注意:基于tcp协议的http协议也会被滤到结果中。

(3)滤出ssh协议

ssh

4、组合过滤

(1)同时满足多个条件

使用关键词and,或者双符号 &&

(ip.addr == ip1) and http
(ip.addr == ip1) && http

(2)满足任一条件即可

使用关键词or,或者双竖线 ||

snmp || dns || icmp
snmp or (ip.addr == ip1)

(3)排除取反

ip.src != 10.1.2.3

不等号两边,有无空格均可。

5、http协议的包过滤

注意:只对http有效,对https无效。

(1)显示get请求方式的http封包

http.request.method == "GET"

(2)显示post请求方式的http封包

http.request.method == "POST"

(3)显示域名为xxx包

http.host == "www.cpanet.org.cn"

(4)显示请求的uri包含"online"的http封包。

http.request.uri contains "lingdaojigou"

 

 

 

 

 

 

https://blog.csdn.net/cumirror/article/details/7054496

过滤重传包

https://blog.csdn.net/Joseph_ChiRunningAnt/article/details/77140678

推荐阅读