wireshark 過濾器

wireshark 過濾器

wireshark有2個非常實用的過濾器。

  • 用於減少記錄數量的 捕獲過濾器
  • 用於強大分析的 顯示過濾器

捕獲過濾器 capture filter

語法

<Protocol> <Direction> <Host(s)> <Value> <Logical Operations> <Other expression>

protocol 協議

ether, ip, arp, icmp, tcp, udp, ...等

如果沒指明協議類型,則默認爲捕捉所有支持的協議。

direction 方向

src, dst, src and dst, src or dst, ...等

如果沒指明方向,則默認爲 src or dst

host 目標

net, port, host, portrange, ...等

默認爲 host。即默認下 src 192.168.0.100 等同於 host src 192.168.0.100

logical operations 邏輯運算符

not, and, or, ...等

not 具有最高的優先級。andor 優先級相同,運算時從左至右進行。

因爲 not 的優先級高於 andor ,所以當要表達 not 時需要寫成 and not

e.g.

host 192.168.0.100 and tcp and not icmp

顯示過濾器 capture filter

protocol 協議

ip, tcp, udp, ssh, ...等

direction 方向

src, dst, ...等

host 目標

port, addr, flags, ...等

e.g.

src.port==80
dst.addr==192.168.0.100

operations 操作符

比較操作符

==, !=, >, <, >=, <=

e.g.

ip.addr==192.168.0.100
frame.len<=100

邏輯操作符

兩種寫法都可以。

and, or, xor, not
&&, ||, ``, !

e.g.

ip.addr==192.168.0.100 or ip.addr==192.168.0.200

參考

How To Set Up a Capture

更爲多的細節也可以參考軟件自身。在 應用顯示過濾器...<ctrl-/> 輸入框邊上有個 表達式... 的按鈕。點進去,裏面個個都是人才 :)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章