【问题标题】:How to read the interface name from a .pcapng file using tshark?如何使用 tshark 从 .pcapng 文件中读取接口名称?
【发布时间】:2019-06-28 21:48:54
【问题描述】:

我正在尝试运行这个tshark 命令:

tshark -r $file -T fields -E separator=/t -e frame.number -e frame.time -e frame.protocols -e frame.len -e frame.interface_id -e frame.interface_name

我收到此警告:

** (process:30955): WARNING **: 'frame.interface_name' isn't a valid field! tshark: Some fields aren't valid

但是当我在Wireshark 中打开文件时,我能够看到该字段?

访问 interface_name 信息的正确方法是什么?

我正在使用以下 tshark 版本 -

TShark 1.12.1 (Git Rev Unknown from unknown)

Copyright 1998-2014 Gerald Combs <gerald@wireshark.org> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GLib 2.32.4, with libpcap, with libz 1.2.7, with POSIX
capabilities (Linux), with libnl 3, with SMI 0.4.8, with c-ares 1.9.1, with Lua
5.2, without Python, with GnuTLS 2.12.20, with Gcrypt 1.5.0, with MIT Kerberos,
with GeoIP.

Running on Linux 3.16.7-cb2000v1, with locale en_US.UTF-8, with libpcap version
1.3.0, with libz 1.2.7.
Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz

Built using gcc 4.7.2.

我尝试更新wireshark -

$ sudo apt-get install wireshark Reading package lists... Done Building dependency tree
Reading state information... Done wireshark is already the newest version. You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: isc-dhcp-relay : Depends: isc-dhcp-common (= 4.2.2.dfsg.1-5+deb70u8) but 4.2.2.dfsg.1-5+deb70u8 is to be installed isc-dhcp-server : Depends: isc-dhcp-common (= 4.2.2.dfsg.1-5+deb70u8) but 4.2.2.dfsg.1-5+deb70u8 is to be installed libsnmp-perl : Depends: perl (>= 5.14.2-21+deb7u5) but 5.14.2-21+deb7u3 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

上面写着wireshark is already the newest version

这是机器的 linux 操作系统详细信息: Distributor ID: Debian Description: Debian GNU/Linux 7.8 (wheezy) Release: 7.8 Codename: wheezy

【问题讨论】:

    标签: wireshark pcap packet-capture tshark pcap-ng


    【解决方案1】:

    您使用的是哪个版本的tshark?运行tshark -v进行检查。

    frame.interface_name 显示过滤器仅从版本 2.4.0 开始可用,所以您的 %PATH% 中可能有旧版本的 tshark

    请注意,您可以在 Wireshark Display Filter Reference 页面上检查任何显示过滤器的可用性。

    【讨论】:

    • 我已经用您要求的详细信息更新了问题。是的,tshark 版本是 1.2.1。但它不允许更新。它说是wireshark is already the newest version 你是对的,我本地桌面上的 tshark 版本是 2.6.6。如果我将 .pcapng 文件下载到本地桌面并运行原始命令,这将允许应用过滤器。我该怎么做才能在远程 Debian 机器上强制执行 wireshark 更新?
    • 我主要在 Windows 平台上工作,所以我不熟悉 Debian 更新的工作原理。如果您找不到下载软件包的方法,您可以只下载 Wireshark 源代码,然后自己编译和安装 Wireshark。在这种情况下,您可能希望查看 Wireshark 开发人员指南:wireshark.org/docs/wsdg_html_chunked
    猜你喜欢
    • 2020-02-13
    • 2020-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多