You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 60 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - PHP-Nuke Upload and Execution of Arbitrary Code [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
sambeckett
Corporal
Corporal


Joined: Jun 25, 2003
Posts: 63


PostPosted: Tue Oct 07, 2003 4:49 pm Reply with quoteBack to top

http://www.secunia.com/advisories/9954/
Find all posts by sambeckettView user's profileSend private message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Tue Oct 07, 2003 5:35 pm Reply with quoteBack to top

Hi'ya its the mailattach which was addressed months ago actually.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
sambeckett
Corporal
Corporal


Joined: Jun 25, 2003
Posts: 63


PostPosted: Tue Oct 07, 2003 5:39 pm Reply with quoteBack to top

its not what they are tallking about @ http://nukecops.com/postt11405.html

if not, should we fix that?
Find all posts by sambeckettView user's profileSend private message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Tue Oct 07, 2003 5:45 pm Reply with quoteBack to top

Hi'ya like I said above, this was resolved months ago. Francisco and I had worked together to fix this issue, to which his was fix applied. Check the mailattach.php and you'll see this:

Quote:
if (isset($userfile) AND $userfile != "none" AND !ereg("/", $userfile) AND !ereg("\.\.", $userfile) AND !ereg("%", $userfile)) {
if (ini_get(file_uploads) AND $attachments == 1) {
$updir = "tmp";
@copy($userfile, "$updir/$userfile_name");
@unlink($userfile);
}
}


That has been in place for a long time now. Hence why folks with the newest mailattach.php cannot get it to traverse directories.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Tue Oct 07, 2003 5:48 pm Reply with quoteBack to top

The article mentions nuke 6.x and like Zhen mentioned most likely refers to the old problem yet it gets posted now Rolling Eyes

_________________
Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
Find all posts by chatservView user's profileSend private messageVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Tue Oct 07, 2003 5:57 pm Reply with quoteBack to top

His addition seems to go against PHP.net's recommendation:

http://www.php.net/features.file-upload

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
frog-man
Nuke Cadet
Nuke Cadet


Joined: Oct 08, 2003
Posts: 6


PostPosted: Wed Oct 08, 2003 6:53 am Reply with quoteBack to top

Hi,
this has already been posted here :http://nukecops.com/postt11335.html.
I'm sorry Zhen-Xjell,I like your work but your patch doesn't patch my hole. And it will stop all normal uploads with a server under Linux/Unix system !
The function that will stop it is :
!ereg("/", $userfile)
under Linux, the $userfile value will be something like /home/temp/TEMPNAMEFILE . So there's 3 caracters "/" in $userfile, and the upload is topped.
But there is no check on $userfile_name. If register_globals is ON, we can choose ourself the name,t eh path and the extention of the file... so we can upload any file where we want.
My solution is :
if (isset($userfile) AND $userfile != "none" AND !ereg("/", $userfile) AND !ereg("\.\.", $userfile) AND !ereg("%", $userfile) AND !isset($_REQUEST["userfile_name"])) {
if (ini_get(file_uploads) AND $attachments == 1) {
$updir = "tmp";
@copy($userfile, "$updir/$userfile_name");
@unlink($userfile);
}

but my solution will stop normal uploads too.
I just see that phpnuke 6.9 have the same hole. I'll work soon on a new mailattach.php that will allow normal uploads and stop the hole.
I don't know why Francisco don't want to hear me... I've send a mail 1 month before send the text to bugtraq but no reply.
My first patch (that will only patch the hole) can be found on http://www.phpsecure.info (there's an english version). It is for phpnuke 6.7 but will work for version before and after (like 6.9).
Sorry for my bad english.
bye
frog
Find all posts by frog-manView user's profileSend private message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Wed Oct 08, 2003 9:26 am Reply with quoteBack to top

frog welcome to the site. Its a pleasure to have you on board. Last night is the first time I was browsing your advisory, however, my laptop decided to crash and I didn't get it back online til a few moments ago. I will read your reply tonight and check this out in more detail. However, tonight I have a previous engagement I need to attend to. So if I skip tonight, I'll be back on it tomorrow.

Our patch releases are sent to Francisco. My initial look at your patch has me feeling uneasy. Its because the use of userfile_name isn't recommended by php.net. That doesn't mean it won't work.

Lets sync up in a day or two.

Thanks

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Wed Oct 08, 2003 9:39 am Reply with quoteBack to top

Oh yes also as an after thought, can you send these initial reports to me going forward too? I don't like to wait for this to go public before we work on issuing the patches into the distro. Thanks frog.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
frog-man
Nuke Cadet
Nuke Cadet


Joined: Oct 08, 2003
Posts: 6


PostPosted: Thu Oct 09, 2003 6:18 am Reply with quoteBack to top

I'm busy so give me the time to code a new mailattach.php. If you want more details on the last one it's on http://www.phpsecure.info. If you want to contact me it's leseulfrog@hotmail.com.
bye Smile
frog
Find all posts by frog-manView user's profileSend private message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Thu Oct 09, 2003 6:19 am Reply with quoteBack to top

No problems, we'll also be working on the advisories. Just if you can going forward notify me at zx@nukecops.com. Thanks

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
frog-man
Nuke Cadet
Nuke Cadet


Joined: Oct 08, 2003
Posts: 6


PostPosted: Thu Oct 09, 2003 8:36 am Reply with quoteBack to top

Ok I've made a new mailattach.php and I've sent a mail.
Find all posts by frog-manView user's profileSend private message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Thu Oct 09, 2003 8:43 am Reply with quoteBack to top

Ok I will check in the afternoon my time because I'm running off to a meeting. If you get a bounce back, feel free to send it to laudanp - at - yahoo - dot - com.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Thu Oct 30, 2003 1:16 am Reply with quoteBack to top

frog-man wrote:
Ok I've made a new mailattach.php and I've sent a mail.
Well I think you've got my reply right? I'm good with using your patch on this. Ultimately I myself don't like mailattach.php very much anyway.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Jeruvy
Lieutenant
Lieutenant


Joined: Jul 09, 2003
Posts: 293


PostPosted: Thu Oct 30, 2003 5:21 pm Reply with quoteBack to top

Has this been added to the CVS or the beta site?

_________________
J.
j e r u v y a t y a h o o d o t c o m
Find all posts by JeruvyView user's profileSend private messageICQ Number
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.450 Seconds - 211 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::