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

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[PyQT4] Whois Online 0.2
« en: 27 Agosto 2012, 00:24 am »

Queria hacer mi primer programa en PyQT4 y quise empezar con este simple cliente whois.

Una imagen de como quedo



El codigo

Código
  1. #!usr/bin/python
  2. #Whois Online 0.2
  3. #Coded By Doddy H
  4.  
  5. import sys,urllib2,re
  6. from PyQt4 import QtCore,QtGui
  7.  
  8. nave = urllib2.build_opener()
  9. 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')]
  10.  
  11. def tomar(web,vars) :
  12. return nave.open(web,vars).read()
  13.  
  14. def whois(domain):
  15. try:
  16.  code = tomar("http://networking.ringofsaturn.com/Tools/whois.php","domain="+domain+"&"+"submit=submit")
  17.  if (re.findall("<PRE>(.*?)<\/PRE>",code,re.S)):
  18.   found = re.findall("<PRE>(.*?)<\/PRE>",code,re.S)
  19.   resul = found[0]
  20.   resul = re.sub("&quot;","",resul)
  21.   resul = re.sub("&gt;&gt;&gt;","",resul)
  22.   resul = re.sub("&lt;&lt;&lt;","",resul)
  23.   return resul
  24.  else:
  25.   return "Not Found"
  26. except:
  27.  print "[-] Page offline\n"
  28.  
  29. def comando():
  30.  
  31. new.console.clear()
  32. new.console.appendPlainText(whois(str(new.dom.text())))
  33.  
  34. app = QtGui.QApplication(sys.argv)
  35.  
  36. new = QtGui.QWidget()
  37.  
  38. new.setWindowTitle("Whois Online 0.2 || Coded By Doddy H")
  39. new.resize(450,420)
  40. new.setStyleSheet("QWidget {background-color: #000000;color: #00FF00}")
  41.  
  42. new.label1 = QtGui.QLabel("Domain : ",new)
  43. new.label1.setStyleSheet("QWidget {background-color: #000000;color: #00FF00;font: normal 17px Verdana}")
  44. new.label1.setGeometry(20,23,80,20)
  45.  
  46. new.dom = QtGui.QLineEdit(new)
  47. new.dom.setStyleSheet("QWidget {background-color: #000000; color: #00FF00;border: 2px solid #00FF00}")
  48. new.dom.setGeometry(95,23,200,25)
  49.  
  50. new.search = QtGui.QPushButton("Search",new)
  51. new.search.setGeometry(310,22,110,28)
  52. new.search.setStyleSheet("QWidget {background-color: #000000; color: #00FF00;border: 2px solid #00FF00}")
  53.  
  54. new.label2 = QtGui.QLabel("Console",new)
  55. new.label2.setStyleSheet("QWidget {background-color: #000000;color: #00FF00;font: normal 17px Verdana}")
  56. new.label2.setGeometry(200,70,70,20)
  57.  
  58. new.console = QtGui.QPlainTextEdit(new)
  59. new.console.setGeometry(50,100,350,300)
  60. new.console.setStyleSheet("QWidget {background-color: #000000; color: #00FF00;border: 2px solid #00FF00}")
  61.  
  62. new.connect(new.search,QtCore.SIGNAL("clicked()"),comando)
  63.  
  64. new.show()
  65.  
  66. sys.exit(app.exec_())
  67.  
  68. # The End ?
  69.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Ruby] Whois Online 0.1
Scripting
BigBear 3 3,259 Último mensaje 27 Abril 2012, 16:30 pm
por 0xDani
[Python] Whois Online 0.1
Scripting
BigBear 2 2,025 Último mensaje 23 Abril 2012, 19:44 pm
por BigBear
[Perl] Whois Online 0.1
Scripting
BigBear 0 1,485 Último mensaje 23 Abril 2012, 17:21 pm
por BigBear
[Perl Tk] Whois Online 0.1
Scripting
BigBear 0 1,380 Último mensaje 23 Abril 2012, 17:21 pm
por BigBear
[PyQT4] MD5 Crack Online 0.1
Scripting
BigBear 0 1,380 Último mensaje 3 Noviembre 2012, 15:38 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines