我有一个80GB的数据包捕获(libpcap),我想把它过滤到涉及特定的NFS文件/文件句柄的所有操作的一切。
我怎样才能做到这一点?
我知道以下关于我想要捕获的事实(以tshark显示格式):
nfs.name == ".o1_mf_1_1093__1366653401581181_.arc nfs.fh.hash == 0x5c191ad8 nfs.fhandle == 3a:4f:47:4c:20:11:7b:48:7f:88:4f:16:94:90:a0:34:9a:fa:cf:71:e1:6a:95:fc:3e:3b:4e:6a:bb:9c:c6:c4:49:db:80:ca
但我不知道如何告诉tshark给我适用的请求/回复/等等。
我试过了:
tshark -r ginormous.pcap -w 1366653401581181.pcap \ -R "nfs.fh.hash == 0x5c191ad8" \ -o nfs.file_name_snooping:TRUE \ -o nfs.file_full_name_snooping:TRUE \ -o nfs.fhandle_find_both_reqrep:TRUE
试图哄骗tshark做完整的graphics用户界面,但没有效果。
用tshark -r nfs.pcap -R'nfs.fh.hash == 0x5c191ad8'你可以得到所有的请求或者用fh回复。 对于更复杂的情况,我想你需要编写一些代码。 有一个很棒的工具http://git.linux-nfs.org/?p=mora/nfstest.git;a=summary
工作正在进行中:
tshark -r $BIGFILE -T fields -e rpc.xid -R "nfs.fh.hash == 0x5c191ad8" | \ tshark -r $BIGFILE -R "$(\ python -c 'import sys; xids = sys.stdin.readlines(); print("||".join(["rpc.xid=={0}".format(xid.strip()) for xid in xids]))'\ )"