基於名稱的HTTP顯示過濾器
1、讓wireshark只顯示訪問某指定域名(www.bt2bn.cn)的HTTP請求數據包:http.host == “www.bt2bn.cn”.
2、讓wireshark只顯示訪問包含了指定字符串的域名(比如,包含bt2bn的域名)的HTTP請求數據包:http.host contains “bt2bn”.
3、讓wireshark只顯示Referer頭部內容為“http://www.bt2bn.cn/“的HTTP請求數據包:http.referer == “http://www.bt2bn.cn/”
基於HTTP請求方法的顯示過濾器
1、要讓wireshark顯示包含GET請求的所有HTTP數據包,顯示過濾器的寫法為:http.request.method == GET。
2、要讓Wireshark顯示所有HTTP請求數據包,顯示過濾器的寫法為:http.request。
3、要讓Wireshark顯示所有HTTP響應數據包,顯示過濾器的寫法為:http.response。
4、要讓Wireshark顯示包含所有HTTP數據包,但包含GET方法的HTTP請求數據包除外,顯示過濾器的寫法為:http.request and not http.request.method == GET。
基於HTTP狀態碼的顯示過濾器
1、要讓Wireshark顯示包含HTTP錯誤狀態碼的HTTP響應數據包:http.request.code >= 400。
2、要讓Wireshark只顯示包含HTTP客戶端錯誤狀態碼的HTTP響應數據包:http.response.code >=400 and http.response.code <= 499。
3、要讓Wireshark只顯示包含HTTP服務器端錯誤狀態碼的HTTP響應數據包:http.response.code <=599。
4、要讓Wireshark只顯示狀態碼為404的HTTP響應數據包:http.response.code == 404。
5、過濾所有的http響應包:http.response==1
6、過濾所有的http請求,貌似也可以使用http.request:http.request==1
7、wireshark過濾所有請求方式為POST的http請求包,注意POST為大寫:http.request.method==POST
8、過濾含有指定cookie的http數據包:http.cookie contains guid
9、過濾請求的uri,取值是域名后的部分:http.request.uri==”/online/setpoint”
10、過濾含域名的整個url則需要使用http.request.full_uri:http.request.full_uri==” http://task.browser.360.cn/online/setpoint”
11、過濾http頭中server字段含有nginx字符的數據包:http.server contains “nginx”
12、過濾content_type是text/html的http響應、post包,即根據文件類型過濾http數據包:http.content_type == “text/html”
13、過濾content_encoding是gzip的http包:http.content_encoding == “gzip”
14、根據transfer_encoding過濾:http.transfer_encoding == “chunked”
15、根據content_length的數值過濾:http.content_length == 279 或 http.content_length_header == “279″
16、過濾所有含有http頭中含有server字段的數據包:http.server
17、過濾HTTP/1.1版本的http包,包括請求和響應:http.request.version == “HTTP/1.1″
18、過濾http響應中的phrase:http.response.phrase == “OK”
19、顯示前1000個數據包:fream.number <= 1000
20、顯示序列號10-20內的數據包:fream.number <= 10 and fream.number <= 20
資料來源:
https://blog.csdn.net/bt517840374/java/article/details/80273942
https://www.magentonotes.com/wireshark-filter-http-packet.html