[Fixed] DragonflyCMS 9.0.6.1 Security Fixes
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexSecurity
Author Message
Jeruvy
Security Team


Joined: Apr 23, 2004
Posts: 1433
Location: Canada

PostPost subject: [Fixed] DragonflyCMS 9.0.6.1 Security Fixes
Posted: Thu Feb 09, 2006 7:07 pm
Reply with quote

CPGNuke Dragonfly 9.0.6.1 remote commands execution through arbitrary local inclusion

Posted February 9th, 2006 @ 0212am by rgod @ autistici.org




There are two ways to inject arbitrary code in dragonfly resources:

i) in cpg_error.log, poc:

this works with $error_log = true in error.php (not the default)
some problems with spaces, converted as %20 so this way works with
allow_short_open_tag = On in php.ini

ii) uploading a malicious .png file in modules/coppermine/albums/userpics/
dir. We will search for a php[some hex values].tmp file, you have to supply
valid credentials with upload rights to do that...by default, any user can
upload

however you can try manually including some database file or Apache log... use
your imagination

POC's removed

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger
tuta
Supporter


Joined: Jun 29, 2004
Posts: 465
Location: Houston

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Thu Feb 09, 2006 7:29 pm
Reply with quote

I am not a security expert, but it seems like this is completely dependant upon the user not following install.txt step #8

Quote:
#8 --- After installing, delete install.php and the /install directory!

_________________
SEARCH the WIKI
How to Port for Dragonfly

tuta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/MySQL 4.1.22/PHP 4.4.6/9.1.2.1
Back to top
View user's profile Visit poster's website Yahoo Messenger
Jordo
Newbie


Joined: Jan 31, 2005
Posts: 27

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Thu Feb 09, 2006 7:49 pm
Reply with quote

It looks like it tries 3 different things. The first 2 require install.php and the error log enabled.

If those fail, then it tries a Coppermine exploit.

_________________
Jordo
www.jordomedia.com

Jordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.0.22/4.3.10/9.0.3
Back to top
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5628
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Thu Feb 09, 2006 9:01 pm
Reply with quote

install.php
Code:
if (empty($currentlang) || ($currentlang != 'english' && !file_exists(BASEDIR."install/language/$currentlang.php"))) {
	$currentlang = 'english';
}
change into
Code:
if (empty($currentlang) || !preg_match('#^[a-z_]+$#', $currentlang) || ($currentlang != 'english' && !file_exists(BASEDIR."install/language/$currentlang.php"))) {
	$currentlang = 'english';
}


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5628
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote commands
Posted: Thu Feb 09, 2006 9:21 pm
Reply with quote

error.php fixed
dragonflycms.org/cvs/h....php?g=9.8


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
Jeruvy
Security Team


Joined: Apr 23, 2004
Posts: 1433
Location: Canada

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Thu Feb 09, 2006 10:33 pm
Reply with quote

Excellent work, is there a new archive ready for download.

To my reading of this, yes IF the install.php is LEFT on the server, AND the person deals with the insecure error.php AND/OR [edit: corrected] can upload malicious PNG's (trivial) then this exploit will work.

Of course the thing to keep in mind is since the install.php does not delete itself, it's up to the user who may not be aware, nor read documents fully or perhaps may not understand and be afraid to delete files.

Just to add...a good idea would be in cmsinit.ini to check for the presence of the install dir, and load a page instead of main to remind the user to delete this. Prevent them from using the site proper while it exists.


Cheers!

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}


Last edited by Jeruvy on Thu Feb 09, 2006 10:47 pm; edited 2 times in total
Back to top
View user's profile ICQ Number Yahoo Messenger
Jordo
Newbie


Joined: Jan 31, 2005
Posts: 27

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Thu Feb 09, 2006 10:37 pm
Reply with quote

I'm not reading it that way. I think the image upload is a seperate exploit from the error.php and install.php exploits.(hopefully I'm wrong though).

Mainly because of these lines.
PHP:
if (eregi("HiMaster!",$HtMl)) {echo "Exploit succeeded...<br>";die;}
else {echo "STEP 2 failed..., trying STEP 3...";}

#STEP 3 -> If STEP 2 failed, trying to upload a malicious .png file -> firstly login to retrieve a cookie
# and prepare an album to upload pictures in
if ($ULOGIN=="") {die("I need a valid username to launch STEP 3...");}

_________________
Jordo
www.jordomedia.com

Jordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.0.22/4.3.10/9.0.3
Back to top
View user's profile Visit poster's website
Jeruvy
Security Team


Joined: Apr 23, 2004
Posts: 1433
Location: Canada

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote commands
Posted: Thu Feb 09, 2006 10:43 pm
Reply with quote

Yes, the install.php is mandatory. The error.php and/or the malicious upload can cause the exploit. Sorry I wasn't clearer.
_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger
Jordo
Newbie


Joined: Jan 31, 2005
Posts: 27

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Thu Feb 09, 2006 10:45 pm
Reply with quote

Jeruvy wrote:
Yes, the install.php is mandatory. The error.php and/or the malicious upload can cause the exploit. Sorry I wasn't clearer.

Sometimes I like being wrong. Thanks!

_________________
Jordo
www.jordomedia.com

Jordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.0.22/4.3.10/9.0.3
Back to top
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5628
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote commands
Posted: Thu Feb 09, 2006 11:22 pm
Reply with quote

The coppermine uploading is still worked on.
This is an highly sophisticated script to get around server issues like open_base_dir and safe_mode that are cause by terrible server admins.

If we reverted to the original coppermine upload system this exploit is not there but will fail to work on many servers that are badly setup.


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
pretzy
500+ Posts Club


Joined: Sep 09, 2005
Posts: 519
Location: Australia

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Fri Feb 10, 2006 12:04 am
Reply with quote

this thread dealing with a similar exploit to PhpGedView may be of interest https://sourceforge.net/forum/forum.php?thread_id=1411249&forum_id=185166

basically the exploit involved multiple attempted sign ins which were invaid, and therefore failed. The failed attempts contained code snippets which were written to an unprotected error log as a normal process of the software.

One the critical code had been loaded it was called by another command and the run code enabled the hacker to then install foreign files and scripts on the server.

Fortunately the exploit was only possible on a limited number of older versions running in index mode, without a database.

I'm sure the PhpGedView Devs will help with any inquiries if they can

_________________
Pretzy's Place Pertzel Family Tree History Genealogy
Riverlife Church Henty

pretzy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP_Apache 2.2.2_MySQL 5.0.21_PHP 5.1.4_CPGNuke 9.1.1
Back to top
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5628
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Fri Feb 10, 2006 12:50 am
Reply with quote

Here are the official 9.0.6.1 SF1 branch files:
dragonflycms.org/cvs/h...hp?b=9.6.2
dragonflycms.org/cvs/h...p?b=9.12.2
dragonflycms.org/cvs/h...p?b=9.15.2
dragonflycms.org/cvs/h...p?b=9.19.2

To get the full branch use:
Code:
$ CVSROOT=:pserver:anonymous@dragonflycms.org:/cvs
$ cvs -q checkout -r Df-9_0_6_1-SF1 -P html
Or wait till i get all other exploits we found in there.

[edit]
Also added a previous found XSS fix in there
[/edit]


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS


Last edited by DJ Maze on Fri Feb 10, 2006 1:10 am; edited 1 time in total
Back to top
View user's profile Visit poster's website Yahoo Messenger
Jordo
Newbie


Joined: Jan 31, 2005
Posts: 27

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Fri Feb 10, 2006 1:04 am
Reply with quote

Thanks for your incredibly fast work DJ!
_________________
Jordo
www.jordomedia.com

Jordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.0.22/4.3.10/9.0.3
Back to top
View user's profile Visit poster's website
tuta
Supporter


Joined: Jun 29, 2004
Posts: 465
Location: Houston

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Fri Feb 10, 2006 3:18 am
Reply with quote

Jeruvy wrote:
Just to add...a good idea would be in cmsinit.ini to check for the presence of the install dir, and load a page instead of main to remind the user to delete this. Prevent them from using the site proper while it exists.

I kinda like this idea -- but maybe just a section of the main admin page (where it usually tells you you have the most current version of DF) would be enough of a reminder....

_________________
SEARCH the WIKI
How to Port for Dragonfly

tuta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/MySQL 4.1.22/PHP 4.4.6/9.1.2.1
Back to top
View user's profile Visit poster's website Yahoo Messenger
tank
Gold Supporter


Joined: Apr 20, 2004
Posts: 824
Location: Houston, Texas USA

PostPost subject: Re: Posted on Bugtraq -CPGNuke Dragonfly 9.0.6.1 remote comm
Posted: Sun Feb 12, 2006 3:40 am
Reply with quote

DJMaze wrote:
Here are the official 9.0.6.1 SF1 branch files:
dragonflycms.org/cvs/h...hp?b=9.6.2
dragonflycms.org/cvs/h...p?b=9.12.2
dragonflycms.org/cvs/h...p?b=9.15.2
dragonflycms.org/cvs/h...p?b=9.19.2

To get the full branch use:
Code:
$ CVSROOT=:pserver:anonymous@dragonflycms.org:/cvs
$ cvs -q checkout -r Df-9_0_6_1-SF1 -P html
Or wait till i get all other exploits we found in there.

[edit]
Also added a previous found XSS fix in there
[/edit]

Just to be clear.. we use these files to patch the existing 9.0.6.1 release? Thanks for the fast work!

_________________
Search is your friend

tank's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora Core 1, Apache 1.3.33, Mysql 4.1.14, PHP 5.0.5 w/ APC cache, Dragonfly 9.0.6.1
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexSecurity All times are GMT
Go to page 1, 2  Next
Page 1 of 2


Jump to:  
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
You cannot attach files in this forum
You cannot download files in this forum

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Dansk
Deutsch
Eesti
Italia
Norsk

Testimonials [x]
I just did the phpNuke 7.4 to CPG-Nuke CVS conversion. Was very easy. ... Found everything I needed to help me along the way with a few searches.
The most unexpected and best thing I have found after switching was the increased speed. I used to think I needed to change hosts--since switching to CPG-Nuke all my users have commented on how much faster pages load

Whit

i was running phpnuke and have almost 30,000 members apache and sql both running at 99% usage, server crashed when 50 ppl online, Host wanted me off shared hosting as many customers complaining i was crashing a p4 3.2 with 2gig ram, i converted to cpg and now i have less than a 50% server load cpg saved me $300 USD a month offshore dedicated servers cost $$ thx guys
one decision i dont regreat is CPGNUKE

Korben
www.datastreamz.net
It's like this - I was working with Oldsmobiles when I was workin with HTML. Then I moved up to Mazda's and Audi's with PHP Nuke. But now my friends I am riding in style with Benz's and Porche's. The diffrence is that noticable immediatly. The Install is so simple once you get it and the site is so secure its like fort knox. Thank you - And you all can expect to see alot more of me around - suggesting ideas and helping where I can. Peace out all - and enjoy newbies. It's really worth it to use CPGNuke.
- Kid_Creation

One thing I've noticed about CPG-Nuke... it is fast and clean. Impressive. One of my 'customers' liked it so much she wanted everything changed to CPG-Nuke!
- valis
awebware.com

The conversion from phpNuke 7.4 to CPG-Nuke (CVS) was a piece of cake. The data conversion took about two hours. Hit a few snags--but nothing a few forum searches couldn't fix. Probably the best compliment I got from my users--"Did you change hosts?" The speed improvement over phpNuke is quite noticable. Kudos to the developement team! Thanks for helping me get away from the phpNuke tease.
- Whit
endofropegang.com

Thanks for the Great program! I never regret migrating from PhpNuke. My site is so much faster and more secure. Now I spend time managing my site instead of the site software. Keep up the good work!
- Rod
www.gentle.org

Now that we are running CPG Nuke this is the first time I've travelled without having to worry about hacking, monitoring the site daily, etc. Thanks for CPG Nuke and everyone that made it possible. We are running a consumer advocacy site at householdwatch.com and the site is very busy. CPG Nuke is doing the job and doing it well.
NukeFind

CPG is Fast, Secure & Free Since installing it's been much easier to work with as an admin. Better admin features but not as many modules that phpnuke offers. Built for speed and reliability. Admin of 3 prominent sites that combined receive 6 million hits annually. CPGnuke is hands down the best CMS out there.
- djdevon3

I just made the switch to CPG, from phpNuke.
The install was easy, simple when following well written instructions. My site has dramatically increased in speed, it really is a day and nite difference.
Thanks to everyone who is a part of the CPG-Nuke project and for offering this CMS as a great alternative to the other *Nukes.
I look forward to being a part of the community.
Kristin
"I made the switch!"

I managed to stumble onto this remake of phpnuke type CMS and have been VERY pleased ever since... I'm very glad it's the system I'm using to make a web site.
4est
Great sense of community around CPG Nuke! Thanks for your hard work Cheers!
roRisc
To the Dev team. You guys rock keep up the good work. Hopefully I'll get good enough at this quickly so that I'll be able to start posting some solutions and tips as well. Cup-A-Cino
I want to thank everyone who help me to build my cpgnuke, know the final layout look great, makes the user want to register.....thanks alot guys
TRANCEBUDHA
Hey thanks for the quick replies..hehe.. ya I am trying to check out cpg-nuke on the same server.. anyways.. www.sizzle.no-ip.com /ufo just a test site main php-nuke is www.sizzle.no-ip.com and forums www.sizzle.no-ip.com /forums It seems so far that cpg-nuke is quit a bit faster than php-nuke.. thanks again
sixpack
CPG-Nuke and its support community ROCKS!
James D Kirk
CPGNuke is making phpnuke look like hammered dog-crap so far...
Persistence
Just installed the latest version of CPG and I'm lovin' it!
square
love CPG!
Mecro
man i just took a look at the demo ADMIN and you guys truly did a remarkable job.. this blows PHPNuke away...
dirtbag
Thank You, cpgnuke. Thank You All that are behind that wonderful script.
Truden
Excellent Coppermine with safemod :) Work fine with safemod nice Job
Reha
Thank You, cpgnuke. I am amazed at what CPG Nuke has to offer...
JamesSelvage
Great site. Great software.
ShermD3
Well I got my first CPGNuke site up! (huzzah?) I must say of the 5 site I run, 4 of which are PHP-Nuke sites I'm most impressed
GeoffM
This install was SOOO smooth. Great job guys! I love it!
dcorwin
Hey CPG-Nuke Dev Team!! Wow!!!!...pretty much sums it up. I love cpgnuke and I've only had it a couple days now.
sabione
Great system you developed here. Thanks !
cwweb

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.3704 seconds with 19 DB Queries in 0.0368 seconds
Memory Usage: 3.38 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy