首页 文章

如何将pcap文件转换为nfcapd文件

提问于
浏览
1

我有一个大小为1.4 GB的pcap文件 . 我想将此文件转换为nfcapd . 但我不能转换它 .

首先,我打字

nfcapd -p 12345 -l ./

然后计算机连续创建一些nfcapd文件 . 我在2天前尝试过,计算机一直在创建nfcapd文件,直到今天 . 然后我停止了这个过程 . 然后我试了一下

softflowd -n localhost:12345 -r myFile.pcap

然后终端出错

不支持的数据链接类型104

你有什么想法通过终端将其转换为nfcapd吗?

我正在使用Debian Linux 64位操作系统 .

2 回答

  • 1

    You could have nfcapd read the pcap file directly 并按照您在配置中指定的方式保存它(Netflow v5或v9.IPFIX支持目前只是实验性的) .

    根据nfcapd的手册页:

    -f <pcap_file>从给定的pcap_file而不是网络中读取netflow数据包 . 这需要使用pcap选项编译nfcapd,仅用于调试 .

    如果您通过数据包存储库安装了 nfdump ,则很可能没有使用所需的 --enable-readpcap 标志(默认情况下关闭)进行编译 .

    尝试从here下载源代码并自行编译 .

  • 3

    仅供参考,在我的x86_64 Fedora 26上,我需要使用 nfpcapd (注意额外的 p )将 pcap 文件转换为netflow文件 .

    $ mkdir sipp
    
    $ nfpcapd -l sipp -r /usr/share/sipp/pcap/g711a.pcap
    Add extension: 2 byte input/output interface index
    Add extension: 4 byte input/output interface index
    Add extension: 2 byte src/dst AS number
    Add extension: 4 byte src/dst AS number
    Add extension: 4 byte output bytes
    Add extension: 8 byte output bytes
    Add extension: NSEL Common block
    Add extension: NSEL xlate ports
    Add extension: NSEL xlate IPv4 addr
    Add extension: NSEL xlate IPv6 addr
    Add extension: NSEL ACL ingress/egress acl ID
    Add extension: NSEL username
    Add extension: NSEL max username
    Add extension: NEL Common block
    Startup.
    [140499169166528] WaitDone() waiting
    pcap_next_ex() end of file
    Packet processing stats: Total: 236, Skipped: 0, Unknown: 0, Short snaplen: 0
    Packet processing stats: Total: 236, Skipped: 0, Unknown: 0, Short snaplen: 0
    Terminating packet dumping: exit: 0
    [140499169166528] WaitDone() signal 10
    Exit status thread[140498942019328]: 0
    [140498950412032] Signal handler: 12
    Nodes in use: 1, Flows: 1 CacheOverflow: 0
    Ident: 'none' Flows: 1, Packets: 236, Bytes: 61360, Max Flows: 1
    Terminating flow processng: exit: 0
    Exit status thread[140498950412032]: 0
    Terminating nfpcapd.
    
    $ nfdump -v sipp/nfcapd.200207260815 
    File    : sipp/nfcapd.200207260815
    Version : 1 - not compressed
    Blocks  : 1
     Type 1 : 0
     Type 2 : 1
     Type 3 : 0
    Records : 2
    

相关问题