Unplanned
Last Updated: 03 Dec 2019 21:23 by Wojciech Rajchel
Wojciech Rajchel
Created on: 02 Dec 2019 15:41
Type: Bug Report
2
Capture Traffic in IIS Results in Endless Loop

Describe the bug
After following the steps in the Capture All IIS Traffic on the Web Server Forum Post Fiddler goes into an endless loop.

image

To Reproduce
Steps to reproduce the behavior:

  1. Disable the firewall on the IIS Web Server

  2. Edit machine.config proxy settings to point to 127.0.0.1:8888

    <system.net>
        <defaultProxy>
            <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
        </defaultProxy>
    </system.net>
  3. Set the WinHTTP Proxy Settings to point to 127.0.0.1:8888
    netsh winhttp set proxy 127.0.0.1:8888

  4. Change the IIS Site Bindings to an alternate Port. In this example, it is 8080
    IIS Bindings

  5. In Fiddler, execute !listen 80 in QuickExec
    Fiddler QuickExec

  6. Add Custom Rule to Forward Requests Received to WinHTTP Port. In this case, 8080

    static function OnBeforeRequest(oSession: Session) {
        
        // ...Code removed for brevity...
        if(oSession.host == "[INSERT_HOST_NAME_HERE].com:80")
        {
            oSession.host = "[INSERT_HOST_NAME_HERE].com:8080"  /// This is the Fiddler Port
        }
        
        // ...Code removed for brevity...    
    }

Expected behavior
Fiddler should capture all traffic to and from the web server. This configuration should configure Fiddler as both the normal proxy and reverse proxy simultaneously.

Desktop (please complete the following information):

  • OS: Windows Server 2012 R2
  • Browser: Any
  • Version: Any
2 comments
Wojciech Rajchel
Posted on: 03 Dec 2019 21:23

Thank you Eric. 

 

I will test it in a few days and if it works I will comment my thread and close it.

Eric
Posted on: 03 Dec 2019 18:57

Your code doesn't work properly, because you're doing an exact comparison of the Host value, which doesn't contain the port if it's the default (e.g. 80 for HTTP).

You should instead use

if (oSession.HostnameIs("win-628dvvtvrt7")) {
oSession.host = "win-628dvvtvrt7.com:8080"; // Point at IIS.
}