Waraxe IT Security Portal
Login or Register
October 13, 2024
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 109
Members: 0
Total: 109
Full disclosure
SEC Consult SA-20241009-0 :: Local Privilege Escalation via MSI installer in Palo Alto Networks GlobalProtect (CVE-2024-9473)
APPLE-SA-10-03-2024-1 iOS 18.0.1 and iPadOS 18.0.1
Some SIM / USIM card security (and ecosystem) info
SEC Consult SA-20240930-0 :: Local Privilege Escalation via MSI Installer in Nitro PDF Pro (CVE-2024-35288)
Backdoor.Win32.Benju.a / Unauthenticated Remote CommandExecution
Backdoor.Win32.Prorat.jz / Remote Stack Buffer Overflow (SEH)
Backdoor.Win32.Amatu.a / Remote Arbitrary File Write (RCE)
Backdoor.Win32.Agent.pw / Remote Stack Buffer Overflow (SEH)
Backdoor.Win32.Boiling / Remote Command Execution
Defense in depth -- the Microsoft way (part 88): a SINGLEcommand line shows about 20, 000 instances of CWE-73
SEC Consult SA-20240925-0 :: Uninstall Password Bypass in BlackBerry CylanceOPTICS Windows Installer Package (CVE-2024-35214)
Apple iOS 17.2.1 - Screen Time Passcode Retrieval (MitigationBypass)
CyberDanube Security Research 20240919-0 | Multiple Vulnerabilities in Netman204
Submit Exploit CVE-2024-42831
Stored XSS in "Edit Profile" - htmlyv2.9.9
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> How to fix -> waraxe-2005-SA#040 - how to fix
Post new topicReply to topic View previous topic :: View next topic
waraxe-2005-SA#040 - how to fix
PostPosted: Mon Feb 14, 2005 10:44 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Wanna fix those ugly security holes? Let's begin...

First of all, open file "db/db.php" and you see this code in begin:

Code:

global $forum_admin;
if ($forum_admin == 1) {
$the_include = "../../../db";
} elseif ($inside_mod == 1) {
$the_include = "../../db";
} else {
$the_include = "db";
}


Add code fragment, preventing from file direct access and additionally
delete some legacy code, so result will be as:

Code:

if (eregi('db.php',$_SERVER['PHP_SELF']))
{
die('Direct access not allowed!');
}

global $forum_admin;
if ($forum_admin == 1) {
$the_include = "../../../db";
} else {
$the_include = "db";
}


Next let's open file "mainfile.php" and ~ line 100 we see this code:

Code:

if ($forum_admin == 1) {
require_once("../../../config.php");
require_once("../../../db/db.php");
} elseif ($inside_mod == 1) {
require_once("../../config.php");
require_once("../../db/db.php");
} else {


We will delete legacy code, so result will be as:

Code:

if ($forum_admin == 1) {
require_once("../../../config.php");
require_once("../../../db/db.php");
} else {


Now let's work with downloads module - open "modules/Downloads/index.php"
and find this code (~line 2354):

Code:

switch($d_op) {

case "menu":
menu($maindownload);
break;

case "AddDownload":
AddDownload();
break;


and delete "menu" section from switch construction, so
result will be something like this:

Code:

switch($d_op) {

case "AddDownload":
AddDownload();
break;


It's time for "newdownloadshowdays" sanityze, so let's find
this code (~ beginning of the file):

Code:

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if (isset($show)) {
$show = intval($show);
}


and let's add additional sanityze code, so result will be as:

Code:

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if (isset($show)) {
$show = intval($show);
}

if(isset($newdownloadshowdays))
{
$newdownloadshowdays = min(max(intval($newdownloadshowdays),1),30);
}


Finally, let's handle Web Links module probs -
open file "modules/Web_Links/indeks.php" and find code like
this (~line 2095):

Code:

switch($l_op) {

case "menu":
menu($mainlink);
break;

case "AddLink":
AddLink();
break;


Delete "menu" section, as in case of downloads module, so
final result will be something like this:

Code:

switch($l_op) {

case "AddLink":
AddLink();
break;


And one more thing - find this code from somewhere in file beginning:

Code:

get_lang($module_name);
$pagetitle = "- "._WEBLINKS."";
require_once("modules/Web_Links/l_config.php");

function getparent($parentid,$title) {
global $prefix, $db;


and add some sanityze code, as in case of downloads module,
so the result will be something like:

Code:

get_lang($module_name);
$pagetitle = "- "._WEBLINKS."";
require_once("modules/Web_Links/l_config.php");

if(isset($newlinkshowdays))
{
$newlinkshowdays = min(max(intval($newlinkshowdays),1),30);
}

function getparent($parentid,$title) {
global $prefix, $db;


That's it - congratulations, your website is now little bit more secure Smile

P.S. All this tutorial is directly applicable to phpnuke 7.5 version, directly
downloaded from phpnuke.org website. If you will try to fix bugs in some
other phpnuke version or derivation, be prepared to somehow different
source code. But anyway, be creative and you will find way to apply fixes
to all other versions too. And if there are problems - don't hesitate to
post them here - this is what for this forum section is meant to be Smile

See ya next time Wink


Last edited by waraxe on Sat Apr 16, 2005 2:50 pm; edited 1 time in total
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Fri Feb 18, 2005 3:50 pm Reply with quote
damned
Regular user
Regular user
Joined: Feb 18, 2005
Posts: 8




Congrats for its work. E the corrections for PNP 7,6 vc has? Now that the correction was divulged,

do you can pass exploit?
View user's profile Send private message
PostPosted: Sat Apr 30, 2005 3:17 pm Reply with quote
maniaka
Beginner
Beginner
Joined: May 18, 2004
Posts: 1




Its only for 7.5 y i apply this patch for 7.6 its good?

Thx
View user's profile Send private message
waraxe-2005-SA#040 - how to fix
www.waraxe.us Forum Index -> How to fix
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

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.044 Seconds