elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Python-Android] LocateIP 0.1
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Python-Android] LocateIP 0.1  (Leído 1,784 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Python-Android] LocateIP 0.1
« en: 19 Agosto 2013, 20:19 pm »

El primer script que hice en python para android.

El codigo :

Código
  1. # !usr/bin/python
  2. # LocateIP 0.1 (C) Doddy Hackman 2013
  3. # Android Version
  4.  
  5. import android,urllib2,re,socket
  6.  
  7. aplicacion = android.Android()
  8.  
  9. nave = urllib2.build_opener()
  10. 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')]
  11.  
  12. def toma(web) :
  13. nave = urllib2.Request(web)
  14. 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');
  15. op = urllib2.build_opener()
  16. return op.open(nave).read()
  17.  
  18. def search(pagina):
  19.  
  20. respuesta = ""
  21.  
  22. ip = socket.gethostbyname(str(pagina))
  23. code = toma("http://www.melissadata.com/lookups/iplocation.asp?ipaddress="+ip)
  24.  
  25. respuesta = respuesta + "[++] IP Address Location\n"
  26.  
  27. if (re.findall("City<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)):
  28.  rex = re.findall("City<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)
  29.  city = rex[0][1]
  30.  respuesta = respuesta + "\n[++] City : "+city
  31. else:
  32.  respuesta = respuesta + "\n[++] City : Not Found"
  33.  
  34. if (re.findall("Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)):
  35.  rex = re.findall("Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)
  36.  country = rex[0][1]
  37.  respuesta = respuesta + "\n[++] Country : "+country
  38. else:
  39.  respuesta = respuesta + "\n[++] Country : Not Found"
  40.  
  41. if (re.findall("State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)):
  42.  rex = re.findall("State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>",code)
  43.  state = rex[0][1]
  44.  respuesta = respuesta + "\n[++] State : "+state
  45. else:
  46.  respuesta = respuesta + "\n[++] State : Not Found"
  47.  
  48.  
  49. code = toma("http://www.ip-adress.com/reverse_ip/"+ip)
  50.  
  51. if (re.findall("whois\/(.*?)\">Whois",code)):
  52.  rex = re.findall("whois\/(.*?)\">Whois",code)
  53.  respuesta = respuesta + "\n\n[++] DNS Founds\n"
  54.  for dns in rex:
  55.   respuesta = respuesta + "\n[+] "+dns
  56.  
  57. return respuesta
  58.  
  59. def menu():
  60.  
  61. aplicacion.dialogCreateAlert("LocateIP 0.1")
  62. aplicacion.dialogSetItems(["Search","About","Exit"])
  63. aplicacion.dialogShow()
  64. re = aplicacion.dialogGetResponse().result
  65.  
  66. re2 = re["item"]
  67.  
  68. if re2==0:
  69.  
  70.  red = aplicacion.dialogGetInput("LocateIP 0.1","Target")
  71.  ref = str(red[1])
  72.  
  73.  aplicacion.dialogCreateSpinnerProgress("LocateIP 0.1","Searching ...")
  74.  aplicacion.dialogShow()
  75.  
  76.  don = search(ref)
  77.  
  78.  aplicacion.dialogDismiss()
  79.  
  80.  aplicacion.dialogCreateAlert("LocateIP 0.1",don)
  81.  aplicacion.dialogSetPositiveButtonText("Done")
  82.  aplicacion.dialogShow()
  83.  
  84.  op = aplicacion.dialogGetResponse().result
  85.  
  86.  if op["which"] == "positive" :
  87.  
  88.   menu()
  89.  
  90. if re2==1 :
  91.  
  92.  aplicacion.dialogCreateAlert("LocateIP 0.1","(C) Doddy Hackman 2013")
  93.  aplicacion.dialogSetPositiveButtonText("Done")
  94.  aplicacion.dialogShow()
  95.  re3 = aplicacion.dialogGetResponse().result
  96.  
  97.  if re3["which"] == "positive" :
  98.  
  99.   menu()
  100.  
  101.  if re3==2:
  102.  
  103.   aplicacion.exit()
  104.  
  105. menu()
  106.  
  107. # The End ?
  108.  

Les dejo unas imagenes de como funciona en mi tablet argos.







Eso es todo.


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Código-Python-Android]Calculadora por secuencia - JaAViEr(0x5d)
Scripting
0x5d 0 3,152 Último mensaje 27 Diciembre 2011, 02:22 am
por 0x5d
[Python-Android] ParanoicScan 0.3
Scripting
BigBear 1 2,248 Último mensaje 10 Febrero 2014, 15:32 pm
por adastra
geolocalizacion de servidores web e ipscon python y android
Seguridad
arthas1000 0 1,862 Último mensaje 11 Julio 2014, 20:18 pm
por arthas1000
Librerías Android para Python
Scripting
Achraf 1 3,609 Último mensaje 22 Febrero 2015, 01:49 am
por The_Mushrr00m
[Ayuda] Problema con python y Android SDK
Programación General
cibergolen 3 3,196 Último mensaje 4 Abril 2015, 15:04 pm
por cibergolen
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines