日期:2014-05-16  浏览次数:20606 次

关于 tcpdump 抓到的包有些不是我想要的,应该怎么去写?
tcpdump -s 5120 host 192.168.0.5 and 192.168.0.51 -X
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 5120 bytes
15:26:52.020068 IP .35986 > 192.168.0.51.15711: P 1:28(27) ack 1 win 1460 <nop,nop,timestamp 147403691 0>
  0x0000: 4500 004f b688 4000 4006 3c33 627e f94a E..O..@.@.<3b~.J
  0x0010: deba 0d6a 8c92 3d5f 7eb3 84d5 e6e7 228e ...j..=_~.....".
  0x0020: 8018 05b4 482f 0000 0101 080a 08c9 33ab ....H/........3.
  0x0030: 0000 0000 aa55 0015 a0e8 8800 0000 650d .....U........e.
  0x0040: 3938 2e31 3236 2e32 3439 2e37 3455 aa 98.126.249.74U.

如何在拦截的时候取到我想要的封包,前面的封包不是我想要的。命令应该怎么去写?
端口是15711

下面是我想要的封包。
  aa55 0015 a0e8 8800 0000 650d .....U........e.
  0x0040: 3938 2e31 3236 2e32 3439 2e37 3455 aa 98.126.249.74U.


------解决方案--------------------
http://www.linuxso.com/command/tcpdump.htmlhttp://www.linuxso.com/command/tcpdump.html

http://doc.linuxpk.com/5047.html


------解决方案--------------------
如果有明确的规则的话,写个脚本来删除不必要的信息就好了。或者将需要的内容另存到文件。
------解决方案--------------------
C/C++ code
tcpdump tcp and port 5120 and host 192.168.0.5 and 192.168.0.51 -X