From 2e1238d1ba6b18c651e451c270d03a2698ea311c Mon Sep 17 00:00:00 2001 From: Alexey Mozzhakov Date: Mon, 25 Jun 2018 15:46:54 +0300 Subject: [PATCH] Added HTTP response decoding * Added HTTP response decoding * Added HTTP response decoding for Termux --- SocialFish.py | 4 ++-- SocialFishTermux.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SocialFish.py b/SocialFish.py index b4d6fdc..3c99f78 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -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) diff --git a/SocialFishTermux.py b/SocialFishTermux.py index fe623ac..8b6a56b 100644 --- a/SocialFishTermux.py +++ b/SocialFishTermux.py @@ -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)