規則目的
|
使用 BPF 進行篩選
|
使用正規表達式進行篩選
|
解釋
|
範例
|
按 IP 位址搜尋流量
|
host <位址>
|
|
<位址> 是 IPv4 位址
|
host 10.10.0.1
|
搜尋兩台主機之間的流量
|
host <位址 1> and host <位址 2>
|
|
<位址 1> 和<位址 2> 是 IPv4 位址
|
host 10.10.0.1 and host 10.10.0.2
|
搜尋單個 TCP 工作階段的流量
|
tcp <連接埠 1> and host <位址 1> and tcp <連接埠 2> and host <位址 2>
|
|
<位址 1> 和<位址 2> 是通訊 IPv4 位址<連接埠 1> 和<連接埠 2> 是通訊連接埠
|
tcp port 80 and tcp port 53567
and host 10.10.0.1 and host 10.10.0.2
|
按多個 IP 位址搜尋流量
|
host <位址1> or host <位址 2> or ... host <位址N>
|
|
<位址 1-N> 是 IPv4 位址
|
host 10.10.0.1 and host 10.10.0.2 and host 10.10.0.3
|
尋找來自一組主機的所有 DNS 查詢
|
udp and dst port 53 and ( src host <位址 1> or src host <位址 2> or ... src host <位址 N> )
|
|
<位址 1-N> 是 IPv4 位址
|
udp and dst port 53 and ( src host 10.10.0.1 or src host 10.10.0.2 )
|
搜尋 HTTP 流量
|
|
" HTTP/"
|
篩選器必須不帶引號使用
|
|
搜尋 DNS 流量
|
udp dst port 53 or tcp dst port 53
|
|
僅限標準 DNS
|
|
使用針對特定網域的 GET 請求搜尋 HTTP 流量
|
tcp port 80 or tcp port 8000 or tcp port 8080 or tcp port 8888
|
GET.{1,1000}<網域>
|
<網域> 要找到的網域
|
|
搜尋特定主機的 ICMP 流量
|
icmp and host <位址>
|
|
<位址> 是 IPv4 位址
|
icmp and host 10.10.10.1
|
搜尋以純文字傳輸的身分驗證資料
|
tcp port 80 or tcp port 8000 or tcp port 8080 or tcp port 8888 or port ftp or port smtp or port imap or port pop3 or port
telnet
|
"pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|username:|password:|Username:|Password:|login:|pass |user|VXNlcm5hbWU6|UGFzc3dvcmQ6|LOGIN |USER|PASS "
|
篩選器必須不帶引號使用
|
|
搜尋主機作為用戶端的 TCP 工作階段
|
tcp[tcpflags] = tcp-syn and host <address>
|
|
<位址> 是 IPv4 位址
|
tcp[tcpflags] = tcp-syn and host 10.10.10.1
|
在給定子網路中搜尋 HTTP 流量
|
net xx.xx.xx.xx/yy and ( port 8080 or port 80 )
|
|
xx.xx.xx.xx/yy 是帶遮罩的 IPv4 子網路
|
net 10.10.10.0 /24 and ( port 8080 or port 80 )
|
搜尋本機互動流量
|
ip and src net (10 or 172.16/12 or 192.168/16) and dst net (10 or 172.16/12 or 192.168/16)
|
|
|
|
搜尋與網路上物件互動的流量
|
ip and not (src net (10 or 172.16/12 or 192.168/16) and dst net (10 or 172.16/12 or 192.168/16)) and not multicast and not broadcast and not net 169.254/16
|
|
|
|
根據 HTTP 流量中的 UserAgent 欄位搜尋流量
|
使用者代理:
|
|
|
|