如何使 tcpdump(或其他工具)实际转储 TCP 流?

Vi.*_*Vi. 6 linux sniffing tcp tcpdump

我期待这样的事情:

$ nc example.com 80
GET / HTTP/1.0

HTTP/1.0 500 K.O.
Content-Type: application/null
Content-Length: -1
$ 

Meanwhile: 
# tcpdump -i eth0 --actually-dump-all-tcp
217.21.51.1:56812->192.0.43.10:80 GET / HTTP/1.0
217.21.51.1:56812->192.0.43.10:80 
217.21.51.1:56812<-192.0.43.10:80 HTTP/1.0 500 K.O.
217.21.51.1:56812<-192.0.43.10:80 Content-Type: application/null
217.21.51.1:56812<-192.0.43.10:80 Content-Length: -1
Run Code Online (Sandbox Code Playgroud)

现在我使用 Wireshark,但是在加载连接时,cat 完成了几次。

小智 10

尝试

tcpflow -v -i iface

这将创建许多文件名类似于“IP_A.port.-IP_B.port”的文件。


new*_*456 4

tcpdump通常显示数据包信息,而不是实际数据。

使用该-A标志转储 ASCII 内容。它仍然会转储许多其他数据(例如 ARP 和 DNS 数据包),但您应该能够通过过滤器获得您想要的数据。