Wireshark过滤器:获取过滤前发送的数据包
我正在尝试在 Wireshark 中创建一个过滤器,它将捕获所有返回“错误:STATUS_NO_SUCH_FILE”的 SMB 响应。我还希望能够在过滤数据包之前抓取数据包。这是一个示例:
No. Time Source Destination Proto. Length Info
26482 24.832997 192.168.1.62 192.168.1.4 SMB 288 Trans2 Request, QUERY_PATH_INFO, Query File Basic Info, Path: \1_CLIENTS\CLIENTS\ACME INC
26483 24.833122 192.168.1.4 192.168.1.62 SMB 158 Trans2 Response, QUERY_PATH_INFO
26484 24.833232 192.168.1.62 192.168.1.4 SMB 306 Trans2 Request, FIND_FIRST2, Pattern: \1_CLIENTS\CLIENTS\ACME INC\<.AC_
26485 24.833909 192.168.1.4 192.168.1.62 SMB 126 Trans2 Response, FIND_FIRST2, Error: STATUS_NO_SUCH_FILE
以下过滤器抓取“STATUS_NO_SUCH_FILE”数据包:
((ip.src == 192.168.1.4) && (ip.dst == 192.168.1.62)) || ((ip.src == 192.168.1.62) && (ip.dst == 192.168.1.4)) && (smb.nt_status == 0xC000000F)
但我也想获取该数据包之前的数据包,以便我知道找不到哪个文件路径。
I am trying to create a filter in Wireshark that will grab all SMB responses that return "Error: STATUS_NO_SUCH_FILE". I would also like the be able to grab the packet before the filtered ones. Here's an example:
No. Time Source Destination Proto. Length Info
26482 24.832997 192.168.1.62 192.168.1.4 SMB 288 Trans2 Request, QUERY_PATH_INFO, Query File Basic Info, Path: \1_CLIENTS\CLIENTS\ACME INC
26483 24.833122 192.168.1.4 192.168.1.62 SMB 158 Trans2 Response, QUERY_PATH_INFO
26484 24.833232 192.168.1.62 192.168.1.4 SMB 306 Trans2 Request, FIND_FIRST2, Pattern: \1_CLIENTS\CLIENTS\ACME INC\<.AC_
26485 24.833909 192.168.1.4 192.168.1.62 SMB 126 Trans2 Response, FIND_FIRST2, Error: STATUS_NO_SUCH_FILE
The following filter grabs the "STATUS_NO_SUCH_FILE" packets:
((ip.src == 192.168.1.4) && (ip.dst == 192.168.1.62)) || ((ip.src == 192.168.1.62) && (ip.dst == 192.168.1.4)) && (smb.nt_status == 0xC000000F)
But I would also like to get the packet previous to that one as well so I know which file path wasn't found.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Wireshark 发行版的一部分 TShark 来获取概述.
运行以下命令:
$ tshark -r FS01-Test.pcap -R smb.nt_status==0xc000000f -T 字段 -e 帧.编号 -e smb.nt_status -e smb.response_to -E header=y -E 分隔符=, > smb.csv
输出:
帧号、smb.nt_status、smb.response_to
6242,0xc000000f,6238
6247,0xc000000f,6246
6331,0xc000000f,6269
6338,0xc000000f,6336
另一个例子:
$ tshark -r FS01-Test.pcap -R smb.nt_status==0xc000000f -T 字段 -e 帧.编号 -e smb.nt_status -e smb.response_to -e smb.search_pattern -E header=y -E 分隔符=, > smb02.csv
输出:
frame.number、smb.nt_status、smb.response_to、smb.search_pattern
6242,0xc000000f,6238,\\B\\Di\\文件夹.jpg
6247,0xc000000f,6246,\\B\\Di\\文件夹.gif
6331,0xc000000f,6269,\\B\\Ex\\文件夹.jpg
6338,0xc000000f,6336,\\B\\Ex\\文件夹.gif
You can use TShark, part of the Wireshark distribution, to get an overview.
Run the following command:
$ tshark -r FS01-Test.pcap -R smb.nt_status==0xc000000f -T fields -e frame.number -e smb.nt_status -e smb.response_to -E header=y -E separator=, > smb.csv
Output:
frame.number,smb.nt_status,smb.response_to
6242,0xc000000f,6238
6247,0xc000000f,6246
6331,0xc000000f,6269
6338,0xc000000f,6336
Another example:
$ tshark -r FS01-Test.pcap -R smb.nt_status==0xc000000f -T fields -e frame.number -e smb.nt_status -e smb.response_to -e smb.search_pattern -E header=y -E separator=, > smb02.csv
Output:
frame.number,smb.nt_status,smb.response_to,smb.search_pattern
6242,0xc000000f,6238,\\B\\Di\\folder.jpg
6247,0xc000000f,6246,\\B\\Di\\folder.gif
6331,0xc000000f,6269,\\B\\Ex\\folder.jpg
6338,0xc000000f,6336,\\B\\Ex\\folder.gif