Waraxe IT Security Portal
Login or Register
October 24, 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: 113
Members: 0
Total: 113
Full disclosure
SEC Consult SA-20241015-0 :: Multiple Vulnerabilities in Rittal IoT Interface & CMC III Processing Unit (CVE-2024-47943, CVE-2024-47944, CVE-2024-47945)
CVE-2024-48939: Unauthorized enabling of API in Paxton Net2software
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
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> PhpNuke -> PHP-Nuke <= 7.9 Old-Articles Block SQL Injection
Post new topicReply to topic View previous topic :: View next topic
PHP-Nuke <= 7.9 Old-Articles Block SQL Injection
PostPosted: Sat Jan 13, 2007 10:49 am Reply with quote
Paisterist
Valuable expert
Valuable expert
Joined: Oct 23, 2006
Posts: 6
Location: Argentina




Code:
/*
--------------------------------------------------------
[N]eo [S]ecurity [T]eam [NST] - Advisory 31 - 2007-01-13
--------------------------------------------------------
Program: PHP-Nuke
Homepage: http://www.phpnuke.org
Vulnerable Versions: PHP-Nuke <= 7.9
Risk: Medium
Impact: Medium Risk

-==PHP-Nuke <= 7.9 Old-Articles Block "cat" SQL Injection vulnerability==-
---------------------------------------------------------

- Description
---------------------------------------------------------
PHP-Nuke is a news automated system specially designed to be used in Intranets and Internet. The Administrator has total control of his web site, registered users, and he will have in the hand a powerful assembly of tools to maintain an active and 100% interactive web site using databases.

- Tested
---------------------------------------------------------
localhost & many sites

- Vulnerability Description
---------------------------------------------------------

In /blocks/block-Old_Articles.php the "cat" variable is not sanitized correctly. Here is the vulnerable code:

==[ /blocks/block-Old_Articles.php 33-40 ]=========================
if ($categories == 1) {
$querylang = "where catid='$cat'";
} else {
$querylang = "";
if ($new_topic != 0) {
$querylang = "WHERE topic='$new_topic'";
}
}
==[ end /blocks/block-Old_Articles.php 33-40 ]=====================


Note that register_globals must be On, because the "cat" variable is not defined anywhere. Also, the $querylang variable is
used after to get some database data:

==[ /blocks/block-Old_Articles.php 49 ]=============================
[...]
$result = $db->sql_query("SELECT sid, title, time, comments FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT $storynum, $oldnum");
[...]
==[ end /blocks/block-Old_Articles.php 49]==========================


Then we have a link that contains the data taken from the database:

==[ /blocks/block-Old_Articles.php 94-97-101]=======================
[...]
$boxstuff .= "<tr><td valign=\"top\"><strong><big>·;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
==[ end /blocks/block-Old_Articles.php 94-97-101 ]==================


So, in resume, if we set "categories" var to 1 by the GET method and then we set "cat" (also by the GET method) to a malicio
us sql code, we can get easily the admin data with a UNION statement. If you don't how to bypass the PHP-Nuke SQL Protection
just read this advisory:
http://www.neosecurityteam.net/advisories/PHP-Nuke--7.9-SQL-Injection-and-Bypass-SQL-Injection-Protection-vulnerabilities-27.html

magic_quotes_gpc php directive must be turned Off so the simple quotes (') are not filtered. Also we have to know the prefix
used for the database tables ("nuke_" by default).

==Pseudo-Code Proof of Concept exploit==
<?
/*

Neo Security Team - Pseudo-Code Proof of Concept Exploit
PHP-Nuke <= 7.9 Old-Articles Block "cat" SQL Injection vulnerability

http://www.neosecurityteam.net
Paisterist

*/
set_time_limit(0);
$host="localhost";
$path="/phpnuke/";
$port="80";
$fp = fsockopen($host, $port, $errno, $errstr, 30);

if ($fp) {
/* we put the GET request on $p variable, with "cid" with the malicious code and "categories" set to 1. */

fwrite($fp, $p);

while (!feof($fp)) {
$content .= fread($fp, 4096);
}

preg_match("/([a-z0-9]{32})/", $content, $matches);

if ($matches[0])
print "<b>Hash: </b>".$matches[0];
}
?>
==Pseudo-Code Proof of Concept exploit==

Whit this PoC code i get the md5 hash of the first admin (God) of the nuke_authors table.

- How to fix it? More information?
--------------------------------------------------------

You can found a patch on http://www.neosecurityteam.net/foro/

Also, you can modify the source code adding in the /index.php file some like this:

$cat = ($_GET['cat']) ? filter($_GET['cat'], "nohtml") : '';

That's a momentary solution to the problem. I recommend to get the PHP-Nuke 8.0 version.

- References
--------------------------------------------------------
http://www.neosecurityteam.net/advisories/PHP-Nuke--7.9-Old-Articles-Block-cat-SQL-Injection-vulnerability-31.html
http://www.neosecurityteam.net/advisories/PHP-Nuke--7.9-SQL-Injection-and-Bypass-SQL-Injection-Protection-vulnerabilities-27.html


- Credits
--------------------------------------------------------
Old-Articles Block SQL Injection discovered by Paisterist -> paisterist[dot]nst [at] gmail[dot]com

[N]eo [S]ecurity [T]eam [NST] - http://www.neosecurityteam.net/


- Greets
--------------------------------------------------------
HaCkZaTaN, K4P0, Daemon21, Link, 0m3gA_x, NitRic, LINUX, nitrous, m0rpheus, nikyt0x, KingMetal, Knightmare and the NST community.

Latinoamerica EXISTS!!

@@@@'''@@@@'@@@@@@@@@'@@@@@@@@@@@
'@@@@@''@@'@@@''''''''@@''@@@''@@
'@@'@@@@@@''@@@@@@ @@@'''''@@@
'@@'''@@@@'''''''''@@@''''@@@
@@@@''''@@'@@@@@@@@@@''''@@@@@

/* EOF */


Original advisory: http://www.neosecurityteam.net/advisories/PHP-Nuke--7.9-Old-Articles-Block-cat-SQL-Injection-vulnerability-31.html

See you[/url]
View user's profile Send private message Send e-mail Visit poster's website
PHP-Nuke <= 7.9 Old-Articles Block SQL Injection
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

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.035 Seconds