From 7ab938c01fe77042553e4fda713a9dfbf86c31bb Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Sun, 20 Aug 2017 18:29:42 -0400 Subject: add mitmproxy script to do the routing --- dns_spoofing.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 dns_spoofing.py (limited to 'dns_spoofing.py') diff --git a/dns_spoofing.py b/dns_spoofing.py new file mode 100644 index 0000000..f59cc30 --- /dev/null +++ b/dns_spoofing.py @@ -0,0 +1,16 @@ +""" +Usage: + mitmproxy + -p 443 + -s dns_spoofing.py + -R http://localhost:8000 +""" + +def request(flow): + flow.request.scheme = "http" + sni = flow.client_conn.connection.get_servername() + if sni == b"ws.audioscrobbler.com": + flow.request.port = 3001 + else: + flow.request.port = 8000 + -- cgit v1.2.3-70-g09d2