Skip to content

Commit

Permalink
Merge pull request aboul3la#146 from amustaque97/master
Browse files Browse the repository at this point in the history
UTF-8 Encoded Issue Resolved
  • Loading branch information
aboul3la authored Oct 13, 2018
2 parents 832d544 + c80ca5f commit d0c36de
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 d0c36de

Please sign in to comment.