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

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] DH ScreenShoter 0.1
« en: 4 Octubre 2013, 19:31 pm »

Un simple script en perl para sacar un screenshot y subirlo a imageshack.

El codigo :

Código
  1. #!usr/bin/perl
  2. #DH ScreenShoter 0.1
  3. #Coded By Doddy H
  4. #ppm install http://www.bribes.org/perl/ppm/Win32-GuiTest.ppd
  5. #ppm install http://www.bribes.org/perl/ppm/Crypt-SSLeay.ppd
  6.  
  7. use Win32::GuiTest
  8.  qw(GetAsyncKeyState GetForegroundWindow GetWindowText FindWindowLike SetForegroundWindow SendKeys);
  9. use Win32::Clipboard;
  10. use Time::HiRes "usleep";
  11. use LWP::UserAgent;
  12.  
  13. my $nave = LWP::UserAgent->new;
  14. $nave->agent(
  15. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  16. );
  17. $nave->timeout(5);
  18.  
  19. $|++;
  20.  
  21. my $time;
  22. my $nombrefecha;
  23.  
  24. my ( $dia, $mes, $año, $hora, $minutos, $segundos ) = agarrate_la_hora();
  25.  
  26. $nombrefecha =
  27.    $dia . "_"
  28.  . $mes . "_"
  29.  . $año . "_"
  30.  . $hora . "_"
  31.  . $minutos . "_"
  32.  . $segundos;
  33.  
  34. my $se = "captures";
  35.  
  36. unless ( -d $se ) {
  37.    mkdir( $se, "777" );
  38. }
  39.  
  40. chdir $se;
  41.  
  42. head();
  43.  
  44. print "[+] Save Photo with this name : ";
  45. chomp( my $filename = <stdin> );
  46.  
  47. print "\n[+] Get Photo in this time : ";
  48. chomp( my $timeop = <stdin> );
  49.  
  50. print "\n[+] Open photo after taking it ? : ";
  51. chomp( my $load_image = <stdin> );
  52.  
  53. print "\n[+] Upload image to ImageShack ? : ";
  54. chomp( my $imageshack = <stdin> );
  55.  
  56. print "\n[+] Taking shot in ";
  57.  
  58. if ( $timeop eq "" ) {
  59.    $time = 1;
  60. }
  61. else {
  62.    $time = $timeop;
  63. }
  64.  
  65. for my $num ( reverse 1 .. $time ) {
  66.    print "$num.. ";
  67.    sleep 1;
  68. }
  69.  
  70. if ( $filename eq "" ) {
  71.  
  72.    capturar_pantalla( $nombrefecha . ".jpg" );
  73.  
  74. }
  75. else {
  76.  
  77.    capturar_pantalla($filename);
  78.  
  79. }
  80.  
  81. print "\a\a\a";
  82. print "\n\n[+] Photo Taken\n";
  83.  
  84. if ( $imageshack =~ /y/ ) {
  85.    if ( $filename eq "" ) {
  86.        subirarchivo( $nombrefecha . ".jpg" );
  87.    }
  88.    else {
  89.        subirarchivo($filename);
  90.    }
  91. }
  92.  
  93. if ( $load_image =~ /y/ ) {
  94.    if ( $filename eq "" ) {
  95.        system( $nombrefecha. ".jpg" );
  96.    }
  97.    else {
  98.        system($filename);
  99.    }
  100. }
  101.  
  102. copyright();
  103.  
  104. ## Functions
  105.  
  106. sub subirarchivo {
  107.  
  108.    my $your_key = "fuck you";    #Your API Key
  109.  
  110.    print "\n[+] Uploading ...\n";
  111.  
  112.    my $code = $nave->post(
  113.        "https://post.imageshack.us/upload_api.php",
  114.        Content_Type => "form-data",
  115.        Content      => [
  116.            key        => $your_key,
  117.            fileupload => [ $_[0] ],
  118.            format     => "json"
  119.        ]
  120.    )->content;
  121.  
  122.    if ( $code =~ /"image_link":"(.*?)"/ ) {
  123.        print "\n[+] Link : " . $1 . "\n";
  124.    }
  125.    else {
  126.        print "\n[-] Error uploading the image\n";
  127.    }
  128. }
  129.  
  130. sub head {
  131.  
  132.    my @logo = (
  133.        "#=============================================#", "\n",
  134.        "#             DH ScreenShoter 0.1             #", "\n",
  135.        "#---------------------------------------------#", "\n",
  136.        "# Written By Doddy H                          #", "\n",
  137.        "# Email: lepuke[at]hotmail[com]               #", "\n",
  138.        "# Website: doddyhackman.webcindario.com       #", "\n",
  139.        "#---------------------------------------------#", "\n",
  140.        "# The End ?                                   #", "\n",
  141.        "#=============================================#", "\n"
  142.    );
  143.  
  144.    print "\n";
  145.  
  146.    marquesina(@logo);
  147.  
  148.    print "\n\n";
  149.  
  150. }
  151.  
  152. sub copyright {
  153.  
  154.    my @fin = ("-- == (C) Doddy Hackman 2012 == --");
  155.  
  156.    print "\n\n";
  157.    marquesina(@fin);
  158.    print "\n\n";
  159.  
  160.    <stdin>;
  161.  
  162.    exit(1);
  163.  
  164. }
  165.  
  166. sub capturar_pantalla {
  167.  
  168.    SendKeys("%{PRTSCR}");
  169.  
  170.    my $a = Win32::Clipboard::GetBitmap();
  171.  
  172.    open( FOTO, ">" . $_[0] );
  173.    binmode(FOTO);
  174.    print FOTO $a;
  175.    close FOTO;
  176.  
  177. }
  178.  
  179. sub marquesina {
  180.  
  181.    #Effect based in the exploits by Jafer Al Zidjali
  182.  
  183.    my @logo = @_;
  184.  
  185.    my $car = "|";
  186.  
  187.    for my $uno (@logo) {
  188.        for my $dos ( split //, $uno ) {
  189.  
  190.            $|++;
  191.  
  192.            if ( $car eq "|" ) {
  193.                mostrar( "\b" . $dos . $car, "/" );
  194.            }
  195.            elsif ( $car eq "/" ) {
  196.                mostrar( "\b" . $dos . $car, "-" );
  197.            }
  198.            elsif ( $car eq "-" ) {
  199.                mostrar( "\b" . $dos . $car, "\\" );
  200.            }
  201.            else {
  202.                mostrar( "\b" . $dos . $car, "|" );
  203.            }
  204.            usleep(40_000);
  205.        }
  206.        print "\b ";
  207.    }
  208.  
  209.    sub mostrar {
  210.        print $_[0];
  211.        $car = $_[1];
  212.    }
  213.  
  214. }
  215.  
  216. sub agarrate_la_hora {
  217.  
  218.    my ( $a, $b, $c, $d, $e, $f, $g, $h, $i ) = localtime(time);
  219.  
  220.    $f += 1900;
  221.    $e++;
  222.  
  223.    return (
  224.        $d, $e, $f, $c, $b, $a
  225.  
  226.    );
  227.  
  228. }
  229.  
  230. ## The End ?
  231.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 3,797 Último mensaje 18 Mayo 2011, 21:49 pm
por madpitbull_99
[Perl] Creacion de un Joiner en Perl
Scripting
BigBear 0 2,755 Último mensaje 15 Marzo 2013, 16:12 pm
por BigBear
[Delphi] DH ScreenShoter 0.1
Programación General
BigBear 0 1,425 Último mensaje 6 Septiembre 2013, 18:58 pm
por BigBear
[Delphi] DH ScreenShoter Stealer 0.2
Programación General
BigBear 0 1,799 Último mensaje 25 Noviembre 2013, 15:34 pm
por BigBear
[Delphi] DH ScreenShoter 0.3
Programación General
BigBear 0 1,323 Último mensaje 9 Mayo 2014, 20:22 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines