From 2490b87f4378e0f57b1764ce5eaf2f63b5d4210b Mon Sep 17 00:00:00 2001 From: HAMIDx9 Date: Thu, 28 Jan 2016 22:03:07 +0330 Subject: [PATCH 1/3] Fix printer format to print logs and avoid netcreds shutting down --- core/netcreds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/netcreds.py b/core/netcreds.py index f4b4723..9e8be01 100644 --- a/core/netcreds.py +++ b/core/netcreds.py @@ -916,7 +916,7 @@ def get_login_pass(body): def printer(src_ip_port, dst_ip_port, msg): if dst_ip_port != None: - print_str = '[{} > {}] {}'.format((src_ip_port, dst_ip_port, msg)) + print_str = '[{} > {}] {}'.format(src_ip_port, dst_ip_port, msg) # All credentials will have dst_ip_port, URLs will not log.info("{}".format(print_str)) From f8293c38c946372fb488914df19264635fae3ee1 Mon Sep 17 00:00:00 2001 From: HAMIDx9 Date: Fri, 29 Jan 2016 01:42:54 +0330 Subject: [PATCH 2/3] Fix returning data, check mime to avoid heavy chardet process we are not interested in other mimes. --- plugins/inject.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/inject.py b/plugins/inject.py index 27bda03..bc7ca9c 100644 --- a/plugins/inject.py +++ b/plugins/inject.py @@ -64,7 +64,10 @@ class Inject(Plugin): try: mime = response.headers['Content-Type'] except KeyError: - return + return {'response': response, 'request':request, 'data': data} + + if "text/html" not in mime: + return {'response': response, 'request':request, 'data': data} if "charset" in mime: match = re.search('charset=(.*)', mime) From 96e0b5f0e0bb7e640116cac7591d37a79b3b58f4 Mon Sep 17 00:00:00 2001 From: HAMIDx9 Date: Fri, 29 Jan 2016 01:43:45 +0330 Subject: [PATCH 3/3] Fix #230 HSTS bypass DNS problem when timeout occures --- core/servers/DNS.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/servers/DNS.py b/core/servers/DNS.py index 35e592c..0599e7b 100755 --- a/core/servers/DNS.py +++ b/core/servers/DNS.py @@ -366,7 +366,8 @@ class DNSHandler(): #First proxy the request with the real domain q = DNSRecord.question(real_domain).pack() r = self.proxyrequest(q, *nameserver_tuple) - + if r is None: return None + #Parse the answer dns_rr = DNSRecord.parse(r).rr