How to Use Fiddler with PowerShell
Fiddler, a Web debugging proxy application, can act as a proxy and log the Web traffic that your computer sends and receives. While Fiddler is available as a graphical application, Fiddler’s developers also provide a .NET library known as FiddlerCore. You can use a third-party Fiddler PowerShell module to access and use the FiddlerCore library from PowerShell. The Fiddler module can start Fiddler, register it as a system proxy, log traffic, show it in the PowerShell window or save it to a text file, shut down Fiddler and disable it as a proxy.
Instructions
-
-
1
Download FiddlerCore from the Fiddler project website and install it to a directory on your computer. Make a note of the location you install FiddlerCore to.
-
2
Download the Fiddler.psm1 PowerShell module from the bottom of the Fiddler Using PowerShell page on the PowerShell.nu website. Place the downloaded Fiddler.psm1 file in the same directory you installed FiddlerCore to.
-
-
3
Open PowerShell from the Start menu, type the following command into the PowerShell window (replacing “C:\Directory\” with the path to the directory where you installed FiddlerCore) and press “Enter”:
Import-Module C:\Directory\Fiddler.psm1
-
4
Start Fiddler and register it as your system proxy by typing the following command into the PowerShell window (replacing “C:\Directory” with the path to the location of FiddlerCore) and pressing “Enter”:
Start-Fiddler -Path C:\Directory\FiddlerCore.dll -ListenPort 8888 -RegisterAsSystemProxy
-
5
Open Internet Explorer or another application that uses the system proxy and use the Internet or network. Fiddler logs all traffic. If an application doesn’t use the system proxy, you can specify a proxy address of localhost and a port of 8888 in its settings to direct its traffic through Fiddler.
-
6
Type “Receive-Fiddler” without quotes into the PowerShell window and press “Enter” to view the logged traffic in the PowerShell window. You can also use the following command to write the logged traffic to a text file on your computer, replacing “c:\example.txt” with a location for the text file:
Receive-Fiddler | Out-File c:\example.txt
-
7
Type “Stop-Fiddler” into the PowerShell window and press “Enter” when you’re done. This command stops Fiddler and disables the Fiddler proxy. If you close PowerShell without stopping Fiddler, you’ll have to change your system proxy manually or connections will fail. If you specified Fiddler as a proxy manually in any application, remove the Fiddler proxy settings from that application.
-
1
References
Resources
- Photo Credit Comstock/Comstock/Getty Images