C# 过滤提琴手以仅捕获特定域的请求
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/746540/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Filtering fiddler to only capture requests for a certain domain
提问by CVertex
I'm not sure how to modify the CustomRules.js file to only show requests for a certain domain.
我不确定如何修改 CustomRules.js 文件以仅显示对某个域的请求。
Does anyone know how to accomplish this?
有谁知道如何做到这一点?
采纳答案by Terrence
This is easy to do. On the filters tab, click "show only if the filter contains, and then key in your domain.
这很容易做到。在过滤器选项卡上,单击“仅在过滤器包含时才显示”,然后键入您的域。
回答by Marc Gravell
edit
编辑
Turns out it is quite easy; edit OnBeforeRequest
to add:
事实证明这很容易;编辑OnBeforeRequest
添加:
if (!oSession.HostnameIs("www.google.com")) {oSession["ui-hide"] = "yup";}
filters to google, for example.
例如,过滤到谷歌。
(original answer) I honestly don't know if this is something that Fiddler has built in (I've never tried), but it is certainly something that Wiresharkwill do pretty easily - of course, you get different data (in particular for SSL) - so YMMV.
(原始答案)老实说,我不知道这是否是 Fiddler 内置的东西(我从未尝试过),但Wireshark肯定会很容易地做到这一点 - 当然,你会得到不同的数据(特别是对于SSL) - 所以YMMV。
回答by Simon Lieschke
The Fiddler site has a cookbook of a whole bunch of things that you can do with CustomRules.js
, including how to do exactly this :)
Fiddler 网站有一本食谱,里面有很多你可以做的事情CustomRules.js
,包括如何做到这一点:)
回答by Matas Vaitkevicius
My answer is somewhat similar to @Marc Gravels, however I prefer to filter it by url containing some specific string.
我的回答有点类似于@Marc Gravels,但是我更喜欢通过包含一些特定字符串的 url 来过滤它。
- You will need fiddler script - it's an add-on to fiddler.
When installed go to fiddler script tag and paste following into
OnBeforeRequest
function. (Screenshot below)if (oSession.url.Contains("ruby:8080") || oSession.url.Contains("localhost:53929")) { oSession["ui-hide"] = "yup"; }
- 您将需要fiddler 脚本 - 它是 fiddler 的附加组件。
安装后转到 fiddler 脚本标签并将以下内容粘贴到
OnBeforeRequest
函数中。(截图如下)if (oSession.url.Contains("ruby:8080") || oSession.url.Contains("localhost:53929")) { oSession["ui-hide"] = "yup"; }
This way you can filter by any part of url be it port hostname or whatever.
通过这种方式,您可以按 url 的任何部分进行过滤,无论是端口主机名还是其他任何内容。
Hope this saves you some time.
希望这可以为您节省一些时间。