Click here to Skip to main content
15,885,366 members
Articles / Programming Languages / C#

Fiddler Extension - Fiddler Tap

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
1 Aug 2011CPOL2 min read 19.4K   534   8  
Fiddler extension to tap all traffic to other host

Introduction

Fiddler is a good web debugging proxy. It is easy to use since it uses WinINET layer to capture all web traffic. However, as times goes on, it is not easy to find the session so we need to transform the data to another format and store in database. This article is to illustrate how to use the IFiddlerExtension and IAutoTamper interface to write our own plugin.

Background

The idea to tap the traffic to other host is to use HTTP post to send all related information stored in sessions to remote server. Host url is configured in the textbox of tap of fiddlertap. However, each post takes time since there is network latency. To avoid the performance deduction of Fiddler due to fiddlertap, use event to call another subroutine indirectly to avoid blocking.

Using the Code

I have attached the compiled extension and source code with zipped format separately.

You can simply put the compiled DLL in the Scripts folder of Fiddler. There will be a new tap in Fiddler.

fiddlertap.png

Each callback from FiddlerApplication will block the process of next session. Otherwise it will affect the performance of Fiddler itself. However, the idea of this plugin is to tap the session to remote host. There will be network latency when sending session's information. So we use non-block event handling to release the callback and use our own callback to process. As a result, you will see some new coming session finished their transaction before older session's transaction.

First, we have to define an event. We have to define an event object, event handler and event argument.

C#
public static event TapPacketHandler EventTapPacket;
public delegate void TapPacketHandler(object o, TapPacketEventArgs e);
public class TapPacketEventArgs : EventArgs
{
    public readonly Session theSession;

    public TapPacketEventArgs(Session s)
    {
        theSession = s;
    }
}

Second, we trigger an event inside AutoTamperResponseAfter.

C#
public void AutoTamperResponseAfter(Session oSess) {
   if (EventTapPacket != null && !bSwitch)
   {
       EventTapPacket(new object(), new TapPacketEventArgs(oSess));
   }
}

History

  • July 30, 2011 - This is the first version of the Fiddler extension, FiddlerTap

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Nokia Siemens Networks
Hong Kong Hong Kong
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --