我需要捕捉长度等于包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