Questions tagged [mitmproxy]

mitmproxy is an interactive console tool that allows network traffic to be inspected and edited on the fly.

Its features include:

  • Intercept HTTP/HTTPS requests and responses and modify them on the fly.
  • Save complete HTTP/HTTPS conversations for later replay and analysis.
  • Replay the client-side of an HTTP/HTTPS conversations.
  • Replay HTTP/HTTPS responses of a previously recorded server.
  • Reverse proxy mode to forward traffic to a specified server.
  • Transparent proxy mode on OSX and Linux.
  • Make scripted changes to HTTP/HTTPS traffic using Python.
  • SSL certificates for interception are generated on the fly.

Project Homepage

441 questions
4
votes
1 answer

mitmproxy redirect request to localhost and set Host header

I'm running a http server locally on port 8181. I have my mitmproxy configured on my devices and now I need to forward requests from a specific domain to my local server instance. So I'm using the request redirect example script described here: def…
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
4
votes
1 answer

How to ignore all websocket connections with mitmproxy?

At the moment, mitmproxy doesn't seem to be able to handle websocket connections. How can I just pass these on so that clients can still connect with a websocket server? Here's my current command: Specifically, in my case, I'd currently like…
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
4
votes
1 answer

Capture SSL Verification Error in MITM Proxy inline script

I'm using MITM Proxy to capture requests/responses using Python Inline Scripts. In case of certificate verification error MITM Proxy writes log line to standard output like 127.0.0.1:34390: SSL verification failed for upstream server at depth 0 with…
Dmitry Spikhalskiy
  • 5,379
  • 1
  • 26
  • 40
4
votes
1 answer

Mitmproxy tampering with GET and POST request/ response in one script

A POST request sent to a certain URL (http://test.com) looks like this: { "messageType": "OK", "city": { "Name": "Paris", "Views": { "1231": { "id": 4234, "enableView": false …
Richard3
  • 139
  • 1
  • 1
  • 7
4
votes
2 answers

MITM Proxy, getting entire request and response string

I am using mitmproxy for intercepting traffic. What I want is to be able to get the entire request and response in a string. I know that you have def response(context, flow) and that the HTTPFlow object has the request and response objects. What I…
Rabee
  • 128
  • 1
  • 7
4
votes
1 answer

How can I fix mitmproxy is not showing app traffic

I have set up mitmproxy on Ubuntu, and have linked my android device to it. I can view traffic coming from the android browser but when I launch an app, it does not show me any traffic from the app (any app it seems), even though the app is…
4
votes
1 answer

Editing a gzip content in mitmproxy

I'm trying to edit the content of a Request in mitmproxy and pass it over, but the content of the body is encoded by gzip. I can see the structure of data which is like xml, but I cannot edit it and save it in gzip format. How can I resolve this…
POD
  • 509
  • 8
  • 20
3
votes
1 answer

Trusting individual invalid certs in mitmproxy

I use mitmproxy to gather intel from outbound AS2 (HTTP) requests leaving our network. The schema goes like this: Mendelson AS2 ➡ mitmproxy ➡ partner AS2 server ↘ redis Where possible, I need to…
Newerth
  • 449
  • 2
  • 12
3
votes
1 answer

mitmproxy Client and Server disconnects whenever a specific app tries to use internet connection

I have an app on my Android phone I try to debug, but whenever I enable PcapDroid to send the TLS decrypted requests and responses to my PC, it won't allow any internet access in the app. I get no error messages in mitmproxy. The only output…
riwejak558
  • 111
  • 2
  • 6
3
votes
2 answers

How to modify JSON response body with mitmproxy

When I send a request to a specific website API I get this as response { "Tickets": [ { "ticketAvailable": true, ... How would I intercept and change ticketAvailable to false instead of true using mitmproxy? from mitmproxy import…
riwejak558
  • 111
  • 2
  • 6
3
votes
1 answer

How can I specify a map_remote rule in mitmproxy to redirect from a remote HTTPS URL to an HTTP URL?

I'd like to set up a map_remote rewrite from an https address to my local machine running a service on http only. The documentation for the option (https://docs.mitmproxy.org/stable/concepts-options/) seems to indicate I should do this mitmproxy…
Chris Cooper
  • 869
  • 2
  • 18
  • 42
3
votes
1 answer

Can't see WhatsApp traffic using mitmproxy

I have WhatsApp installed on an iPhone connected to mitmproxy running on a laptop. I can see the intercepted network requests for other apps like safari no problem. But for WhatsApp, I see no traffic, even though it functions correctly. Could it…
james738
  • 31
  • 2
3
votes
1 answer

How to use python mitm to capture requests and replay on request via flask

The idea I have is to run a flask webapp, encapsulating mitmproxy, so if I use the proxy and perform a get request to specific URL, capture it (data + session), and replay it when initiated by flask from flask import Flask from mitmproxy import…
desmond
  • 1,853
  • 4
  • 21
  • 27
3
votes
1 answer

Issue Converting Older MITMProxy Scripts to work on 5.2 - Error on Replace and Can't Find Docs on What Replaced was Replaced with

I Updated to MITMProxy Version 5.2. After updating I tried to run an Older Script and Kept Getting the Error: AttributeError: 'HTTPResponse' object has no attribute 'replace' From my code: flow.response.replace('FindThis', 'ReplaceWithThis') I…
FlappyFive
  • 33
  • 2
3
votes
2 answers

No internet connection in Android after using Mitmproxy

I have configured the android Phone (Samsung Galaxy S8) to use proxy. I can connect to mitm.it. I can also see some requests captured by Mitmproxy. However, I got no internet connection when I try to search anything in Google. Any hints on what…
JOHN
  • 1,411
  • 3
  • 21
  • 41
1 2
3
29 30