3

I've done alot of research, and I can't find anything which actually solves my issue.

Since basically no site accepts mitmdumps certificate for https, I want to ignore those hosts. I can access a specific website with "--ignore-hosts (ip)" like normal, but I need to ignore all HTTPS/SSL hosts. Is there any way I can do this at all?

Thanks alot!

Eclipsum
  • 73
  • 1
  • 6

3 Answers3

2

There is a script file called tls_passthrough.py on the mitmproxy GitHub which ignores hosts which has previously failed a handshake due to the user not trusting the new certificate. Although it does not save for other sessions.

What this also means is that the first SSL connection from this perticular host the will always fail. What I suggest you do is write out all the IPs which has failed previously into a text document and ignore all hosts which are in that text file.

tls_passthrough.py

To simply start it, you just add it with the script argument "-s (tls_passthrough.py path)"

Example,

mitmproxy -s tls_passthrough.py
Niko
  • 574
  • 5
  • 13
VB_Dojnaz
  • 259
  • 6
  • 19
1

You can ignore all https/SSL traffic by using a wildcard:

mitmproxy --ignore-hosts '.*'
mgutt
  • 5,867
  • 2
  • 50
  • 77
0

you need a simple addon script to ignore all tls connections.

import mitmproxy

class IgnoreAllTLS:
    def __init__(self) -> None:
        pass

    def tls_clienthello(self, data: mitmproxy.proxy.layers.tls.ClientHelloData):
        '''
        ignore all tls event
        '''
        # LOGC("tls hello from "+str(data.context.server)+" ,ignore_connection="+str(data.ignore_connection))
        data.ignore_connection = True

addons = [
    IgnoreAllTLS()
]

the latest version ( 7.0.4 for now) is not support ignore_connection feature yet,so u need to install the main source version:

git clone https://github.com/mitmproxy/mitmproxy.git
cd mitmproxy
python3 -m venv venv

activate the venv before startup the proxy

source /path/to/mitmproxy/venv/bin/activate

startup mitmproxy

mitmproxy -s ignore_all_tls.py
coder
  • 163
  • 2
  • 3
  • 12