Foro de elhacker.net

Seguridad Informática => Nivel Web => Mensaje iniciado por: Castg! en 16 Septiembre 2009, 19:11 pm



Título: [Aplicación] String-Ascii by castg
Publicado por: Castg! en 16 Septiembre 2009, 19:11 pm
Bueno aca les vengo a traer una simple pero util aplicacion que hice en mi tiempo libre. muy util para sql injection, pero si la quieren usar para otra cosa, les sirve. tiene la opcion de encerrar el resultado entre parentesis "()", o de separar con lo que ustedes quieran: ","; "."; " "; "-"


Una fotito:

(http://i29.tinypic.com/r9nd6v.jpg)


Aca esta el código por si alguien lo quiere (no soy ningun profesional!) ;) :

Código
  1. Private Sub Command1_Click()
  2. If text1.Text = "" Then
  3. MsgBox "Escribí algo para convertir!", vbCritical, "Error"
  4. Else
  5. If Check1.Value = Checked Then
  6. Dim letras As String
  7. Dim vseparador As String
  8. Dim separador As String
  9. Dim caca As String
  10. Dim msj As String
  11. caca = ""
  12. separador = Text3.Text
  13. For i = 1 To Len(text1)
  14. caca = caca + CStr(Asc(Mid(text1.Text, i, 1))) & separador
  15. Next i
  16. vseparador = Len(separador)
  17. letras = Len(caca)
  18. msj = "(" + Left(caca, letras - vseparador) + ")"
  19. Text2.Text = msj
  20. Else
  21. caca = ""
  22. separador = Text3.Text
  23. For i = 1 To Len(text1)
  24. caca = caca + CStr(Asc(Mid(text1.Text, i, 1))) & separador
  25. Next i
  26. vseparador = Len(separador)
  27. letras = Len(caca)
  28. msj = Left(caca, letras - vseparador)
  29. Text2.Text = msj
  30. End If
  31. End If
  32. End Sub
  33. Private Sub text1_click()
  34. text1.Text = ""
  35. End Sub


La descarga ya compilado por si lo quieren asi: Descargar (http://www.ilovepc.comuf.com/String-Ascii by castg.rar)


Suerte a todos!


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: YST en 16 Septiembre 2009, 19:46 pm
Yo hice una tool parecida pero que soloi transforma a hexadecimal un string :P dejo el codigo

Código
  1. format pe console
  2. entry start
  3. include 'win32ax.inc'
  4. .code
  5. start:
  6. invoke printf,Logo
  7.  
  8. invoke printf,"Ingrese la string"
  9. invoke printf,n
  10. invoke scanf,"%s",dBuffer
  11. stdcall StringToHex ,dBuffer ,<invoke lstrlen,dBuffer >,dBuffer2
  12. invoke printf,"La string en hexadecimal es:"
  13. invoke printf,n
  14. invoke printf,"0x%s",dBuffer2
  15. invoke system,"pause>>NULL"
  16. invoke ExitProcess,0
  17. ;Descripción: Convierte un dato a hexadecimal
  18. ; by YST
  19. proc StringToHex,cPuntero,cCantidad,cBuffer
  20. pushad
  21. mov esi,[cPuntero]
  22.  
  23. mov edi,[cBuffer]
  24. .bucle:
  25. cmp  [cCantidad],0
  26. je .salir
  27. xor edx,edx
  28. movzx eax,byte[esi]
  29. mov ebx,16
  30. div ebx
  31. mov bl, byte[numeros+eax]
  32. mov byte[edi],bl
  33. mov bl, byte[numeros+edx]
  34. mov byte[edi+1],bl
  35. add edi,2
  36. inc esi
  37. dec  [cCantidad]
  38. jmp  .bucle
  39. .salir:
  40. popad
  41. ret
  42. numeros db '0123456789ABCDEF',0  
  43. endp
  44. .data
  45. Logo db '                      ===================================',13,10          ; LOGO PRINCIPAL
  46.     db '                      =        StringToHex  by YST      =',13,10
  47.     db '                      ===================================',13,10,13,10,13,10,0
  48. dBuffer2 rb MAX_PATH*2
  49. dBuffer  rb MAX_PATH
  50. n db 13,10,0
  51.   section '.idata' import data readable writeable
  52.   library kernel32,'kernel32.dll',msvcrt,'msvcrt.dll'
  53.   include 'api/kernel32.inc'
  54. import msvcrt,printf,"printf",system,"system",scanf,'scanf'
  55.  
  56. section '.reloc' fixups data discardable


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: AlbertoBSD en 18 Septiembre 2009, 02:30 am
Me parece bien que coloquen buenos códigos en distintos lenguajes.

Espero y a alguien le sirvan.




Título: Re: [Aplicación] String-Ascii by castg
Publicado por: WHK en 19 Septiembre 2009, 08:18 am
Yo tengo unos del codeador que hize hace tiempo en php

Código
  1. echo sqlchr('hola');
  2.  
  3. function sqlchr($buffer){
  4. for($cuenta=0;$cuenta<strlen($buffer);$cuenta++){
  5.  $dump .= 'char('.ord($buffer[$cuenta]).')';
  6.  if((strlen($buffer) - 1) != $cuenta){
  7.   $dump .= ',';
  8.  }
  9. }
  10. return $dump;
  11. }
  12. /*
  13. Resultado:
  14. char(104),char(111),char(108),char(97)
  15. */
  16.  


Código
  1. echo sqldword('../../../../../etc/passwd');
  2. function sqldword($buffer){
  3. return 'funcion(0x'.bin2hex($buffer).')';
  4. }
  5. /*
  6. Resultado:
  7. funcion(0x2e2e2f2e2e2f2e2e2f2e2e2f2e2e2f6574632f706173737764)
  8. */
  9.  


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: braulio-- en 19 Septiembre 2009, 11:44 am
Ala, pues yo lo pongo en python.
Código
  1. cadena = raw_input("Escribe la cadena : ")
  2. parentesis = raw_input("Quieres meterlo entre parentesis? ")
  3. separacion = raw_input("Por que lo quieres separar? ")
  4. if parentesis=="Si" or parentesis=="si" or parentesis=="SI": print "(",
  5. for numero in range(len(cadena)) :
  6.  print ord(cadena[numero]),
  7.  if numero!=len(cadena)-1: print separacion,
  8. if parentesis=="Si" or parentesis=="si" or parentesis=="SI": print ")"
  9. raw_input()
  10.  


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: Castg! en 19 Septiembre 2009, 18:46 pm
que bueno! sigan subiendo en distintos lenguajes, estoy aprendioendo!


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: WHK en 20 Septiembre 2009, 01:11 am
lo agregué al recopilatorio de post.


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: MagnoBalt en 20 Septiembre 2009, 07:22 am
Aca va el mio para pasar un string al formato char(115,116,114,105,110,103) Codeado en Perl.. Buenos codigos Sigamos con mas.. Saludos


Código
  1. #!/usr/bin/perl
  2. sub decimal {
  3. my (@arreglo2) = @_;
  4.  
  5.  
  6.  $i = 0;
  7.  foreach $letra(@arreglo2)
  8. {
  9. if ($i <= $#arreglo) {
  10. @arreglo3[$i] = ord($letra);
  11. $i++;
  12.     }
  13. }
  14. return @arreglo3;
  15. }
  16. print "====================================================\n";
  17. print "Ingresa la cadena a pasar a Decimal\n";
  18. print "dicha tiene q estar deletreada separada por coma\n";
  19. print "ejemplo: u,s,u,a,r,i,o \n";
  20. print "====================================================\n";
  21. print ">>";
  22. $cadena.=<STDIN>;
  23. chomp($cadena);
  24. print "Cadena = ";
  25. print "$cadena\n\n";
  26. @arreglo=split(",",$cadena);
  27.  
  28. print "Decimal:char(";
  29. print join ",",&decimal(@arreglo);
  30. print ")\n\n"


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: Castg! en 4 Octubre 2009, 01:41 am
que pena hace poco habia visto uno en batch que era bastante eficaz, si alguien lo encuentra o se dispone a hacerlo chifle ;) yo voy a intentar.


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: xassiz_ en 4 Octubre 2009, 01:50 am
Aqui tienen el mio (http://foro.elhacker.net/nivel_web/aplicacion_asciic_by_xassiz-t269078.0.html) en VBScript..



Título: Re: [Aplicación] String-Ascii by castg
Publicado por: Castg! en 5 Octubre 2009, 06:01 am
Lo encontre! lo modifique y cambie bastantes cosas, no es 100% batch pero sirve igual :D. 
Código
  1. @echo off
  2. title String-Ascii Converter
  3. setlocal enabledelayedexpansion
  4.  
  5. if not exist "ascii.exe" (call :ascii)
  6.  
  7. :init
  8. cls
  9. set /p sentence="Inserte la cadena a convertir > "
  10. call :split "%sentence%"
  11. echo Cadena: %sentence%
  12. echo Ascii:  (%result:~1%)
  13. echo Quiere dejarlo en un archivo de texto? (S/N)
  14. set /p resp2=
  15. if %resp2%==S (call :save)
  16. if %resp2%==s (call :save)
  17. if %resp2%==n (call :dsp)
  18. if %resp2%==N (call :dsp)
  19. goto :dsp
  20.  
  21. :save
  22. echo. >> "%USERPROFILE%\Escritorio\String-Ascii.txt"
  23. echo Cadena: %sentence% >> "%USERPROFILE%\Escritorio\String-Ascii.txt"
  24. echo Ascii:  (%result:~1%) >> "%USERPROFILE%\Escritorio\String-Ascii.txt"
  25. cls
  26. echo Se ha creado un archivo en el escritorio con el nombre de "String-Ascii"
  27.  
  28. :split
  29. set target=%~1
  30. call :string "%target%"
  31. for /l %%a in (0,1,%len%) do (
  32. call :toascii "%%target:~%%a,1%%"
  33. set result=!result!,!ascii!)
  34. goto :eof
  35.  
  36. :string
  37. set string=%~1
  38. :string2
  39. set /a length+=1
  40. set /a len=%length%-1
  41. set string=%string:~1%
  42. if "%string%"=="" goto :eof
  43. goto :string2
  44.  
  45. :toascii
  46. (
  47. echo %~1
  48. )|ascii.exe
  49. set ascii=%errorlevel%
  50. goto :eof
  51.  
  52. :ascii
  53. (
  54. echo n ascii.dat
  55. echo e 0000 4D 5A 2E 00 01 00 00 00 02 00 00 10 FF FF F0 FF
  56. echo e 0010 FE FF 00 00 00 01 F0 FF 1C 00 00 00 00 00 00 00
  57. echo e 0020 B4 08 CD 21 3C 00 75 02 CD 21 B4 4C CD 21
  58. echo rcx
  59. echo 002E
  60. echo w0
  61. )>ascii.dat
  62. type ascii.dat|debug>NUL 2>&1
  63. del /f/q/a "ascii.exe">NUL 2>&1
  64. ren ascii.dat "ascii.exe"
  65. goto :eof
  66.  
  67. :dsp
  68. cls
  69. echo Inserte:
  70. echo 1 para volver al conversor.
  71. echo 2 para salir.
  72. set /p resp="> "
  73. if %resp%==1 (call :init)
  74. if %resp%==2 (exit)


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: WHK en 28 Octubre 2009, 22:30 pm
En gif:
http://www.elhacker.net/ascii.gif

(http://www.elhacker.net/ascii.gif)


Título: Re: [Aplicación] String-Ascii by castg
Publicado por: Castg! en 29 Octubre 2009, 00:12 am
yo lo pongo en bmp : xD!