tshark 数据包捕获过滤器按请求 url

vbN*_*bie 4 rest packet-capture tshark

我试图只捕获包含对某个 API 端点的请求的数据包,因此尝试使用以下内容进行过滤:

 tshark -i 2 -f 'port 80' -T pdml http.request.uri contains "/google/"
Run Code Online (Sandbox Code Playgroud)

但是我不断收到以下错误:

tshark: A capture filter was specified both with "-f" and with additional 
command-line arguments.
Run Code Online (Sandbox Code Playgroud)

尝试删除 -f,但这也无济于事。有什么建议?

例如网址:https : //testAPI.com/termsearch/google/application

Chr*_*ard 5

你的tshark命令不正确。要指定 Wireshark 显示过滤器,您需要使用该-Y选项。

视窗:

tshark -i 2 -T pdml -Y "http.request.uri contains \"/google/\""
Run Code Online (Sandbox Code Playgroud)

*尼克斯:

tshark -i 2 -T pdml -Y 'http.request.uri contains "/google/"'
Run Code Online (Sandbox Code Playgroud)