Author Topic: [Perl] Project Kakilles 0.3  (Read 637 times)

0 Members and 1 Guest are viewing this topic.

Offline Doddy

  • Serf
  • *
  • Posts: 30
  • Cookies: 20
    • View Profile
[Perl] Project Kakilles 0.3
« on: January 06, 2014, 12:57:38 am »
A simple script that I made as a parody of the famous Achilles program, so poop comes kakilles program.

I leave you a video that has 3 usage examples:

* HTTP Header Injection
* Bypass Uploaders
* Cookie Handling

The video :

- Project Kakilles - Examples of use -

The source :

Code: (perl) [Select]
#!usr/bin/perl
#Project Kakilles 0.3
#(C) Doddy Hackman 2014

use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::simple;
use HTTP::Proxy::BodyFilter::complete;

my $port;

head();

if ( $ARGV[1] ne "" ) {
    $port = $ARGV[1];
}
else {
    $port = 8080;
}

if ( $ARGV[0] eq "" ) {
    sintax();
    copyright();
}

$SIG{INT} = \&copyright;

my $logs       = "logs.txt";
my $leer_datos = "center.txt";

print "\n[+] Kakilles Online : $port ...\n";

my $server = HTTP::Proxy->new( port => $port );
$server->host();

$server->push_filter(
    mime     => undef,
    response => HTTP::Proxy::BodyFilter::complete->new()
);

$server->push_filter(
    mime     => undef,
    request  => HTTP::Proxy::BodyFilter::simple->new( \&enable ),
    response => HTTP::Proxy::BodyFilter::simple->new( \&enable2 )
);

$server->start();

sub enable {

    my @logs;

    my ( $self, $dataref, $message, $protocol, $buffer ) = @_;

    if ( $ARGV[0] =~ /p/ ) {

        if ( $message->content ne "" and $message->method eq "POST" ) {

            print
"\n########################################################################\n";
            print "[+] Method : " . $message->method;
            print "\n[+] Content : " . $message->content;
            savefile( $leer_datos, $message->content );
            print
"\n########################################################################\n";

            print "\n[+] Change ? [y/n] : ";
            chomp( my $rta = <stdin> );

            if ( $rta =~ /y/ ) {

                system_leida($leer_datos);

                my $source = abrir();
                $message->header( "content-length" => length($source) );
                $message->content($source);

                print "\n[+] Changed !\n";

            }
        }
    }

    if ( $ARGV[0] =~ /g/ ) {

        if ( $message->uri =~ /(.*)\?(.*)/ ) {

            print
"\n########################################################################\n";
            print "[+] GET : " . $message->uri;
            savefile( $leer_datos, $message->uri );
            print
"\n########################################################################\n";

            print "\n[+] Change ? [y/n] : ";
            chomp( my $rta = <stdin> );

            if ( $rta =~ /y/ ) {

                system_leida($leer_datos);

                my $source = abrir();

                $message->uri($source);

                print "\n[+] Changed !\n";

            }

        }

    }

    if ( $ARGV[0] =~ /a/ ) {

        print
"\n########################################################################\n";
        print "[+] User-Agent : " . $message->header("user-agent");
        savefile( $leer_datos, $message->header("user-agent") );
        print
"\n########################################################################\n";

        print "\n[+] Change ? [y/n] : ";
        chomp( my $rta = <stdin> );

        if ( $rta =~ /y/ ) {

            system_leida($leer_datos);

            my $source = abrir();

            $message->header( "user-agent" => $source );

            print "\n[+] Changed !\n";

        }
    }

    if ( $ARGV[0] =~ /o/ ) {

        print
"\n########################################################################\n";
        print "[+] Cookie : " . $message->header("cookie");
        savefile( $leer_datos, $message->header("cookie") );
        print
"\n########################################################################\n";

        print "\n[+] Change ? [y/n] : ";
        chomp( my $rta = <stdin> );

        if ( $rta =~ /y/ ) {

            system_leida($leer_datos);

            my $source = abrir();

            $message->header( "cookie" => $source );

            print "\n[+] Changed !\n";

        }
    }

}

sub enable2 {
    my ( $j, $k, $l, $m, $n ) = @_;

    if ( $ARGV[0] =~ /c/ ) {

        if ( $$k ne "" ) {

            print
              "\n##########################################################\n";
            print "[+] Content : " . $$k;
            savefile( $leer_datos, $$k );
            print
              "\n##########################################################\n";

            print "\n[+] Change ? [y/n] : ";
            chomp( my $rta = <stdin> );

            if ( $rta =~ /y/ ) {

                system_leida($leer_datos);

                my $source = abrir();

                $$k = $source;

                print "\n[+] Changed !\n";

            }

        }

    }

}

# Functions

sub system_leida {
    my $os = $^O;
    if ( $os =~ /Win/ig ) {
        system( "start " . $_[0] );
    }
    else {
        system( "sudo gedit " . $_[0] );
    }
}

sub abrir {
    open my $FILE, q[<], $leer_datos;
    my $word = join q[], <$FILE>;
    close $FILE;
    chomp $word;
    return $word;
}

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

sub head {
    print "\n-- == Project Kakilles 0.3 == --\n";
}

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

sub sintax {
    print "\n[+] Sintax : $0 <options> <port>\n";
    print "\n[?] Options ...\n\n";
    print "-g : Form with GET\n";
    print "-p : Form with POST\n";
    print "-a : Edit User-Agent\n";
    print "-c : Edit Content\n";
    print "-o : Edit Cookie\n";
    print "\n[+] Example : $0 -pc 666\n";
}

# The End ?

The code is here