Skip to main content

Setting Up mitmproxy with Network Traffic Analysis

·344 words·2 mins
Mitmproxy
UmmIt
Author
UmmIt
Loves to write about technology, and cybersecurity related topics :)
Table of Contents

Introduction
#

mitmproxy allows you to intercept and analyze network traffic between your browser and the internet. To set up mitmproxy with Firefox, you need to configure Firefox to use mitmproxy as a proxy. This enables mitmproxy to capture and display all HTTP and HTTPS requests made by Firefox.

Downloading mitmproxy
#

  1. Visit the official website at: https://mitmproxy.org/
  2. Download the Linux Binary file.
  3. Extract the tar.gz file with this command:
tar -xvf mitmproxy-10.1.6-linux-x86_64.tar.gz

Firefox - Proxy Configuration
#

  1. Open Firefox and go to the settings menu by clicking on the three horizontal lines in the upper right corner.

  2. Select Preferences or Options from the menu.

  3. In the Preferences or Options window, find and click on General in the left sidebar.

  4. Scroll down to the Network Settings section.

  5. Click on the Settings... button next to Configure how Firefox connects to the internet.

  6. In the Connection Settings window, select Manual proxy configuration.

  7. For both HTTP Proxy and HTTPS Proxy, enter the value 127.0.0.1 and set the port to 8080. The SOCKS Host just ignore.

Tips: Or just Set Also use this proxy for HTTPS.

  1. Click OK to close the Connection Settings window.

Running mitmproxy
#

There has a few options to use mitmproxy. I recommend use mitmdump for the terminal.

  1. Open a terminal.

  2. Navigate to the directory where mitmproxy is installed.

    cd mitmproxy-bin
    
  3. Run mitmproxy by executing the following command:

    ./mitmdump
    
  4. mitmproxy will start, and you will see information about the proxy, including the proxy address (e.g., http://127.0.0.1:8080).

  5. restart firefox.

Viewing Traffic in mitmproxy**
#

Try to browse the internet in Firefox (launch browser), mitmproxy will capture and display the traffic in the terminal where mitmproxy is running.

For instance:

❯ ./mitmdump
[04:16:58.699] HTTP(S) proxy listening at *:8080.
[04:18:41.772][127.0.0.1:54868] client connect
[04:18:41.774][127.0.0.1:54876] client connect
[04:18:41.884][127.0.0.1:54868] server connect github.com:443 (20.27.177.113:443)

Exit mitmproxy
#

To exit mitmproxy, press Ctrl + C in the terminal where mitmproxy is running.

Conclusion
#

By following these steps, you have successfully configured Firefox to use mitmproxy as a proxy, allowing you to monitor and analyze the network traffic generated by your browser.

Related

A Crash Guide to Bypassing HLS Encryption video with FFMPEG
··355 words·2 mins
Ffmpeg Video Download
Resizing LVM and LUKS Encrypted Btrfs Filesystem
·383 words·2 mins
BTRFS LUKS Linux
Vim: A Quick Guide to Efficient Text Editing
·538 words·3 mins
Vim Linux Terminal
Setting Up a Minecraft Server on VPS: A Comprehensive Guide
·670 words·4 mins
Games Minecraft VPS Self-Host
Full Disk Encryption with GRUB and Including /boot: Step-by-Step Guide
··567 words·3 mins
LUKS Linux Arch Linux