Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I connect mitmproxy to another proxy outside of my control?

The process would be that the browser send a request to MITMproxy and then generate a request that gets sent to target proxy server which isn't controlled by us. The proxy server would send a response to MITMproxy which would then relay that response to the browser.

How would I go about doing this?

like image 671
Jonathan Avatar asked Dec 08 '22 09:12

Jonathan


1 Answers

I was able to achieve what you ask with the following. You need to enable the upstream mode and upstream auth (in case you have some username/password for your proxy):

mitmproxy --mode upstream:https://HOSTNAME:PORT --upstream-auth USER:PASSWORD

Then you can check it's working with a simple curl:

curl -x http://localhost:8080 -k https://api.ipify.org/

This will forward your request to mitmproxy which will forward it to your other proxy.

Hope it helps!

like image 167
jpbalarini Avatar answered May 11 '23 16:05

jpbalarini