diff options
Diffstat (limited to 'examples/complex')
-rw-r--r-- | examples/complex/dns_spoofing.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/complex/dns_spoofing.py b/examples/complex/dns_spoofing.py index 1fb59f74..acda303d 100644 --- a/examples/complex/dns_spoofing.py +++ b/examples/complex/dns_spoofing.py @@ -1,5 +1,5 @@ """ -This inline scripts makes it possible to use mitmproxy in scenarios where IP spoofing has been used to redirect +This script makes it possible to use mitmproxy in scenarios where IP spoofing has been used to redirect connections to mitmproxy. The way this works is that we rely on either the TLS Server Name Indication (SNI) or the Host header of the HTTP request. Of course, this is not foolproof - if an HTTPS connection comes without SNI, we don't @@ -34,7 +34,7 @@ class Rerouter: The original host header is retrieved early before flow.request is replaced by mitmproxy new outgoing request """ - flow.metadata["original_host"] = flow.request.headers["Host"] + flow.metadata["original_host"] = flow.request.host_header def request(self, flow): if flow.client_conn.ssl_established: @@ -53,7 +53,7 @@ class Rerouter: if m.group("port"): port = int(m.group("port")) - flow.request.headers["Host"] = host_header + flow.request.host_header = host_header flow.request.host = sni or host_header flow.request.port = port |