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

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: 1 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [31] 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 ... 55
301  Programación / Scripting / [Perl Tk] Kobra 1.6 en: 14 Julio 2012, 19:38 pm
Nueva version Tk de este scanner SQLI.

Una imagen



El codigo lo puede ver aca
302  Programación / Scripting / [Perl] K0bra 1.6 en: 14 Julio 2012, 19:38 pm
Nueva version de este scanner SQLI.

Las opciones son

  • Comprobar vulnerabilidad
  • Buscar numero de columnas
  • Buscar automaticamente el numero para mostrar datos
  • Mostras tablas
  • Mostrar columnas
  • Mostrar bases de datos
  • Mostrar tablas de otra DB
  • Mostrar columnas de una tabla de otra DB
  • Brutear tablas y columnas
  • Mostrar usuarios de mysql.user
  • Buscar archivos usando load_file
  • Mostrar un archivo usando load_file
  • Mostrar valores
  • Mostrar informacion sobre la DB
  • Crear una shell usando outfile
  • Todo se guarda en logs ordenados
  • Mejor manejo de control+c
  • Codigo identado (gracias a perltidy)

El codigo lo pueden ver aca
303  Programación / Scripting / Re: [Perl Tk] Codificator 0.2 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.
304  Programación / Scripting / Re: [Perl Tk] Codificator 0.2 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


305  Programación / Scripting / Re: [Perl Tk] Codificator 0.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.
306  Programación / Scripting / [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.  
307  Programación / Scripting / [Perl] Codificator 0.2 en: 7 Julio 2012, 16:06 pm
Nueva version de este script para codificar y decodificar en :

  • Hex
  • SHA1
  • MD5 (solo encode)
  • Base64
  • ASCII
  • URL

El codigo

Código
  1. #!usr/bin/perl
  2. #Codificator 0.2
  3. #Coded By Doddy H
  4. #This tool encode in :
  5. #
  6. #Hex
  7. #MD5
  8. #Base64
  9. #ASCII
  10. #URL
  11. #
  12. #
  13.  
  14. use Digest::MD5;
  15. use Digest::SHA1;
  16. use MIME::Base64;
  17. use URI::Escape;
  18.  
  19. sub head {
  20.    clean();
  21.    print q(
  22.  
  23.  
  24.  
  25.  @@@            @ @   @ @             @          
  26. @   @           @    @                @          
  27. @       @@@   @@ @ @ @@@ @  @@@   @@@ @@@  @@@  @ @
  28. @      @   @ @  @@ @  @  @ @   @ @   @ @  @   @ @@
  29. @      @   @ @   @ @  @  @ @      @@@@ @  @   @ @  
  30. @      @   @ @   @ @  @  @ @     @   @ @  @   @ @  
  31. @   @ @   @ @  @@ @  @  @ @   @ @  @@ @  @   @ @  
  32.  @@@   @@@   @@ @ @  @  @  @@@   @@ @ @@  @@@  @  
  33.  
  34.  
  35.  
  36. );
  37. }
  38.  
  39. head();
  40. print "\n[+] Options\n\n";
  41. 1 - MD5 encode
  42. 2 - Base64 encode
  43. 3 - Base64 decode
  44. 4 - Ascii encode
  45. 5 - Ascii decode
  46. 6 - Hex encode
  47. 7 - Hex decode
  48. 8 - URL encode
  49. 9 - URL decode
  50. 10 - Exit
  51.  
  52. );
  53. while (true) {
  54.    print "\n\n[+] Option : ";
  55.    chomp( my $op = <stdin> );
  56.    print "\n\n";
  57.    if ( $op eq 1 ) {
  58.        print "[+] String : ";
  59.        chomp( my $string = <stdin> );
  60.        print "\n\n[+] MD5 : " . Digest::MD5->md5_hex($string) . "\n\n";
  61.    }
  62.    elsif ( $op eq 2 ) {
  63.        print "[+] String : ";
  64.        chomp( my $string = <stdin> );
  65.        print "\n\n[+] Base64 : " . encode_base64($string);
  66.    }
  67.    elsif ( $op eq 3 ) {
  68.        print "[+] String : ";
  69.        chomp( my $string = <stdin> );
  70.        print "\n\n[+] Base64 Decode : " . decode_base64($string) . "\n";
  71.    }
  72.    elsif ( $op eq 4 ) {
  73.        print "[+] String : ";
  74.        chomp( my $string = <stdin> );
  75.        print "\n\n[+] Ascii : " . join ',', unpack "U*", $string;
  76.        print "\n";
  77.    }
  78.    elsif ( $op eq 5 ) {
  79.        print "[+] String : ";
  80.        chomp( my $string = <stdin> );
  81.        print "\n\n[+] Ascii decode : " . join q[], map { chr } split q[,],
  82.          $string . "\n";
  83.        print "\n";
  84.    }
  85.    elsif ( $op eq 6 ) {
  86.        print "[+] String : ";
  87.        chomp( my $string = <stdin> );
  88.        $hex = "0x";
  89.        for ( split //, $string ) {
  90.            $hex .= sprintf "%x", ord;
  91.        }
  92.        print "\n\n[+] Hex : " . $hex . "\n";
  93.    }
  94.    elsif ( $op eq 7 ) {
  95.        print "[+] String : ";
  96.        chomp( my $string = <stdin> );
  97.        $string =~ s/^0x//;
  98.        $encode = join q[], map { chr hex } $string =~ /../g;
  99.        print "\n\n[+] Hex decode : " . $encode . "\n";
  100.    }
  101.    elsif ( $op eq 8 ) {
  102.        print "[+] String : ";
  103.        chomp( my $string = <stdin> );
  104.        print "\n\n[+] URL Encode : " . uri_escape($string) . "\n";
  105.    }
  106.    elsif ( $op eq 9 ) {
  107.        print "[+] String : ";
  108.        chomp( my $string = <stdin> );
  109.        print "\n\n[+] URL Decode : " . uri_unescape($string) . "\n";
  110.    }
  111.    elsif ( $op eq 10 ) {
  112.        copyright();
  113.        exit(1);
  114.    }
  115.    else {
  116.        print "[+] Write good stupid !\n";
  117.    }
  118. }
  119.  
  120. sub clean {
  121.    my $os = $^O;
  122.    if ( $os =~ /Win32/ig ) {
  123.        system("cls");
  124.    }
  125.    else {
  126.        system("clear");
  127.    }
  128. }
  129.  
  130. sub copyright {
  131.    print "\n-- == Doddy Hackman 2012 == --\n\n";
  132.    <stdin>;
  133.    exit(1);
  134. }
  135.  
  136. # The End ?
  137.  
308  Programación / Scripting / [Perl Tk] Destroyer Shells 0.4 en: 30 Junio 2012, 01:39 am
Version Tk de un script para buscar y borrar phpshells.

Una imagen



El codigo

Código
  1. #!usr/bin/perl
  2. #DestroyerShells 0.4
  3. #Version Tk
  4. #Coded By Doddy H
  5.  
  6. use Tk;
  7. use Tk::Dialog;
  8. use LWP::UserAgent;
  9. use File::Find;
  10.  
  11. my @nombres = (
  12.    "C99Shell",
  13.    "r57shell",
  14.    "DxShell",
  15.    "HiddenShell",
  16.    "~ Andr3a92 ~ Sh3ll ~",
  17.    "CShell",
  18.    "Dark Shell",
  19.    "GsC SheLL",
  20.    "N3fa5t1cA Sh3ll",
  21.    "ONBOOMSHELL",
  22.    "StAkeR ~ Shell",
  23.    "MoDDeD By KinG-InFeT",
  24.    "31337 Shel"
  25. );
  26. my @founds;
  27.  
  28. #if ($^O eq 'MSWin32') {
  29. #use Win32::Console;
  30. #Win32::Console::Free();
  31. #}
  32.  
  33. my $color_texto = "orange";
  34. my $color_fondo = "black";
  35.  
  36. my $newdaxz =
  37.  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
  38.  
  39. $newdaxz->title("DestroyerShells 0.4 || Coded By Doddy H");
  40. $newdaxz->geometry("345x350+50+50");
  41. $newdaxz->resizable( 0, 0 );
  42.  
  43. $menula = $newdaxz->Frame(
  44.    -relief     => "sunken",
  45.    -bd         => 1,
  46.    -background => $color_fondo,
  47.    -foreground => $color_texto
  48. );
  49. my $menulnowaxm = $menula->Menubutton(
  50.    -text             => "Options",
  51.    -underline        => 1,
  52.    -background       => $color_fondo,
  53.    -foreground       => $color_texto,
  54.    -activebackground => $color_texto
  55. )->pack( -side => "left" );
  56. my $aboutnowaxm = $menula->Menubutton(
  57.    -text             => "About",
  58.    -underline        => 1,
  59.    -background       => $color_fondo,
  60.    -foreground       => $color_texto,
  61.    -activebackground => $color_texto
  62. )->pack( -side => "left" );
  63. my $exitnowaxm = $menula->Menubutton(
  64.    -text             => "Exit",
  65.    -underline        => 1,
  66.    -background       => $color_fondo,
  67.    -foreground       => $color_texto,
  68.    -activebackground => $color_texto
  69. )->pack( -side => "left" );
  70. $menula->pack( -side => "top", -fill => "x" );
  71.  
  72. $menulnowaxm->command(
  73.    -label      => "Scan",
  74.    -background => $color_fondo,
  75.    -foreground => $color_texto,
  76.    -command    => \&scan
  77. );
  78. $menulnowaxm->command(
  79.    -label      => "Delete Shells",
  80.    -background => $color_fondo,
  81.    -foreground => $color_texto,
  82.    -command    => \&delnow
  83. );
  84.  
  85. $aboutnowaxm->command(
  86.    -label      => "About",
  87.    -background => $color_fondo,
  88.    -foreground => $color_texto,
  89.    -command    => \&aboutxa
  90. );
  91.  
  92. $exitnowaxm->command(
  93.    -label      => "Exit",
  94.    -background => $color_fondo,
  95.    -foreground => $color_texto,
  96.    -command    => \&exitnow
  97. );
  98.  
  99. $newdaxz->Label(
  100.    -text       => "Directory : ",
  101.    -font       => "Impact",
  102.    -background => $color_fondo,
  103.    -foreground => $color_texto
  104. )->place( -x => 20, -y => 40 );
  105. my $dir = $newdaxz->Entry(
  106.    -text       => "C:/xampp/htdocs",
  107.    -width      => 37,
  108.    -background => $color_fondo,
  109.    -foreground => $color_texto
  110. )->place( -x => 95, -y => 45 );
  111.  
  112. $newdaxz->Label(
  113.    -text       => "Shells Founds",
  114.    -font       => "Impact",
  115.    -background => $color_fondo,
  116.    -foreground => $color_texto
  117. )->place( -x => 120, -y => 80 );
  118. my $files = $newdaxz->Listbox(
  119.    -width      => 40,
  120.    -height     => 10,
  121.    -background => $color_fondo,
  122.    -foreground => $color_texto
  123. )->place( -x => 50, -y => 130 );
  124.  
  125. $newdaxz->Label(
  126.    -text       => "Status : ",
  127.    -font       => "Impact",
  128.    -background => $color_fondo,
  129.    -foreground => $color_texto
  130. )->place( -x => 63, -y => 300 );
  131. my $tatus = $newdaxz->Entry(
  132.    -width      => 25,
  133.    -background => $color_fondo,
  134.    -foreground => $color_texto
  135. )->place( -x => 120, -y => 305 );
  136.  
  137. MainLoop;
  138.  
  139. sub delnow {
  140.  
  141.    my $total = $files->size - 1;
  142.  
  143.    for my $number ( 0 .. $total ) {
  144.        my $ruta = $files->get($number);
  145.        unlink($ruta);
  146.    }
  147.    $files->delete( "0.0", "end" );
  148. }
  149.  
  150. sub scan {
  151.  
  152.    $files->delete( "0.0", "end" );
  153.    my $dir = $dir->get;
  154.  
  155.    find( \&finder, $dir );
  156.  
  157.    sub finder {
  158.        my $file = $_;
  159.        if ( -f $file ) {
  160.            if ( $file =~ /\.txt$/ or $file =~ /\.php$/ ) {
  161.                my $abrir = $File::Find::name;
  162.  
  163.                $tatus->configure( -text => $abrir );
  164.  
  165.                open( FILE, $abrir );
  166.                my $words = join q(), <FILE>;
  167.                close(FILE);
  168.  
  169.                for my $rastro (@nombres) {
  170.                    $newdaxz->update;
  171.                    chomp $rastro;
  172.                    if ( $words =~ /$rastro/ig ) {
  173.                        $files->insert( "end", $abrir );
  174.                    }
  175.                }
  176.            }
  177.        }
  178.    }
  179.    $tatus->configure( -text => " " );
  180. }
  181.  
  182. sub aboutxa {
  183.    $newdaxz->Dialog(
  184.        -title            => "About",
  185.        -buttons          => ["OK"],
  186.        -text             => "Coded By Doddy H",
  187.        -background       => $color_fondo,
  188.        -foreground       => $color_texto,
  189.        -activebackground => $color_texto
  190.    )->Show();
  191. }
  192.  
  193. sub exitnow {
  194.    exit 1;
  195. }
  196.  
  197. #The End ?
  198.  
309  Programación / Scripting / [Perl] Destroyer Shells 0.4 en: 30 Junio 2012, 01:38 am
Version mejorada de este script para buscar y borrar shells.

Código
  1. #!usr/bin/perl
  2. #DestroyerShells 0.4
  3. #Coded By Doddy H
  4.  
  5. use File::Find;
  6.  
  7. my @nombres = (
  8.    "C99Shell",
  9.    "r57shell",
  10.    "DxShell",
  11.    "HiddenShell",
  12.    "~ Andr3a92 ~ Sh3ll ~",
  13.    "CShell",
  14.    "Dark Shell",
  15.    "GsC SheLL",
  16.    "N3fa5t1cA Sh3ll",
  17.    "ONBOOMSHELL",
  18.    "StAkeR ~ Shell",
  19.    "MoDDeD By KinG-InFeT",
  20.    "31337 Shel"
  21. );
  22. my @founds;
  23.  
  24. head();
  25. print "\n[+] Directory : ";
  26. chomp( my $dir = <stdin> );
  27. start($dir);
  28. copyright();
  29.  
  30. sub start {
  31.    my $dir = shift;
  32.    print "\n\n[+] Searching in directory $dir\n\n";
  33.  
  34.    find( \&finder, $dir );
  35.  
  36.    sub finder {
  37.        my $file = $_;
  38.        if ( -f $file ) {
  39.            if ( $file =~ /\.txt$/ or $file =~ /\.php$/ ) {
  40.                my $abrir = $File::Find::name;
  41.  
  42.                open( FILE, $abrir );
  43.                my $words = join q(), <FILE>;
  44.                close(FILE);
  45.  
  46.                for my $rastro (@nombres) {
  47.                    chomp $rastro;
  48.                    if ( $words =~ /$rastro/ig ) {
  49.                        push( @founds, $abrir );
  50.                    }
  51.                }
  52.            }
  53.        }
  54.    }
  55.  
  56.    my @founda = repes(@founds);
  57.  
  58.    print "[+] Number of files found : " . int(@founda) . "\n\n";
  59.  
  60.    if ( int(@founda) ne "0" ) {
  61.        for (@founda) {
  62.            print "[+] File Found : $_\n";
  63.        }
  64.  
  65.        print "\n[+] Delete files y/n : ";
  66.        chomp( my $op = <stdin> );
  67.  
  68.        if ( $op =~ /y/ig ) {
  69.            for (@founda) { unlink($_); }
  70.            print "\n[+] Files Deleted\n";
  71.        }
  72.        elsif ( $op =~ /n/ig ) {
  73.            print "\n[+] Good Bye\n";
  74.        }
  75.        else {
  76.            print "\n[+] Write good stupid\n";
  77.        }
  78.    }
  79. }
  80.  
  81. sub repes {
  82.    foreach $test (@_) {
  83.        push @limpio, $test unless $repe{$test}++;
  84.    }
  85.    return @limpio;
  86. }
  87.  
  88. sub head {
  89.    print qq(
  90.  
  91.  
  92. @@@@                                             @@@   @           @ @    
  93. @   @              @                            @   @  @           @ @    
  94. @    @             @                            @      @           @ @    
  95. @    @   @@@   @@  @@ @@  @@@  @  @  @@@  @@    @      @ @@   @@@  @ @  @@
  96. @    @  @   @ @  @ @  @  @   @ @  @ @   @ @      @@@   @@  @ @   @ @ @ @  @
  97. @    @  @@@@@  @   @  @  @   @ @  @ @@@@@ @         @  @   @ @@@@@ @ @  @  
  98. @    @  @       @  @  @  @   @ @  @ @     @         @  @   @ @     @ @   @
  99. @   @   @   @ @  @ @  @  @   @  @@  @   @ @     @   @  @   @ @   @ @ @ @  @
  100. @@@@     @@@   @@   @ @   @@@   @    @@@  @      @@@   @   @  @@@  @ @  @@
  101.                                 @                                          
  102.                               @@                                          
  103.  
  104.  
  105.  
  106. );
  107. }
  108.  
  109. sub copyright {
  110.    print "\n\n-- == Doddy Hackman 2012 == --\n\n";
  111.    <stdin>;
  112.    exit(1);
  113. }
  114.  
  115. # The End ?
  116.  
310  Programación / Scripting / [Perl Tk] Finder Text 0.2 en: 23 Junio 2012, 18:16 pm
Version Tk de un programa para buscar patrones en cualquier directorio.

Una imagen



El codigo

Código
  1. #!usr/bin/perl
  2. #Finder Text 0.2
  3. #Version Tk
  4. #Coded By Doddy H
  5.  
  6. use Tk;
  7.  
  8. my $color_fondo = "black";
  9. my $color_texto = "green";
  10.  
  11. #if ($^O eq 'MSWin32') {
  12. #use Win32::Console;
  13. #Win32::Console::Free();
  14. #}
  15.  
  16. my $vent =
  17.  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
  18. $vent->title("Finder Text 0.2 (C) Doddy Hackman 2012");
  19. $vent->geometry("395x440+20+20");
  20. $vent->resizable( 0, 0 );
  21.  
  22. $vent->Label(
  23.    -text       => "Directory : ",
  24.    -font       => "Impact1",
  25.    -background => $color_fondo,
  26.    -foreground => $color_texto
  27. )->place( -x => 20, -y => 20 );
  28. my $dir = $vent->Entry(
  29.    -width      => 40,
  30.    -background => $color_fondo,
  31.    -foreground => $color_texto
  32. )->place( -x => 100, -y => 23 );
  33.  
  34. $vent->Label(
  35.    -text       => "String : ",
  36.    -font       => "Impact1",
  37.    -background => $color_fondo,
  38.    -foreground => $color_texto
  39. )->place( -x => 20, -y => 50 );
  40. my $string = $vent->Entry(
  41.    -width      => 30,
  42.    -background => $color_fondo,
  43.    -foreground => $color_texto
  44. )->place( -x => 80, -y => 53 );
  45.  
  46. $vent->Button(
  47.    -text             => "Find",
  48.    -command          => \&now,
  49.    -width            => 11,
  50.    -background       => $color_fondo,
  51.    -foreground       => $color_texto,
  52.    -activebackground => $color_texto
  53. )->place( -x => 271, -y => 53 );
  54.  
  55. $vent->Label(
  56.    -text       => "Files Found",
  57.    -font       => "Impact",
  58.    -background => $color_fondo,
  59.    -foreground => $color_texto
  60. )->place( -x => 150, -y => 100 );
  61. my $listas = $vent->Listbox(
  62.    -width      => 50,
  63.    -height     => 15,
  64.    -background => $color_fondo,
  65.    -foreground => $color_texto
  66. )->place( -x => 45, -y => 150 );
  67.  
  68. $vent->Label(
  69.    -text       => "Status : ",
  70.    -font       => "Impact1",
  71.    -background => $color_fondo,
  72.    -foreground => $color_texto
  73. )->place( -x => 70, -y => 390 );
  74. my $tatus = $vent->Entry(
  75.    -width      => 30,
  76.    -background => $color_fondo,
  77.    -foreground => $color_texto
  78. )->place( -x => 130, -y => 393 );
  79.  
  80. $listas->bind( "<Double-1>", [ \&loader ] );
  81.  
  82. MainLoop;
  83.  
  84. sub loader {
  85.    $listasx = $listas->curselection();
  86.    for my $id (@$listasx) {
  87.        my $linkar = $listas->get($id);
  88.        system("$linkar");
  89.    }
  90. }
  91.  
  92. sub now {
  93.    $listas->delete( "0.0", "end" );
  94.    goodbye( $dir->get, $string->get );
  95.    $tatus->configure( -text => " " );
  96. }
  97.  
  98. sub verificar {
  99.  
  100.    my ( $file, $text ) = @_;
  101.    my $numero_linea = 0;
  102.  
  103.    open( FILE, $file );
  104.    my @words = <FILE>;
  105.    close FILE;
  106.  
  107.    chomp @words;
  108.  
  109.    for my $linea (@words) {
  110.        chomp $linea;
  111.        $numero_linea++;
  112.        if ( $linea =~ /$text/ ) {
  113.            $listas->insert( "end", $file );
  114.        }
  115.    }
  116. }
  117.  
  118. sub goodbye {
  119.    opendir DIR, $_[0];
  120.    my @archivos = readdir DIR;
  121.    close DIR;
  122.  
  123.    for (@archivos) {
  124.        next if $_ eq "." or $_ eq "..";
  125.        my $fichero = $_[0] . "/" . $_;
  126.  
  127.        if ( -f $fichero ) {
  128.            $vent->update;
  129.            $tatus->configure( -text => $fichero );
  130.            verificar( $fichero, $_[1] );
  131.        }
  132.  
  133.        if ( -d $fichero ) {
  134.            &goodbye( $fichero, $_[1] );
  135.        }
  136.    }
  137. }
  138.  
  139. #The End ?
  140.  
  141.  
Páginas: 1 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [31] 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 ... 55
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines