Install mitmproxy on Ubuntu

mitmproxy is a man in the middle proxy server for debugging.

mitmproxy

To install mitmproxy on Ubuntu, run

sudo apt install mitmproxy -y

On Ubuntu 18.04, this is broken. To insall i created a virtualenv

mkdir -p  ~/www/mitmproxy
cd ~/www/mitmproxy
virtualenv --python=/usr/bin/python3 venv
source venv/bin/activate

Install mitmproxy inside virtualenv with

pip install mitmproxy

To start, run

mithproxy

This will listen proxy on port 8080, you can verify with command

netstat -lntp

If you get error like

boby@sok-01:~$ /home/boby/www/mitmproxy/venv/bin/mitmproxy
Error: mitmproxy requires a UTF console environment.
Set your LANG environment variable to something like en_US.UTF-8
boby@sok-01:~$ 

Run

export LANG=en_US.UTF-8
mitmproxy

To configure in browser, you can use it as HTTP proxy. Here is how i configure it on Firefox FoxyProxy.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *