Skip to content

Commit

Permalink
UTF-8 Encoded Issue Solved
Browse files Browse the repository at this point in the history
  • Loading branch information
amustaque97 committed Oct 2, 2018
1 parent 832d544 commit c80ca5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sublist3r.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit c80ca5f

Please sign in to comment.