exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Flatnux Local File Inclusion / Upload

Flatnux Local File Inclusion / Upload
Posted Apr 20, 2009
Authored by __GiReX__ | Site girex.altervista.org

Flatnux 2009-03-27 suffers from local file inclusion and shell upload vulnerabilities.

tags | exploit, shell, local, vulnerability, file inclusion, file upload
SHA-256 | c568e2779c9daad62a0cf157bd7e4dfcd22d49ad256b4f2b6cda375bc23c80a7

Flatnux Local File Inclusion / Upload

Change Mirror Download
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)


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close