aboutsummaryrefslogtreecommitdiffstats
path: root/dns_spoofing.py
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2017-08-20 18:29:42 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2017-08-20 18:29:42 -0400
commit7ab938c01fe77042553e4fda713a9dfbf86c31bb (patch)
tree9bfe4835fe2bd357c3386f29d8fe495359125f15 /dns_spoofing.py
parent9134e0d9e7dab3e55243d6a9ed400dfa3d25c7bf (diff)
downloadlastfm-api-7ab938c01fe77042553e4fda713a9dfbf86c31bb.tar.gz
add mitmproxy script to do the routing
Diffstat (limited to 'dns_spoofing.py')
-rw-r--r--dns_spoofing.py16
1 files changed, 16 insertions, 0 deletions
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
+