我跟踪了正式文件。
我的远程服务器是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.
我的本地wireshark软件显示了错误:
编辑-01
我使用以下命令对接口进行特殊设置:
ssh root@remote-server-name -i .ssh/id_rsa 'dumpcap -w - -f "not port 22"' | wireshark -k -i em1
但是wireshark说没有这样的装置:
在我的服务器中确实存在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
发布于 2020-09-18 10:26:02
错误信息是解释无法捕获的原因:
捕获'nflog‘垃圾箱盖:无效的捕获过滤器“非端口22”的接口nflog!
在远程服务器上执行的dumpcap命令没有参数-i <interface>
,这意味着dumpcap将在查找中选择第一个接口。在这种情况下,接口nflog
。
所有捕获过滤器都是基于接口的链接层类型编译的,因为某些筛选器元素仅在特定链路层类型的接口上可用。
在这种情况下,捕获过滤器not port 22
不是接口nflog的链路层类型的有效捕获筛选器。
我想您是想在远程主机的以太网接口上捕获。可以使用命令dumpcap -D
列出远程主机上的接口。选择要捕获的接口,然后将参数-i <interface>
添加到远程捕获命令中的dumpcap命令中。
https://stackoverflow.com/questions/63918952
复制