我需要捕捉長度等於包16個字節tcpdump的:精確匹配數據包長度
越接近我想出了是這樣的:
tcpdump -ni lo -ttt dst port 1337 and greater 16
如果我添加其他過濾器,以配合我會喜歡:
tcpdump -ni lo -ttt dst port 1337 and greater 16 and not greater 17
tcpdump -ni lo -ttt dst port 1337 and \(greater 16 and not greater 17\)
tcpdump -ni lo -ttt dst port 1337 and greater 16 and less 16
它根本沒有顯示任何數據包。
Althought,使用:
tcpdump -ni lo -ttt dst port 1337 and less 16
似乎並沒有工作都不是,我實際上游蕩,如果少濾鏡......
歡迎任何幫助:)
我認爲長度包括所有的頭文件,而不僅僅是TCP數據,我不認爲你可能會看到只有16字節的數據包,以太網幀中的TCP段有18字節的以太網頭和尾部,至少16字節的TCP頭(通常更多的是因爲TCP選項) – Barmar
我應該精確地知道tcpdump將我發送的數據包看作是長度爲16字節的數據包,這就是爲什麼我要使用數據包長度對它們進行過濾的原因。通常的TCP層從總長度沒有?還是它顯示不相關的長度? – naab
是的,tcpdump做了很多decodi在它顯示給你之前,並顯示特定於協議的數據。但是這些過濾器是由一個對協議不太瞭解的底層庫實現的。 – Barmar