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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 23:36:15  来源:igfitidea点击:

Filtering fiddler to only capture requests for a certain domain

c#.netwindowsfiddler

提问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.

这很容易做到。在过滤器选项卡上,单击“仅在过滤器包含时才显示”,然后键入您的域。

enter image description here

在此处输入图片说明

回答by Marc Gravell

edit

编辑

Turns out it is quite easy; edit OnBeforeRequestto 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 来过滤它。

  1. You will need fiddler script - it's an add-on to fiddler.
  2. When installed go to fiddler script tag and paste following into OnBeforeRequestfunction. (Screenshot below)

     if (oSession.url.Contains("ruby:8080") || oSession.url.Contains("localhost:53929")) {  oSession["ui-hide"] = "yup";    }
    
  1. 您将需要fiddler 脚本 - 它是 fiddler 的附加组件
  2. 安装后转到 fiddler 脚本标签并将以下内容粘贴到OnBeforeRequest函数中。(截图如下)

     if (oSession.url.Contains("ruby:8080") || oSession.url.Contains("localhost:53929")) {  oSession["ui-hide"] = "yup";    }
    

enter image description here

在此处输入图片说明

This way you can filter by any part of url be it port hostname or whatever.

通过这种方式,您可以按 url 的任何部分进行过滤,无论是端口主机名还是其他任何内容。

Hope this saves you some time.

希望这可以为您节省一些时间。

回答by Ajit Goel

You can filter the requests using the filter tab in fiddler. Please see screenshots below. If you are using google chrome, be sure to use the correct process id in fiddler(from google chrome).

您可以使用 fiddler 中的过滤器选项卡过滤请求。请看下面的截图。如果您使用的是 google chrome,请务必在 fiddler(来自 google chrome)中使用正确的进程 ID。

enter image description hereenter image description hereenter image description here

在此处输入图片说明在此处输入图片说明在此处输入图片说明