Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: BigBear en 7 Octubre 2011, 01:37 am



Título: [Python] HTTP Console By Doddy H
Publicado por: BigBear en 7 Octubre 2011, 01:37 am
Bueno , este es un simple programa en python hecho en tk que permite mandar
peticiones webs a un servidor en concreto


Código
  1. #!usr/bin/python
  2. #Console (C) Doddy Hackman 2011
  3.  
  4. from Tkinter import *
  5. import socket
  6.  
  7. global x,socket
  8.  
  9. def execa() :
  10.  
  11.  
  12. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  13. s.connect((str(host.get()),80))
  14. s.send(cmd.get()+"\r\n")
  15. data = s.recv(666)
  16. s.close()
  17. panel.insert(END,repr(data))
  18.  
  19.  
  20.  
  21. window = Tk()
  22. window.title("HTTP Console (C) Doddy Hackman 2011")
  23.  
  24. window.maxsize(width="400",height="350")
  25. window.minsize(width="400",height="350")
  26.  
  27. window.configure(background="black")
  28. window.configure(cursor="tcross")
  29.  
  30. host = StringVar()
  31. cmd = StringVar()
  32.  
  33. panel = Text(window,width=30,height=15,bg="black",fg="red")
  34.  
  35. Label(window,bg="black").grid(row=3)
  36.  
  37. Label(window,text="Host : ",bg="black",fg="red").grid(row=4,column=4)
  38. entry = Entry(window,width=35,textvariable=host,bg="black",fg="red").grid(row=4,column=5)
  39.  
  40. Label(window,text="Command : ",bg="black",fg="red").grid(row=8,column=4)
  41. entry = Entry(window,width=35,textvariable=cmd,bg="black",fg="red").grid(row=8,column=5)
  42.  
  43. Button(text="Cargar",bg="black",fg="red",activebackground="red",command=execa).grid(row=8,column=9)
  44.  
  45.  
  46. Label(window,bg="black").grid(row=19)
  47. panel.grid(row=20,column=5)
  48.  
  49.  
  50. window.mainloop()
  51.