El codigo :
# !usr/bin/python
# LocateIP 0.1 (C) Doddy Hackman 2013
# Android Version
import android,urllib2,re,socket
aplicacion = android.Android()
nave = urllib2.build_opener()
nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')]
def toma(web) :
nave = urllib2.Request(web)
nave.add_header('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5');
op = urllib2.build_opener()
return op.open(nave).read()
def search(pagina):
respuesta = ""
ip = socket.gethostbyname(str(pagina))
code = toma("http://www.melissadata.com/lookups/iplocation.asp?ipaddress="+ip)
respuesta = respuesta + "[++] IP Address Location\n"
if (re.findall("City<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)):
rex = re.findall("City<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)
city = rex[0][1]
respuesta = respuesta + "\n[++] City : "+city
else:
respuesta = respuesta + "\n[++] City : Not Found"
if (re.findall("Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)):
rex = re.findall("Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)
country = rex[0][1]
respuesta = respuesta + "\n[++] Country : "+country
else:
respuesta = respuesta + "\n[++] Country : Not Found"
if (re.findall("State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)):
rex = re.findall("State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)
state = rex[0][1]
respuesta = respuesta + "\n[++] State : "+state
else:
respuesta = respuesta + "\n[++] State : Not Found"
code = toma("http://www.ip-adress.com/reverse_ip/"+ip)
if (re.findall("whois\/(.*?)\">Whois",code)):
rex = re.findall("whois\/(.*?)\">Whois",code)
respuesta = respuesta + "\n\n[++] DNS Founds\n"
for dns in rex:
respuesta = respuesta + "\n[+] "+dns
return respuesta
def menu():
aplicacion.dialogCreateAlert("LocateIP 0.1")
aplicacion.dialogSetItems(["Search","About","Exit"])
aplicacion.dialogShow()
re = aplicacion.dialogGetResponse().result
re2 = re["item"]
if re2==0:
red = aplicacion.dialogGetInput("LocateIP 0.1","Target")
ref = str(red[1])
aplicacion.dialogCreateSpinnerProgress("LocateIP 0.1","Searching ...")
aplicacion.dialogShow()
don = search(ref)
aplicacion.dialogDismiss()
aplicacion.dialogCreateAlert("LocateIP 0.1",don)
aplicacion.dialogSetPositiveButtonText("Done")
aplicacion.dialogShow()
op = aplicacion.dialogGetResponse().result
if op["which"] == "positive" :
menu()
if re2==1 :
aplicacion.dialogCreateAlert("LocateIP 0.1","(C) Doddy Hackman 2013")
aplicacion.dialogSetPositiveButtonText("Done")
aplicacion.dialogShow()
re3 = aplicacion.dialogGetResponse().result
if re3["which"] == "positive" :
menu()
if re3==2:
aplicacion.exit()
menu()
# The End ?
Eso es todo.