如何解决WireShark远程捕获失败:未实现NFLOG链接层类型过滤
我关注了the official documentation。
我的远程服务器是CentOS 7.9,我已经在其中安装了Wireshark。
我使用以下命令打开本地wireshark软件以捕获远程服务器的接口数据包:
ssh root@remote-server-name 'dumpcap -w - -f "not port 22"' | wireshark -k -i -
但是我得到了错误信息:
Capturing on 'nflog'
dumpcap: Invalid capture filter "not port 22" for interface nflog!
That string isn't a valid capture filter (NFLOG link-layer type filtering not implemented).
See the User's Guide for a description of the capture filter Syntax.
EDIT-01
我使用以下命令对界面进行特殊处理:
ssh root@remote-server-name -i .ssh/id_rsa 'dumpcap -w - -f "not port 22"' | wireshark -k -i em1
我的服务器中确实存在em1
。
[root@att ~]# ip a | grep em1
2: em1: <broADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
inet remote-ip/29 brd remote-ip scope global noprefixroute em1
解决方法
错误消息说明了无法捕获的原因:
在“ nflog” dumpcap上捕获:无效的捕获过滤器“不是端口22” 界面nflog!
在远程服务器上执行的dumpcap命令没有参数-i <interface>
,这意味着dumpcap将选择finds中的第一个接口。在这种情况下,界面为nflog
。
所有捕获过滤器都是根据接口的链路层类型进行编译的,因为某些过滤器元素仅在特定链路层类型的接口上可用。
在这种情况下,捕获过滤器not port 22
对于接口nflog的链路层类型不是有效的捕获过滤器。
我假设您打算在远程主机的以太网接口上进行捕获。您可以使用命令dumpcap -D
列出远程主机上的接口。选择要捕获的接口,然后将参数-i <interface>
添加到远程捕获命令中的dumpcap命令中。
将-f "not port 22"'
更改为-f 'not tcp port 22'"
可能只是拼写错误。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。