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

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl Tk] Codificator 0.2
« en: 7 Julio 2012, 16:06 pm »

Version Tk de este codificador.

Una imagen



El codigo

Código
  1. #!usr/bin/perl
  2. #Codificator 0.2
  3. #Version Tk
  4. #Coded By Doddy H
  5.  
  6. use Tk;
  7. use Tk::Dialog;
  8. use Digest::MD5;
  9. use Digest::SHA1;
  10. use MIME::Base64;
  11. use URI::Escape;
  12.  
  13. if ( $^O eq 'MSWin32' ) {
  14.    use Win32::Console;
  15.    Win32::Console::Free();
  16. }
  17.  
  18. $header = "This tool encode text in :
  19.  
  20. Hex
  21. SHA1
  22. MD5
  23. Base64
  24. ASCII
  25. URL
  26.  
  27.  
  28. ";
  29.  
  30. my $color_fondo = "black", my $color_texto = "white";
  31.  
  32. $window = MainWindow->new( -background => "black", -foreground => "white" );
  33. $window->geometry("380x370+80+80");
  34. $window->title("Codificator 0.2 || Coded By Doddy H");
  35. $window->resizable( 0, 0 );
  36.  
  37. $menula = $window->Frame(
  38.    -relief     => "sunken",
  39.    -bd         => 1,
  40.    -background => $color_fondo,
  41.    -foreground => $color_texto
  42. );
  43. my $menulnowaxm = $menula->Menubutton(
  44.    -text             => "Options",
  45.    -underline        => 1,
  46.    -background       => $color_fondo,
  47.    -foreground       => $color_texto,
  48.    -activebackground => $color_texto
  49. )->pack( -side => "left" );
  50. my $aboutnowaxm = $menula->Menubutton(
  51.    -text             => "About",
  52.    -underline        => 1,
  53.    -background       => $color_fondo,
  54.    -foreground       => $color_texto,
  55.    -activebackground => $color_texto
  56. )->pack( -side => "left" );
  57. my $exitnowaxm = $menula->Menubutton(
  58.    -text             => "Exit",
  59.    -underline        => 1,
  60.    -background       => $color_fondo,
  61.    -foreground       => $color_texto,
  62.    -activebackground => $color_texto
  63. )->pack( -side => "left" );
  64. $menula->pack( -side => "top", -fill => "x" );
  65.  
  66. $menulnowaxm->command(
  67.    -label      => "Encode",
  68.    -background => $color_fondo,
  69.    -foreground => $color_texto,
  70.    -command    => \&encode
  71. );
  72. $menulnowaxm->command(
  73.    -label      => "Decode",
  74.    -background => $color_fondo,
  75.    -foreground => $color_texto,
  76.    -command    => \&decode
  77. );
  78. $menulnowaxm->command(
  79.    -label      => "Clean",
  80.    -background => $color_fondo,
  81.    -foreground => $color_texto,
  82.    -command    => \&clear
  83. );
  84.  
  85. $aboutnowaxm->command(
  86.    -label      => "About",
  87.    -background => $color_fondo,
  88.    -foreground => $color_texto,
  89.    -command    => \&about
  90. );
  91.  
  92. $exitnowaxm->command(
  93.    -label      => "Exit",
  94.    -background => $color_fondo,
  95.    -foreground => $color_texto,
  96.    -command    => \&exitnow
  97. );
  98.  
  99. $window->Label(
  100.    -font       => "Impact",
  101.    -background => $color_fondo,
  102.    -foreground => $color_texto,
  103.    -text       => "Options : "
  104. )->place( -x => 110, -y => 53 );
  105. $window->Optionmenu(
  106.    -background       => $color_fondo,
  107.    -foreground       => $color_texto,
  108.    -activebackground => $color_texto,
  109.    -options          => [
  110.        [ HEX    => HEX ],
  111.        [ ASCII  => ASCII ],
  112.        [ BASE64 => BASE64 ],
  113.        [ MD5    => MD5 ],
  114.        [ SHA1   => SHA1 ],
  115.        [ URL    => URL ]
  116.    ],
  117.    -variable     => \$var,
  118.    -textvariable => \$codificacion
  119. )->place( -x => 180, -y => 53 );
  120.  
  121. my $rot = $window->Text(
  122.    -background => $color_fondo,
  123.    -foreground => $color_texto,
  124.    -width      => 45,
  125.    -height     => 15
  126. )->place( -x => 30, -y => 120 );
  127. $rot->insert( 'end', $header );
  128.  
  129. MainLoop;
  130.  
  131. sub about {
  132.    $window->Dialog(
  133.        -title            => "About",
  134.        -buttons          => ["OK"],
  135.        -text             => "Coded By Doddy H",
  136.        -background       => $color_fondo,
  137.        -foreground       => $color_texto,
  138.        -activebackground => $color_texto
  139.    )->Show();
  140. }
  141.  
  142. sub exitnow {
  143.    exit 1;
  144. }
  145.  
  146. sub clear {
  147.    $rot->delete( '0.1', 'end' );
  148. }
  149.  
  150. sub encode {
  151.    $text = $rot->get( "1.0", "end" );
  152.    chomp $text;
  153.    &clear;
  154.    if ( $codificacion eq "HEX" ) {
  155.        $result = hexar($text);
  156.        $rot->insert( 'end', $result );
  157.        print $result;
  158.    }
  159.  
  160.    elsif ( $codificacion eq "SHA1" ) {
  161.        $sha1 = Digest::SHA1->new->add($text);
  162.        my $digest = $sha1->digest;
  163.        $rot->insert( 'end', $digest );
  164.    }
  165.    elsif ( $codificacion eq "BASE64" ) {
  166.        $result = encode_base64($text);
  167.        $rot->insert( 'end', $result );
  168.    }
  169.    elsif ( $codificacion eq "URL" ) {
  170.        my $codec = Badger::Codec::URL->new();
  171.        my $ya    = $codec->encode($text);
  172.        $rot->insert( 'end', $ya );
  173.    }
  174.    elsif ( $codificacion eq "ASCII" ) {
  175.        $result = ascii($text);
  176.        $rot->insert( 'end', $result );
  177.    }
  178.    elsif ( $codificacion eq "MD5" ) {
  179.        $digest = Digest::MD5->md5_hex($text);
  180.        $rot->insert( 'end', $digest );
  181.    }
  182.    else {
  183.        $window->messageBox( -message => "What?!\n" );
  184.    }
  185. }
  186.  
  187. sub decode {
  188.    $text = $rot->get( "1.0", "end" );
  189.    chomp $text;
  190.    &clear;
  191.    if ( $codificacion eq "HEX" ) {
  192.        $result = decodera($text);
  193.        $rot->insert( 'end', $result );
  194.    }
  195.  
  196.    elsif ( $codificacion eq "SHA1" ) {
  197.        $window->messageBox( -message =>
  198.              "What?! , it's not possible with a function decoded\n" );
  199.    }
  200.    elsif ( $codificacion eq "BASE64" ) {
  201.        $result = decode_base64($text);
  202.        $rot->insert( 'end', $result );
  203.    }
  204.    elsif ( $codificacion eq "URL" ) {
  205.        my $codec = Badger::Codec::URL->new();
  206.        my $ya    = $codec->decode($text);
  207.        $rot->insert( 'end', $ya );
  208.    }
  209.    elsif ( $codificacion eq "ASCII" ) {
  210.        $result = ascii_de($text);
  211.        $rot->insert( 'end', $result );
  212.    }
  213.    elsif ( $codificacion eq "MD5" ) {
  214.        $window->messageBox( -message =>
  215.              "What?! , it's not possible with a function decoded\n" );
  216.    }
  217.    else {
  218.        $window->messageBox( -message => "What?!\n" );
  219.    }
  220. }
  221.  
  222. sub hexar {
  223.    my $string = $_[0];
  224.    $hex = '0x';
  225.    for ( split //, $string ) {
  226.        $hex .= sprintf "%x", ord;
  227.    }
  228.    return $hex;
  229. }
  230.  
  231. sub ascii {
  232.    return join ',', unpack "U*", $_[0];
  233. }
  234.  
  235. sub decodera {
  236.    $_[0] =~ s/^0x//;
  237.    $encode = join q[], map { chr hex } $_[0] =~ /../g;
  238.    return $encode;
  239. }
  240.  
  241. sub ascii_de {
  242.    $_[0] = join q[], map { chr } split q[,], $_[0];
  243.    return $_[0];
  244. }
  245.  
  246. # The End ?
  247.  


En línea

0xDani


Desconectado Desconectado

Mensajes: 1.077



Ver Perfil
Re: [Perl Tk] Codificator 0.2
« Respuesta #1 en: 8 Julio 2012, 14:00 pm »

Un buen script como siempre. Una pregunta, tu siempre sacas versiones 0.x, pero ¿nunca trabajas mas a fondo en algo?

Saludos.


En línea

I keep searching for something that I never seem to find, but maybe I won't, because I left it all behind!

I code for $$$
Hago trabajos en C/C++
Contactar por PM
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Perl Tk] Codificator 0.2
« Respuesta #2 en: 8 Julio 2012, 17:31 pm »

si , considero personalmente que las versiones de 1.0 para arriba tienen que ser verdaderos programas y no simple scripts.
En línea

0xDani


Desconectado Desconectado

Mensajes: 1.077



Ver Perfil
Re: [Perl Tk] Codificator 0.2
« Respuesta #3 en: 8 Julio 2012, 18:02 pm »

¿Entonces no crees que se puede hacer un programa completo en un lenguaje interpretado?
En línea

I keep searching for something that I never seem to find, but maybe I won't, because I left it all behind!

I code for $$$
Hago trabajos en C/C++
Contactar por PM
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Perl Tk] Codificator 0.2
« Respuesta #4 en: 8 Julio 2012, 18:21 pm »

si se puede de hecho estoy haciendo uno ahora y la semana que viene publico otro que es 1.0


En línea

0xDani


Desconectado Desconectado

Mensajes: 1.077



Ver Perfil
Re: [Perl Tk] Codificator 0.2
« Respuesta #5 en: 8 Julio 2012, 23:04 pm »

¿Entonces te refieres a que el programa debe estar formado por mas de un script?
En línea

I keep searching for something that I never seem to find, but maybe I won't, because I left it all behind!

I code for $$$
Hago trabajos en C/C++
Contactar por PM
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
Re: [Perl Tk] Codificator 0.2
« Respuesta #6 en: 9 Julio 2012, 05:35 am »

no me referia a eso , me referia a que en la version 1.0 tendria que ser un programa decente , aunque esa es solo mi opinion personal.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
perl
Scripting
nobo 0 3,204 Último mensaje 22 Febrero 2005, 07:49 am
por nobo
Perl
Scripting
zhynar_X 2 2,235 Último mensaje 12 Enero 2008, 04:36 am
por GroK
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 3,841 Último mensaje 18 Mayo 2011, 21:49 pm
por madpitbull_99
[Perl] Codificator version consola
Scripting
BigBear 0 1,442 Último mensaje 7 Octubre 2011, 01:16 am
por BigBear
[Perl] Codificator 0.2
Scripting
BigBear 2 1,871 Último mensaje 19 Julio 2012, 16:48 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines