From c80ca5f0e9ba88165f31750ed063042f29eb1ffe Mon Sep 17 00:00:00 2001 From: Mustaque Date: Tue, 2 Oct 2018 21:32:59 +0530 Subject: [PATCH] UTF-8 Encoded Issue Solved --- sublist3r.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sublist3r.py b/sublist3r.py index 413072c..818a0c2 100755 --- a/sublist3r.py +++ b/sublist3r.py @@ -104,7 +104,7 @@ def parse_args(): def write_file(filename, subdomains): # saving subdomains results to output file print("%s[-] Saving results to file: %s%s%s%s" % (Y, W, R, filename, W)) - with open(str(filename), 'wt') as f: + with open(str(filename), 'wt',encoding='utf-8') as f: for subdomain in subdomains: f.write(subdomain + os.linesep) @@ -545,7 +545,8 @@ def create_cookies(self, cookie): cookies = dict() cookies_list = cookie[0:cookie.find(';')].split("=") cookies[cookies_list[0]] = cookies_list[1] - cookies['netcraft_js_verification_response'] = hashlib.sha1(urllib.unquote(cookies_list[1])).hexdigest() + # hashlib.sha1 requires utf-8 encoded str + cookies['netcraft_js_verification_response'] = hashlib.sha1(urllib.unquote(cookies_list[1]).encode('utf-8')).hexdigest() return cookies def get_cookies(self, headers):