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

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Python] Whois Online 0.1
« en: 23 Abril 2012, 17:20 pm »

Un simple script en Python para realizar un whois de forma online (mediante una pagina).

Código
  1. #!usr/bin/python
  2. #Whois Online 0.1
  3. #Coded By Doddy H
  4.  
  5. import urllib2,sys,re
  6.  
  7. nave = urllib2.build_opener()
  8. 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')]
  9.  
  10. def tomar(web,vars) :
  11. return nave.open(web,vars).read()
  12.  
  13. def head():
  14. print "\n-- == Whois Online 0.1 == --\n\n"
  15.  
  16. def copyright():
  17. print "\n(C) Doddy Hackman 2012\n"
  18. sys.exit(1)
  19.  
  20. def sintax():
  21. print "[+] Sintax : ",sys.argv[0]," <domain>\n"
  22.  
  23. def whois(domain):
  24. try:
  25.  code = tomar("http://networking.ringofsaturn.com/Tools/whois.php","domain="+domain+"&"+"submit=submit")
  26.  if (re.findall("<PRE>(.*?)<\/PRE>",code,re.S)):
  27.   found = re.findall("<PRE>(.*?)<\/PRE>",code,re.S)
  28.   resul = found[0]
  29.   resul = re.sub("&quot;","",resul)
  30.   resul = re.sub("&gt;&gt;&gt;","",resul)
  31.   resul = re.sub("&lt;&lt;&lt;","",resul)
  32.   return resul
  33.  else:
  34.   return "Not Found"
  35. except:
  36.  print "[-] Page offline\n"
  37.  
  38. head()
  39. if len(sys.argv) != 2 :
  40. sintax()
  41. else :
  42. print whois(sys.argv[1])
  43. copyright()
  44.  
  45. # The End
  46.  



En línea

Runex

Desconectado Desconectado

Mensajes: 192


http://tutogramacion.blogspot.com


Ver Perfil WWW
Re: [Python] Whois Online 0.1
« Respuesta #1 en: 23 Abril 2012, 19:43 pm »

Doddy, te importa que le ponga yo la interfaz gráfica? No será el mismo programa lo modificaré un poco por si te importa.



Un saludo men, y muy bueno :)


En línea

"No renunciaría al bambú.
Nunca renuciaría a ti.
No te compares con otros" "El me dijo:
El bambú tenía un propósito diferente al del
helecho, sin embargo eran necesarios y
hacían del bosque un lugar hermoso".
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Python] Whois Online 0.1
« Respuesta #2 en: 23 Abril 2012, 19:44 pm »

hacelo si queres.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Python] Diccionario Online 0.1
Scripting
BigBear 0 1,578 Último mensaje 19 Marzo 2012, 02:05 am
por BigBear
[Ruby] Whois Online 0.1
Scripting
BigBear 3 3,267 Último mensaje 27 Abril 2012, 16:30 pm
por 0xDani
[Perl] Whois Online 0.1
Scripting
BigBear 0 1,492 Último mensaje 23 Abril 2012, 17:21 pm
por BigBear
[Perl Tk] Whois Online 0.1
Scripting
BigBear 0 1,386 Último mensaje 23 Abril 2012, 17:21 pm
por BigBear
[PyQT4] Whois Online 0.2
Scripting
BigBear 0 1,443 Último mensaje 27 Agosto 2012, 00:24 am
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines