exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

phpnuke-bypass-sql.txt

phpnuke-bypass-sql.txt
Posted Apr 17, 2007
Authored by Aleksandar aka sale83

PHP-Nuke versions 8.0.0.3.3b and below suffer from a flaw that allows the SQL injection protection to be bypassed thus allowing for attacks. Details provided.

tags | exploit, php, sql injection, bypass
SHA-256 | e8ff03b9574af29c44c7061332f9fa9f8c0b900accd47af22c307553c80e497d

phpnuke-bypass-sql.txt

Change Mirror Download
PHP Nuke <= 8.0.0.3.3b SQL Injections and Bypass SQL Injection Protection vulnerabilities

________________________
PROGRAM: PHP-Nuke
HOMEPAGE: http://phpnuke.org/
VERSION: All version
BUG: PHP Nuke <= 8.0.0.3.3b Bypass SQL Injection Protection and SQL Injections vulnerabilities
AUTHOR: Aleksandar
________________________




Let's look at source code from mainfile.php line 435
__________________________________________

//Union Tap
//Copyright Zhen-Xjell 2004 http://nukecops.com
//Beta 3 Code to prevent UNION SQL Injections
unset($matches);
unset($loc);
if(isset($_SERVER['QUERY_STRING'])) {
if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", rawurldecode($loc=$_SERVER['QUERY_STRING']), $matches)) {
die('Illegal Operation 1');
}
}
if(!isset($admin) OR (isset($admin) AND !is_admin($admin))) {
$queryString = $_SERVER['QUERY_STRING'];
if (($_SERVER['PHP_SELF'] != "/index.php") OR !isset($url))
{
if (stristr($queryString,'http://')) die('Illegal Operation 2');
}
if ((stristr($queryString,'%20union%20')) OR (stristr($queryString,'/*')) OR (stristr($queryString,'*/union/*')) OR (stristr($queryString,'c2nyaxb0')) OR (stristr($queryString,'+union+')) OR ((stristr($queryString,'cmd=')) AND (!stristr($queryString,'&cmd'))) OR ((stristr($queryString,'exec')) AND (!stristr($queryString,'execu'))) OR (stristr($queryString,'concat'))) {
die('Illegal Operation 3');
}
}__________________________________________

So we can se different filters. :)

Let’s start whit a testing:

TEST 1
http://localhost/nuke/?/*
So we will se this message: Illegal Operation 3

TEST 2
http://localhost/nuke/?%2f*

Yeah - we got through :)

TEST 3
http://localhost/?%20UNION%20SELECT

Illegal Operation 1

TEST 4
http://localhost:8080/html80/?%2f**/UNION%2f**/SELECT ..

Yeah - we got through :)




PATCH:
__________________________________________

if ((stristr($queryString,'%20union%20')) OR (stristr($queryString,'*%2f*')) OR (stristr($queryString,'/*')) OR (stristr($queryString,'*/union/*')) OR (stristr($queryString,'c2nyaxb0')) OR (stristr($queryString,'+union+')) OR ((stristr($queryString,'cmd=')) AND (!stristr($queryString,'&cmd'))) OR ((stristr($queryString,'exec')) AND (!stristr($queryString,'execu'))) OR (stristr($queryString,'concat'))) {
die('Illegal Operation');
}
__________________________________________



Multiple SQL Injection vulnerability in Web_Links, News and Download module



+++++++++++++++++++++++++++

PHP.ini
Magic Quotes = OFF
Register Global = ON
+++++++++++++++++++++++++++


Now Let's look at source code from Web_Links/index.php:

Vulnerability function

function viewlinkcomments($lid) {
global $prefix, $db, $admin, $bgcolor2, $module_name, $admin_file;
include("header.php");
include("modules/$module_name/l_config.php");
menu(1);
$row = $db->sql_fetchrow($db->sql_query("SELECT title FROM ".$prefix."_links_links WHERE lid='$lid'")); // BUG ---> $lid
$ttitle = filter($row['title'], "nohtml");
$lid = intval(trim($lid)); //WTF?<===== lol ??????????????? :):):):):)
echo "<br>";
...


How to fix:

Add $lid = intval(trim($lid)); before $row = $db->sql_fetchrow($db->sql_query("SELECT title FROM ".$prefix."_links_links WHERE lid='$lid'"));

___________________________________________
function viewlinkcomments($lid) {
global $prefix, $db, $admin, $bgcolor2, $module_name, $admin_file;
include("header.php");
include("modules/$module_name/l_config.php");
menu(1);
$lid = intval(trim($lid)); // FIX
$row = $db->sql_fetchrow($db->sql_query("SELECT title FROM ".$prefix."_links_links WHERE lid='$lid'"));
$ttitle = filter($row['title'], "nohtml");
//$lid = intval(trim($lid)); // REMOVE THIS LINE !!!!!!!
echo "<br>";
...
__________________________________________________

Vulnerability Functions:

function viewlinkcomments($lid) {
function viewlinkeditorial($lid){
function viewlinkcomments($lid){
function ratelink($lid, $user) {

The "$lid" variable isn't filtered, so if we bypass the sql injection protection we can execute arbitrary sql commands.

SQL Injection vulnerability in Downloads
Vulnerability Functions:

function viewdownloadeditorial($lid) {
function viewdownloadcomments($lid) {
function ratedownload($lid, $user) {

The "$lid" variable isn't filtered , so if we bypass the sql injection protection we can execute arbitrary sql commands.


SQL Injection vulnerability in News
Vulnerability Function:

function rate_complete($sid, $rated=0, $score) {

The "$sid" variable isn't filtered , so if we bypass the sql injection protection we can execute arbitrary sql commands.

Best Regards
Aleksandar
Programmer and Web Developer
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    44 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close