Install MITM Proxy on ANY Linux (the EASY & PROPER way!) Man in the Middle Proxy Server for Arch Linux

The best way to install Man in the Middle proxy for Arch Linux is using pipenv. This is because Arch is a rolling reserve and when you update Python-related packages, you will experience errors.

sudo pacman -Sy python-pipenv git libffi

Then clone MITM

git clone https://github.com/mitmproxy/mitmproxy.git
cd mitmproxy
pipenv install
pipenv run pip install pip setuptools
pipenv run pip install -r requirements.txt

Now that you have a pyenv with the all the requirements, you can launch MITM, inside the pipenv, using:

pipenv run mitmweb

You can add a shortcut to mitmweb in your /home/user/bashrc file

alias mitmweb="cd /home/user/MITMPROXY/mitmproxy/ && pipenv run mitmweb"
alias mitmdump="cd /home/user/MITMPROXY/mitmproxy/ && pipenv run mitmdump"

If you’re using docker you can run MITM proxy using the IP of the machine

ip neigh | grep 172
# only for docker users!
pipenv run mitmweb --web-host 172.17.0.3

Using MITM Chrome Browser on Linux

Run MITM proxy using pipenv run

pipenv run /home/user/Downloads/mitmproxy/mitmweb

Install FoxyProxy for Chromium

https://chrome.google.com/webstore/detail/foxyproxy-standard/gcknhkkoolaabfmlnjonogaaifnjlfnp

Add New Proxy for localhost:8080

  1. localhost
  2. 8080

You may need to toggle  “SOCKS”

Foxy Proxy MITM attack setup chrome browser linux
Foxy Proxy MITM attack setup chrome browser linux

Turn on the proxy in the top right in the extensions area

enable foxy proxy for all urls mitm proxy
enable foxy proxy for all urls mitm proxy

 

Open any browser and navigate to http://mitm.it/

If you don’t see the certificate download area (running on localhost), then make sure mitm is still on!

man in the middle proxy arch chrome
man in the middle proxy arch chrome

Download the Other file on the right

download mitm certificate authority certs for localhost
download mitm certificate authority certs for localhost

This will download your .pem file which we need to extract .crt from.

Extract the .crt using OpenSSL and then install that into your browser:

openssl x509 -in mitmproxy-ca-cert.pem -inform PEM -out mitmproxy-ca-cert.crt

Open Chromium and navigate to chrome://settings/certificates

Import mitm proxy certificate chromium browser
Import mitm proxy certificate chromium browser

Click Import and use the file you just created mitmproxy-ca-cert.crt

Then, you should see your MITMproxy light up!!

http://127.0.0.1:8081/

 

Leave a Reply

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