Mac wireShark 抓包使用

過濾規(guī)則:
-1.IP過濾,包括來源IP或者目標(biāo)IP等于某個(gè)IP;
-2.端口過濾;
-3.協(xié)議過濾tcp;
-4.包長度過濾;
-5.http模式過濾。

一、IP過濾:包括來源IP或者目標(biāo)IP等于某個(gè)IP

比如:ip.src addr==192.168.0.208 or ip.src addr eq 192.168.0.208 顯示來源IP

ip.dst addr==192.168.0.208 or ip.dst addr eq 192.168.0.208 顯示目標(biāo)IP

二、端口過濾:

比如:tcp.port eq 80 // 不管端口是來源的還是目標(biāo)的都顯示

tcp.port == 80

tcp.port eq 2722

tcp.port eq 80 or udp.port eq 80

tcp.dstport == 80 // 只顯tcp協(xié)議的目標(biāo)端口80

tcp.srcport == 80 // 只顯tcp協(xié)議的來源端口80

過濾端口范圍

tcp.port >= 1 and tcp.port <= 80

三、協(xié)議過濾:
tcp udp arp icmp http smtp ftp dns msnms ip ssl 等等

排除ssl包,如!ssl 或者 not ssl

四、包長度過濾:

比如:
udp.length == 26 這個(gè)長度是指udp本身固定長度8加上udp下面那塊數(shù)據(jù)包之和

tcp.len >= 7 指的是ip數(shù)據(jù)包(tcp下面那塊數(shù)據(jù)),不包括tcp本身

ip.len == 94 除了以太網(wǎng)頭固定長度14,其它都算是ip.len,即從ip本身到最后

frame.len == 119 整個(gè)數(shù)據(jù)包長度,從eth開始到最后

五、http模式過濾:

http.request.method == “GET”

http.request.method == “POST”

http.request.uri == “/img/logo-edu.gif”

http contains “GET”

http contains “HTTP/1.”

// GET包包含某頭字段

http.request.method == “GET” && http contains “Host: ”

http.request.method == “GET” && http contains “User-Agent: ”

// POST包包含某頭字段

http.request.method == “POST” && http contains “Host: ”

http.request.method == “POST” && http contains “User-Agent: ”

// 響應(yīng)包包含某頭字段

http contains “HTTP/1.1 200 OK” && http contains “Content-Type: ”

http contains “HTTP/1.0 200 OK” && http contains “Content-Type: ”

六、連接符 and / or

七、表達(dá)式:!(arp.src==192.168.1.1) and !(arp.dst.proto_ipv4==192.168.1.243)

八、expert.message是用來對(duì)info信息過濾,主要配合contains來使用
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容