Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Building a Custom Fiddler Inspector Plugin for Request Inspection

Tech May 16 1

Fiddler is a powerful web debugging proxy that supports extensibility through .NET-based plugins. This article walks through building a custom inspector plugin—designed to display raw HTTP request bodies in a dedicated tab—using the Inspector2 and IRequestInspector2 interfaces. Unlike global extensions, inspector plugins apear under the Inspectors tab alongside built-in views like TextView or Headers, making them ideal for per-session analysis.

Plugin Architecture Overview

Fiddler organizes extensions into distinct categories based on scope and lifecycle:

  • Global Extensions: Implement IFiddlerExtension, IAutoTamper, etc. Loaded once at startup; appear in main toolbars or menus.
  • Inspector Plugins: Implement Inspector2 + IRequestInspector2 (or IResponseInspector2). Bound to individual sessions; rendered inside the Inspectors pane.
  • Commmand Handlers: Use IHandleExecAction to respond to FiddlerScript commands.
  • Import/Export Modules: Implement ISessionImporter/ISessionExporter for bulk session handling.

Development Setup

This example targets Fiddler v5.0.20173.49666, which requires .NET Framework 4.6.1. Lower framework versions trigger compatibility warnings during load.

  1. Create a new Class Library (.NET Framework) project in Visual Studio.
  2. Add a reference to Fiddler.exe (typically located in C:\Program Files\Fiddler2\Fiddler.exe).
  3. In AssemblyInfo.cs, declare version compatibility:
[assembly: Fiddler.RequiredVersion("5.0.20173.49666")]

Implementing the Inspector

Define a Windows Forms UserControl named BodyViewerControl containing a public RichTextBox named rtbContent.

Then implement the inspector class:

using System;
using System.Windows.Forms;
using Fiddler;

namespace FiddlerInspectorPlugin
{
    public class BodyInspector : Inspector2, IRequestInspector2
    {
        private HTTPRequestHeaders _requestHeaders;
        private byte[] _requestBody;
        private bool _isDirty = true;
        private readonly BodyViewerControl _uiControl = new BodyViewerControl();

        public HTTPRequestHeaders headers
        {
            get => _requestHeaders;
            set => _requestHeaders = value;
        }

        public byte[] body
        {
            get => _requestBody;
            set
            {
                _requestBody = value ?? Array.Empty<byte>();
                var text = Encoding.UTF8.GetString(_requestBody);
                _uiControl.rtbContent.Text = text;
            }
        }

        public bool bDirty => _isDirty;
        public bool bReadOnly => true;

        public override void AddToTab(TabPage tabPage)
        {
            tabPage.Text = "Request Body";
            _uiControl.Dock = DockStyle.Fill;
            tabPage.Controls.Add(_uiControl);
        }

        public void Clear()
        {
            _uiControl.rtbContent.Clear();
        }

        public override int GetOrder() => 95;
    }
}

The GetOrder() method controls tab ordering—lower values appear earlier. Here, 95 places it just before TextView (which defaults to 100).

Deployment

After compiling, copy the resulting .dll in to Fiddler’s Inspectors folder (e.g., C:\Program Files\Fiddler2\Inspectors\). Restart Fiddler. When selecting any captured session, a new tab labeled Request Body appears under the Inspectors section, displaying the decoded UTF-8 request payload.

This foundation can be extended—for example, by adding syntax highlighting, JSON/XML formatting, or exporting logic—to support downstream test generation workflows.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.