|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 115
Members: 0
Total: 115
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
New security flaws in phpnuke all versions! |
|
Posted: Thu Jun 03, 2004 10:37 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
|
Last edited by waraxe on Mon Feb 14, 2005 10:19 pm; edited 1 time in total |
|
|
|
|
|
|
|
Posted: Thu Jun 03, 2004 8:30 pm |
|
|
Dogman |
Beginner |
|
|
Joined: May 18, 2004 |
Posts: 2 |
|
|
|
|
|
|
|
Hm,...
first aid could be this one ( it worked for me ):
http://www.gijza.net/downloads-cat-1.html
But dont't forget to fix it... --> http://www.waraxe.us/?modname=sa&id=010
Or you put an ".htaccess"-file like this:
Code: |
ErrorDocument 401 http://www.YourDomain.com/error.html
ErrorDocument 403 http://www.YourDomain.com/error.html
ErrorDocument 404 http://www.YourDomain.com/error.html
ErrorDocument 500 http://www.YourDomain.com/error.html
|
in the Root of your PHPNuke...
You have to make your own "error.html"...
Dogman |
|
|
|
|
|
|
|
|
Posted: Thu Jun 03, 2004 8:34 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Seems, that most of the phpnuke script files must be corrected against direct access possibilities, and this time permanently! I suggest to use phpBB style - first in mainfile.php some constant, like "IN_NUKE" will be defined, and then in any script beginning is check for it. Constants can't be injected from outside, so it will be bulletproof protection. |
|
|
|
|
Posted: Sat Jun 05, 2004 3:39 pm |
|
|
Tank863 |
Regular user |
|
|
Joined: May 18, 2004 |
Posts: 5 |
|
|
|
|
|
|
|
waraxe...
can you show us 'non-coders' or newbie coders an example of how we can fix this?
Tank863 |
|
|
|
|
|
|
|
|
Posted: Sat Jun 05, 2004 11:09 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Ok, first thing, open the mainfile.php and look at beginning:
Code: |
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security checking code 2003 by chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
//Union Tap
//Copyright Zhen-Xjell 2004 http://nukecops.com
//Beta 3 Code to prevent UNION SQL Injections
unset($matches);
unset($loc);
|
Now add constant definition after copyright messages:
Code: |
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security checking code 2003 by chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
define('IN_NUKE',1);
//Union Tap
//Copyright Zhen-Xjell 2004 http://nukecops.com
//Beta 3 Code to prevent UNION SQL Injections
unset($matches);
unset($loc);
|
Now you can secure all the affected scripts, mentioned in bugtraq advisory. For example "/modules/news/print.php". Open it:
Code: |
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
|
and now change original checking routine as here:
Code: |
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if(!defined('IN_NUKE'))
{
die('<html><header><title>Stop!</title></header><body><a href="http://www.waraxe.us">Secured by waraxe</a></body></html>');
}
require_once("mainfile.php");
|
Offtopic remark - this line
Code: |
require_once("mainfile.php");
|
is nonsense in all of the not directly accessed scripts by my opinion, because mainfile is allready processed in index.php,admin.php or modules.php . Just useless piece of code... , or am i wrong? Any opinions? |
|
|
|
|
|
|
|
|
Posted: Sun Jun 06, 2004 9:33 am |
|
|
Tora |
Regular user |
|
|
Joined: May 19, 2004 |
Posts: 9 |
Location: Germany |
|
|
|
|
|
|
Quote: | is nonsense in all of the not directly accessed scripts by my opinion, because mainfile is allready processed in index.php,admin.php or modules.php . Just useless piece of code... , or am i wrong? Any opinions? | Hi
That is correct. This line is redundant and useless. |
|
|
|
|
Posted: Sun Jun 06, 2004 5:45 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Seems, that its time for PhpNuke 8.0 to come out - with all the patches and code rewrites, and hopefully md5 hash in user cookies will be replaced with session ID-s, like in case of phpBB. |
|
|
|
|
|
a |
|
Posted: Sun Jun 06, 2004 7:57 pm |
|
|
SteX |
Advanced user |
|
|
Joined: May 18, 2004 |
Posts: 181 |
Location: Serbia |
|
|
|
|
|
|
I dont think that php-nuke will be relased soon... |
|
_________________
We would change the world, but God won't give us the sourcecode...
....Watch the master. Follow the master. Be the master....
------------------------------------------------------- |
|
|
|
|
|
|
|
Posted: Tue Jun 08, 2004 10:16 am |
|
|
Good CO |
Beginner |
|
|
Joined: Jun 08, 2004 |
Posts: 2 |
|
|
|
|
|
|
|
I'm completely new to the security side of php nuke (thank you for the wakeup call), so forgive me if this is a stupid question, but can you not deal totally with the path disclosure issue using php.ini?:
; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = Off |
|
|
|
|
|
|
|
|
Posted: Tue Jun 08, 2004 10:51 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Its true, that this works, and its good style for silence error messages for finalized website, but IF something will fail in future and you cant see error messages, then it is not so good. So i think, that website engine must silence error messages, but log them all to some file/database for debugging purposes, through error handling function. Or this option - admin/webmaster can browse website with additional GET parameter ("debug=1" is too obvious, but how about "letmesee4errors=1") and in this situation error messages will be shown, so webmaster can be sure, that all the site runs smoothly and without visual error messages. |
|
|
|
|
|
Apache Mod_access / deny from etc |
|
Posted: Thu Jun 10, 2004 8:43 am |
|
|
Good CO |
Beginner |
|
|
Joined: Jun 08, 2004 |
Posts: 2 |
|
|
|
|
|
|
|
Another idea which I haven't seen discussed and once again please bear in mind I'm new to this.
I've been reading with despair the nuke problems and in particular about the coppermine gallery, which I'm keen to keep if at all possible. Most problems seem to be related to direct file access / XSS.
Can I defeat this totally (ish) using the httpd.conf file in apache as follows?:
<Directory "/mypath/html/modules/coppermine">
deny from all
<Files scripts.js>
allow from all
</Files>
<Files jspw.js>
allow from all
</Files>
</Directory>
<Directory "/mypath/html/modules/coppermine/albums">
allow from all
</Directory>
<Directory "/mypath/html/modules/coppermine/images">
allow from all
</Directory>
<Directory "/mypath/html/modules/coppermine/themes/maze">
deny from all
<Files style.css>
allow from all
</Files>
</Directory>
<Directory "/mypath/html/modules/coppermine/themes/maze/images">
allow from all
</Directory> |
|
|
|
|
|
|
|
|
Posted: Tue Jun 15, 2004 12:07 pm |
|
|
DaveTomneyUK |
Beginner |
|
|
Joined: Jun 15, 2004 |
Posts: 2 |
|
|
|
|
|
|
|
Would a simple htaccess file stop this with this contents in the file?
put inside the modules/news/ folder. |
|
|
|
|
Posted: Fri Jun 18, 2004 1:36 am |
|
|
5y573m f41lur3 |
Regular user |
|
|
Joined: May 25, 2004 |
Posts: 9 |
|
|
|
|
|
|
|
so the concerning of this Bug is "Full Path Disclosure" ? |
|
|
|
|
Posted: Thu Jul 08, 2004 8:56 pm |
|
|
genoxide |
Regular user |
|
|
Joined: Jun 14, 2004 |
Posts: 15 |
|
|
|
|
|
|
|
so if we replace
the old
Code: | if (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); }
|
or
Code: | if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
die ("You can't access this file directly...");
} |
with
Code: |
if ( !defined('IN_NUKE') )
{
die("Hacking attempt");
exit;
}
|
it's ok |
|
|
|
|
www.waraxe.us Forum Index -> PhpNuke
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|