Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process Filtering with Fiddler

Is there a way to filter out certain processes in Fiddler? Its very noisy currently, and I don't want it to show just one process.

like image 437
Jordan Avatar asked Dec 15 '10 14:12

Jordan


People also ask

Can Fiddler capture network traffic?

Yes. It supports traffic capturing on virtually any application that uses the system proxy.

What is Fiddler most used for?

The Fiddler tool helps you debug web applications by capturing network traffic between the Internet and test computers. The tool enables you to inspect incoming and outgoing data to monitor and modify requests and responses before the browser receives them.


1 Answers

The built-in Show only traffic from option is useful if your process never exits and always has the same PID. In my case, my HTTP client was starting and exiting frequently, so I added this custom FiddlerScript.

Go to Rules > Customize Rules... to start editing CustomRules.js.

Add this inside the Handlers class

class Handlers
{
    RulesString("&Process filter", true)
    RulesStringValue(0, "&Chrome", "chrome")
    RulesStringValue(1, "&Firefox", "firefox")
    RulesStringValue(2, "&Internet Explorer", "iexplore")
    RulesStringValue(3, "&Opera", "opera")
    RulesStringValue(4, "&PhantomJS", "phantomjs")
    RulesStringValue(5, "&Custom...", "%CUSTOM%")
    public static var sProcessName: String = null;

    // leave the rest of the Handlers class as-is
}

Add this inside the OnBeforeRequest function

static function OnBeforeRequest(oSession: Session) {
    if (null != sProcessName) {
        var processInfo = oSession["X-PROCESSINFO"];
        if(!processInfo || !processInfo.StartsWith(sProcessName + ":")){
            oSession["ui-hide"] = "true";
            FiddlerObject.StatusText = " Process filter: " + sProcessName;
        }
    }

    // leave the rest of the OnBeforeRequest function as-is
}

Fiddler will apply your changes as soon as you save the CustomRules.js file.

To use, go to Rules > Process Filter and choose a browser, or use Custom and type in your executable's basename (e.g. iexplore).

Filtering applies to requests that start after you choose a process. Previous requests and Fiddler Composer requests are not affected.

like image 76
Ben Hutchison Avatar answered Sep 23 '22 19:09

Ben Hutchison