Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Scripting. VBS, Batch, Bash, JavaSript.
 » 

[Python] Whois Online 0.1



Autor Tema: [Python] Whois Online 0.1  (Leído 956 veces)

Desconectado Doddy

  • Veterano
  • ***
  • Mensajes: 249
  • Slow Mind
[Python] Whois Online 0.1
« en: Abril 23, 2012, 07:20:33 pm »
Un simple script en Python para realizar un whois de forma online (mediante una pagina).

Código: You are not allowed to view links. Register or Login
#!usr/bin/python
#Whois Online 0.1
#Coded By Doddy H
 
import urllib2,sys,re
 
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 tomar(web,vars) :
 return nave.open(web,vars).read()
 
def head():
 print "\n-- == Whois Online 0.1 == --\n\n"
 
def copyright():
 print "\n(C) Doddy Hackman 2012\n"
 sys.exit(1)
 
def sintax():
 print "[+] Sintax : ",sys.argv[0]," <domain>\n"
 
def whois(domain):
 try:
  code = tomar("http://networking.ringofsaturn.com/Tools/whois.php","domain="+domain+"&"+"submit=submit")
  if (re.findall("<PRE>(.*?)<\/PRE>",code,re.S)):
   found = re.findall("<PRE>(.*?)<\/PRE>",code,re.S)
   resul = found[0]
   resul = re.sub("&quot;","",resul)
   resul = re.sub("&gt;&gt;&gt;","",resul)
   resul = re.sub("&lt;&lt;&lt;","",resul)
   return resul
  else:
   return "Not Found"
 except:
  print "[-] Page offline\n"

head()
if len(sys.argv) != 2 :
 sintax()
else :
 print whois(sys.argv[1])
copyright()
 
# The End

You are not allowed to view links. Register or Login

Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal