MITM proxy on Ubuntu Startup?

I don’t know any suggested way but I can explain what I did by myself in Debian.

  1. Create file /home/user/ipx.sh and make it executable

#!/bin/bash
/usr/local/bin/mitmdump --showhost --ssl-insecure --set upstream_cert=false &>> /var/log/mitmdump.log

  1. Create file /lib/systemd/system/mitmdump.service

[Unit]
Description=mitmdump service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/home/user/ipx.sh
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target

  1. Reload system services

systemctl daemon-reload

  1. Enable service at startup

systemctl enable mitmdump.service

  1. Start service

systemctl start mitmdump.service

Use mitmdump instead of mitmproxy.

1 Like