过滤 tcpdump 输出 (PCAP)

过滤 tcpdump 输出 (PCAP)

以下是我的 PCAP 文件的输出。

20:02:52.306161 192.162.70.150.58078 > 192.179.91.61.1194: P 635362993:635363048(55) ack 2046024708 win 4373 <nop,nop,timestamp 52993632 1059054949> (DF)
20:02:52.532863 192.179.91.61.1194 > 192.162.70.150.58078: . ack 55 win 32038 <nop,nop,timestamp 1059062357 52993632> (DF)
20:02:53.157004 802.1d unknown version
20:02:54.759542 arp who-has 192.168.70.34 tell 192.168.70.1
20:02:55.156980 802.1d unknown version
20:02:55.759507 arp who-has 192.168.70.6 tell 192.168.70.1
20:02:55.759540 arp who-has 192.168.70.105 tell 192.168.70.1
20:02:56.148167 192.179.91.61.1194 > 192.168.70.150.58078: P 1:56(55) ack 55 win 32038 <nop,nop,timestamp 1059065972 52993632> (DF)
20:02:56.148258 192.168.70.150.58078 > 192.179.91.61.1194: . ack 56 win 4373 <nop,nop,timestamp 52994592 1059065972> (DF)

有没有办法过滤掉以下模式的内容

Timestamp | source IP | source Port | destination IP | destination port | protocol | packet size

可用命令:tcpdumptcpslicetcpstattcpproftcpparse

答案1

要从命令行分析 tcpdump,tcpparse可以使用命令。例如:

# tcpparse tcpdump_file.pcap

6 192.135.33.41 132 > 192.168.20.119 1544 74
6 192.168.20.119 57604 > 192.135.33.41 1194 66
6 192.168.20.119 57604 > 192.135.33.41 1194 110
6 192.135.33.41 1194 > 192.168.20.119 57604 66
6 192.135.33.41 1194 > 192.168.20.119 57604 122
6 192.168.20.119 57604 > 192.135.33.41 1194 66
6 192.168.20.119 57604 > 192.135.33.41 1194 118

栏目解释:-

  1. 协议
  2. 源IP地址
  3. 源端口
  4. 目的IP地址
  5. 目的端口
  6. 数据包大小。

同样tcpdump -r也可以使用。

答案2

您可以更好地将捕获文件加载到wireshark中,它会在“对话”窗口中巧妙地为您完成此操作。

否则,看看这个线程: https://serverfault.com/questions/273066/tool-for-splitting-pcap-files-by-tcp-connection

相关内容