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

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


  Mostrar Mensajes
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 25
11  Programación / Scripting / Re: [wxPython] RTH Text Converter! - by xassiz en: 1 Junio 2010, 18:32 pm
Gracias bro ^^ Espero sugerencias para la siguiente version
12  Programación / Scripting / [wxPython] RTH Text Converter! - by xassiz en: 1 Junio 2010, 15:21 pm
RTH Text Converter



Bueno, os traigo esta herramienta que he programado.


Funciones:
Código:
-ASCII
-Hexadecimal
-Base64
-MD5 (lo crackea a partir de una web online, que por cierto es mala (las buenas tienen captcha xDD))
-URL encode

Espero que os guste, más bien, que os sea de utilidad xDD

A mi por lo menos me es útil para algunas cosas.. bueno, aquí el código:

Código
  1. #!/usr/bin/env python
  2. #RTH Text Converter - by xassiz
  3.  
  4. import wx,base64,md5,urllib,sys,binascii
  5.  
  6. class Frame(wx.Frame):
  7.    def __init__(self):
  8.        wx.Frame.__init__(self, None, -1, title='RTH Text Converter  -  by xassiz', pos=wx.DefaultPosition,
  9.            size=wx.Size(450, 450), style=wx.DEFAULT_FRAME_STYLE^(wx.RESIZE_BORDER|wx. MAXIMIZE_BOX))
  10.        self.panel = wx.Panel(self, id=1, pos=(0, 0), size=(300, 520))
  11.        wx.StaticText(self.panel, label='Texto:', pos=wx.Point(8,18), size=wx.Size(33,13), style=0)
  12.        wx.StaticText(self.panel, label='Salida:', pos=wx.Point(8,152), size=wx.Size(33,13), style=0)
  13.        ascii = wx.Button(self.panel, label='ASCII', pos=wx.Point(50,288), size=wx.Size(75,23), style=0)
  14.        hexa = wx.Button(self.panel, label='HEX', pos=wx.Point(125,288), size=wx.Size(75,23), style=0)
  15.        base_64 = wx.Button(self.panel, label='Base64', pos=wx.Point(200,288), size=wx.Size(75,23), style=0)
  16.        md5_ = wx.Button(self.panel, label='MD5', pos=wx.Point(275,288), size=wx.Size(75,23), style=0)
  17.        url_encode = wx.Button(self.panel, label='URL', pos=wx.Point(350,288), size=wx.Size(75,23), style=0)
  18.        borrar = wx.Button(self.panel, label='Borrar', pos=wx.Point(265,345), size=wx.Size(80,46), style=0)
  19. about = wx.Button(self.panel, label='About', pos=wx.Point(345,345), size=wx.Size(80,46), style=0)
  20.        self.cifrar = wx.RadioButton(self.panel, label='cifrar', pos=wx.Point(50,345), size=wx.Size(80,23), style=0)
  21.        self.descifrar = wx.RadioButton(self.panel, label='descifrar', pos=wx.Point(50,370), size=wx.Size(80,23), style=0)
  22.        self.accion = "enc"
  23.        self.txtNormal = wx.TextCtrl(self.panel, pos=wx.Point(48,18), size=wx.Size(375, 120), style=0, value='')
  24.        self.txtConvertido = wx.TextCtrl(self.panel, pos=wx.Point(48,152), size=wx.Size(375,120), style=0, value='')
  25.        self.Bind(wx.EVT_BUTTON, self.ascii, ascii)
  26.        self.Bind(wx.EVT_BUTTON, self.hexa, hexa)
  27.        self.Bind(wx.EVT_BUTTON, self.base_64, base_64)
  28.        self.Bind(wx.EVT_BUTTON, self.md5_, md5_)
  29.        self.Bind(wx.EVT_BUTTON, self.url_encode, url_encode)
  30.        self.Bind(wx.EVT_BUTTON, self.borrar, borrar)
  31.        self.Bind(wx.EVT_BUTTON, self.about, about)
  32.        self.Bind(wx.EVT_RADIOBUTTON, self.accion_enc, self.cifrar)
  33.        self.Bind(wx.EVT_RADIOBUTTON, self.accion_des, self.descifrar)
  34.  
  35.    def ascii(self, event):
  36.        textoNormal = self.txtNormal.GetValue()
  37.        if self.accion == "enc":
  38.            ascii = ''
  39.            for x in textoNormal:
  40.                ascii = ascii + str(ord(x)) + ","
  41.            ascii = ascii[:-1]
  42.            self.txtConvertido.SetValue(ascii)
  43.        elif self.accion == "des":
  44.            normal = ''
  45.            textoNormal = textoNormal.replace(","," ")
  46.            textoNormal = textoNormal.replace("."," ")
  47.            for x in textoNormal.split():
  48.                normal = normal + chr(int(x))
  49.            self.txtConvertido.SetValue(normal)
  50.  
  51.    def hexa(self, event):
  52.        textoNormal = self.txtNormal.GetValue()
  53.        if self.accion == "enc":
  54.            hexa = ''
  55.            for x in textoNormal:
  56.                hexa = hexa + hex(ord(x))
  57.            hexa = "0x%s" % hexa.replace("0x","")
  58.            self.txtConvertido.SetValue(hexa)
  59.        elif self.accion == "des":
  60.            normal = textoNormal.replace('0x','')
  61.            normal = binascii.unhexlify(normal)
  62.            self.txtConvertido.SetValue(normal.replace("'",""))
  63.  
  64.    def base_64(self, event):
  65.        textNormal = self.txtNormal.GetValue()
  66.        if self.accion == "enc":
  67.            self.txtConvertido.SetValue(base64.encodestring(textNormal))
  68.        else:
  69.            self.txtConvertido.SetValue(base64.decodestring(textNormal))
  70.  
  71.    def md5_(self, event):
  72.        textNormal = self.txtNormal.GetValue()
  73.        if self.accion == "enc":
  74.            textConvertido = md5.new()
  75.            textConvertido.update(textNormal)
  76.            textConvertido = repr(textConvertido.hexdigest())
  77.            self.txtConvertido.SetValue(textConvertido.replace("'",""))
  78.        elif self.accion == "des":
  79.            x=urllib.urlopen("http://www.md5-lookup.com/livesearch.php?q=%s"%textNormal).read()
  80.            if 'No results found' in x:
  81.                self.txtConvertido.SetValue("No se encontraron resultados")
  82.            elif len(textNormal) != 32:
  83.                self.txtConvertido.SetValue("No es un MD5")
  84.            else:
  85.                x=x.split("\n")
  86.                x=x[16].replace('  <td width="250">','')
  87.                self.txtConvertido.SetValue(x.replace('</td>',''))
  88.  
  89.    def url_encode(self, event):
  90.        textNormal = self.txtNormal.GetValue()
  91.        if self.accion == "enc":
  92.            textConvertido = urllib.urlencode({'xassiz':textNormal})
  93.            self.txtConvertido.SetValue(textConvertido.replace("xassiz=",""))
  94.        elif self.accion == "des":
  95.            self.txtConvertido.SetValue(urllib.unquote_plus(textNormal))
  96.  
  97.    def borrar(self, event):
  98.        self.txtNormal.SetValue('')
  99.        self.txtConvertido.SetValue('')
  100.  
  101.    def about(self, event):
  102. wx.MessageBox("Autor: xassiz","RTH Text Converter")
  103. wx.MessageBox("Dedicado a http://foro.rthacker.NET","RTH Text Converter")
  104.  
  105.    def accion_enc(self, event):
  106.        self.accion = "enc"
  107.    def accion_des(self, event):
  108.        self.accion = "des"
  109.  
  110.  
  111. class App(wx.App):
  112.    def OnInit(self):
  113.        frame = Frame()
  114.        frame.Show()
  115.        self.SetTopWindow(frame)
  116.        return True
  117.  
  118. if __name__ == '__main__':
  119.    app = App()
  120.    app.MainLoop()
  121.  

Saludos
13  Programación / Scripting / Re: codigo para enviar datos de computadora a correo en: 1 Junio 2010, 00:00 am
esta parte no la entiendo
Código:
set filecontent=!filecontent!!currentline!
Simples variables.

Código:
echo ^"
se q va a parar a archivo.txt lo q no se es q va a parar ahi
Está mal, no hace falta escapar el caracter de comillas dobles
14  Programación / PHP / Re: Ereg_Replace y Include en: 24 Mayo 2010, 18:38 pm
Código
  1. if (file_exists($_GET['archivo'].".php")) {
  2. include(str_replace(array('.','/','\\'),'',$_GET['archivo']));
  3. }
15  Seguridad Informática / Nivel Web / Re: Como hacer un into outfile en SQLi en: 18 Mayo 2010, 23:40 pm
Te veo muy exigente con esas mayúsculas..

Citar
-1 union select 0 0 0 "shell" 0 0 into outfile '/tmp/shell.php'--
16  Programación / Scripting / Re: [Batch] Problema con las variables en: 18 Mayo 2010, 23:36 pm
, pero sigue sin tomarme el if not defined

La estructura de if not defined es "if not defined variable"
Código:
set variable=hola
if not defined %variable% (echo:Variable no definida)

Así estás haciendo tú, el cmd lo interpreta así:
Código:
set variable=hola
if not defined hola (echo:Variable no definida)

A que me refiero? Que no la tienes que expandir:
Código:
set variable=hola
if not defined variable (echo:Variable no definida)
17  Programación / Scripting / Re: [Batch] Problema con las variables en: 16 Mayo 2010, 14:04 pm
Para lo de los caracteres especiales te servirá mi script:

http://foro.elhacker.net/scripting/fbat_pequeno_filtro_by_xassiz-t265981.0.html
18  Programación / PHP / Re: Duda con variables en: 16 Mayo 2010, 14:00 pm
Probaste tu código de al principio? Porque yo juraría que php te permitia hacer eso.

Mira esto:
http://www.php.net/manual/es/language.variables.variable.php

Código
  1.  
  2. <?php
  3. echo "$a ${$a}";
  4. ?>
  5.  
  6.  

No sabía esto! T.T

Bueno, ahora ya esta el problema arreglado, gracias!
19  Programación / PHP / Re: Duda con variables en: 15 Mayo 2010, 13:28 pm
Supongamos que yo no se el numero de matrices hay, puede haber dos
Código
  1. $matriz[0][0] = 'Dato11';
  2. $matriz[0][1] = 'Dato12';
  3. $matriz[1][0] = 'Dato22';
  4. $matriz[1][1] = 'Dato23';
  5.  
cinco..
Código
  1. $matriz[0][0] = 'Dato11';
  2. $matriz[0][1] = 'Dato12';
  3. $matriz[1][0] = 'Dato22';
  4. $matriz[1][1] = 'Dato23';
  5. $matriz[2][0] = 'Dato32';
  6. $matriz[2][1] = 'Dato33';
  7. $matriz[3][0] = 'Dato42';
  8. $matriz[3][1] = 'Dato43';
  9. $matriz[4][0] = 'Dato52';
  10. $matriz[4][1] = 'Dato53';
  11.  

O los que sean, no lo sé!


Bueno, el caso es que quiero hacer un switch que sea

Código
  1. switch($variable)
  2. {
  3. case numero_de_matrices
  4. }
  5.  

Por ejemplo si hay 2 matrices hacer:
Código
  1. switch($variable)
  2. {
  3. case "1":
  4. ...
  5. break;
  6. case "2":
  7. ...
  8. break;
  9. default:
  10. ...
  11. break;
  12. }
  13.  


Y si por ejemplo hay cinco..
Código
  1. switch($variable)
  2. {
  3. case "1":
  4. ...
  5. break;
  6. case "2":
  7. ...
  8. break;
  9. case "3":
  10. ...
  11. break;
  12. case "4":
  13. ...
  14. break;
  15. case "5":
  16. ...
  17. break;
  18. default:
  19. ...
  20. break;
  21. }
  22.  

Do you understand me?




EDITO:

Ya lo arregle con un IF sin utilizar switch, me quedó mucho mejor, ahora solo me falta saber cual va a ser este valor del for:
Citar
for ($i = 0; $i < 2; $i++){

Como cuento en un array con dos dimensiones?
20  Programación / PHP / Re: Duda con variables en: 15 Mayo 2010, 01:07 am
Vale muchas gracias, me sirvió.

La cosa se complica ahora que quiero hacer un switch asi:
Código
  1. <?php
  2.  
  3. ...
  4.  
  5. switch($id_matriz)
  6. {
  7. case "1":
  8. ...
  9. case "2":
  10. ...
  11. case "3":
  12. ...
  13.  
  14. ...
  15. }
  16.  
  17. ?>
  18.  

Donde en cada case se repite el mismo proceso.

Pero al poner un for dentro del switch da error de sintaxis xDD
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 25
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines