man wireshark
#只顯示有 IP 的包 ip
因有 IP 包就有 total length(IP 的 16-31 bit),所以跟上面相同
ip.len
TCP 有 maximum segment size 的 options(太大會 ip fragmentation)
tcp.options.mss_val
整數(IBM 的 Systems Network Architecture 協議,例為Transmission Group Segmenting Field)
sna.th.tgsf == 2 #或值 sna.th.tgsf == "First segment"
Booleans(例為 Sense Data Included)
sna.rh.sdi == 0 sna.rh.sdi == false #或值 sna.rh.sdi == "Not Included"
浮點數 (UNIX 的 rwho 協議,例為 Load Average Over Past 5/10 Minutes)
who.loadav_5 > 3.5 who.loadav_10 <= 10 who.loadav_10 <= 10.0
字串
sna.rh.csi == ASCII #Code Selection Indicator
sna.rh.sdi == "Not included" #Sense Data Included
http contains "\"Yes\""
frame contains "\0777" frame contains "xff"
http contains "\\begin" #\begin
過碌有數字的(例為 NetWare Core Protocol 協議)
ncp.directory_name matches "\d"
過碌以 F 或 f 開頭且含有數字
ncp.directory_name matches "^[Ff].*\d"
位元組,字節序列
eth.src == 00:09:f6:01:cc:b3
eth.src == sheep #wireshark 可給 MAC address 名稱,但在那?
Wireshark 會多加信息給各個包,如時,大小。。frame 會過碌全部包,包括 Wireshark 多加信息
frame contains "POST" frame contains 50:4f:53:54
http contains "GET"
http contains "User-Agent: Mozilla"
地址
ip.src == 192.168.1.1
DNS,hostname
ip.dst == sheep
ip.dst == www.oschina.net
ip.src == sheep or ip.dst == sheep
ip.addr 等於 ip.src 或 ip.dst
ip.addr == sheep
無類别域間路由,CIDR
ip.addr == 192.168.1.0/24 ip.addr == sheep/24
IPv6
ipv6.dst == 2::8100:2:30a:c392:fc5a or ipv6.dst == 2::8100:2:30a:c392:fc5a ipv6.addr == 2::8100:2:30a:c392:fc5a
IPX network 地址
ipx.src.net == 0xc0a82c00
時間
frame.time "Dec 31, 2003 05:03:00"
舆上個包比
frame.time_delta > 0.02
無值欄位
http contains "User-Agent: Mozilla"
值域
MAC 地址第一個兩位元與十六進位 aa 比較
eth.addr[0] == a
telnet 欄位第二個兩位元與十六進位 ff 比較
telnet[1] == ff
token ring 地址前三個兩位元與十六進位 00:06:29 比較
tr.addr[0:3] == 00:06:29
tr.addr[0-2] == 00:06:29
用冒號可免寫
eth[:2] == ff:ff http[10:] contains 00:01:02
token ring 地址第一個和第三個兩位元(或用逗號)舆十六進位 ff 和 ee 比較
tr[0] == ff or tr[2] == ee tr[0,2] == ff:ee
大用逗號
tr[0-2,4:3,7,9] == 01:02:03:04:05:06:07:08
邏輯運算符
ip.src == 192.168.1.1 and ip.dst == 192.168.2.2 ip.addr == 192.168.3.3 or p.addr == 192.168.1.4.4 not ncp.directory_name contains "System" not eth.dst eq ff:ff:ff:ff:ff:ff and ip.len gt 1000 不同於 not (eth.dst eq ff:ff:ff:ff:ff:ff and ip.len gt 1000)
重覆欄位
以下會抓包的任何 tcp 端口(來源和目地) “都” 不等於 80,所以等於沒有過碌,因有重覆欄位
tcp.port != 80
以下過碌掉 “有” tcp 端口等於 80 的包
not tcp.port == 80
Ethereal Packet Sniffing, Orebaugh