Lucene search
K

Flatnux Local File Inclusion / Upload

🗓️ 20 Apr 2009 00:00:00Reported by __GiReX__Type 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 14 Views

Flatnux CMS Remote Vulnerabilitie

Code
`Author: girex  
  
Homepage: girex.altervista.org  
Date: 17/04/2009  
  
CMS: flatnux-2009-03-27  
site: flatnux.altervista.org  
  
Bugs: Multiple remote vulnerabilities  
  
  
Flatnux suffers of multiple local file inclusions: (output of my scanner)  
  
Line: 10  
File: D:/xampp/htdocs/flat/flatnux/sections/00_News/admin.php  
require_once("sections/".sectionlocation($_FN['vmod'])."/functions.php");  
  
  
Line: 6  
File: D:/xampp/htdocs/flat/flatnux/sections/02_Flatforum/search.php  
include ("sections/$module/config.php");  
  
  
Line: 8  
File: D:/xampp/htdocs/flat/flatnux/sections/06_Download/section.php  
include ("sections/$_FNVMOD/config.php");  
  
  
Line: 3  
File: D:/xampp/htdocs/flat/flatnux/sections/08_Files/search.php  
include ("sections/$module/config.php");  
  
  
Line: 30  
File: D:/xampp/htdocs/flat/flatnux/sections/10_Login/section.php  
include ("sections/{$_FN['vmod']}/config.php");  
  
  
Line: 14  
File: D:/xampp/htdocs/flat/flatnux/sections/none_Control_Center/section.php  
require_once ("sections/{$_FN['vmod']}/cc_functions.php");  
  
  
Line: 2  
File: D:/xampp/htdocs/flat/flatnux/themes/tp_alpha/theme.php  
include ("themes/{$_FN['theme']}/config.php");  
  
  
Line: 2  
File: D:/xampp/htdocs/flat/flatnux/themes/tp_dhtml2/theme.php  
include ("themes/{$_FN['theme']}/config.php");  
  
  
Line: 2  
File: D:/xampp/htdocs/flat/flatnux/themes/tp_green/theme.php  
include ("themes/{$_FN['theme']}/config.php");  
  
  
Now see...  
File: /include/xmldb.php - Lines: 433-447  
  
if (isset ($_FILES[$key]['tmp_name']) && $_FILES[$key]['tmp_name'] != "")  
{  
  
if (eregi('.php', $_FILES["$key"]['name']) || eregi('.php3', $_FILES["$key"]['name']) || eregi('.php4', $_FILES["$key"]['name']) || eregi('.php5', $_FILES["$key"]['name'])) <==  
{  
touch("$path/$databasename/$tablename/$unirecid/$key/" . $_FILES["$key"]['name']);  
}  
else  
{  
if (!file_exists("$path/$databasename/$tablename/$unirecid"))  
mkdir("$path/$databasename/$tablename/$unirecid");  
if (!file_exists("$path/$databasename/$tablename/$unirecid/$key"))  
mkdir("$path/$databasename/$tablename/$unirecid/$key");  
move_uploaded_file(realpath($_FILES[$key]['tmp_name']), "$path/$databasename/$tablename/$unirecid/$key/" . $_FILES["$key"]['name']); <==  
  
  
As you can see the script checks for .php .php3/4/5 extensions but what about  
.phtml extension?  
Depending of web server configuration .phtml can be interpreted as php code.  
  
To upload a file you need a valid login.  
  
You can get the upload module at the URLs:  
  
- /path/index.php?mod=08_Files  
where 08 is the default number but it can be different (max 20 i think)  
  
or   
- /path/index.php?mod=none_Files  
  
  
Remember that you need aùto be authenticated.  
  
Now upload your shell with .phtml extension and retrieve its link.  
  
If the web server does not interprets .phtml files as php files you can   
upload a .txt file with malicious code (ex <? system($cmd);?>)  
  
And include it with one of local file inclusions reported before.  
So you can obtain a Remote Command Execution depending of php.ini configuration becouse lfi's works with:  
  
register_globals = On  
magic_quotes_gpc = Off  
  
Too see the php.ini configuration you can use this phpinfo() disclosure:  
  
- /path/sections/none_Control_Center/phpinfo.php  
or  
- /path/sections/10_Control_Center/phpinfo.php  
where 10 can be different number (max 20 i think)  
  
  
`

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

20 Apr 2009 00:00Current
7.4High risk
Vulners AI Score7.4
14