Nov 23, 2008 | 12:11 PM  
Welcome

Don't have an account yet? You can create one, it is free, just click here

as a registered user you have some advantages like free downloads, comments and posting on our forums, depending upon this site's configuration and options.

 • •  Control Panel - Register - Login  • • 
Current Stable MDPro Lite 1.0821 Download
  Forum FAQForum FAQ   SearchSearch  UsergroupsUsergroups  PreferencesPreferences  Options forumOptions forum  Watched TopicsWatched Topics  Watched ForumsWatched Forums
Latest forum posts Latest forum posts  Log in to check your private messages Log in to check your private messages    Log inLog in 
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
Member
Post  Posted: Sep 07, 2008 - 10:46 AM Reply with quote Back to top
Post subject: Security issues

I have about 30 domains running various releases of MDPro and recently those domains were hacked. I deleted all of them and during the restore process they were hit again. Rebuilding 30 domains is a major pain.

First and foremost having any directory with permissions set to 777 is dangerous. Hackers can use the C99 shell to gain access the destroy the sites.

I was talking with a tech manager with my hosting company and he made a suggestion that I will pass along for discussion. Moodle does not keep writeable directories (777) inside the domain but for security reasons in the root instead

Here is an example for the tech's suggestion

Currently the MDPro domains are set up like this:

/hsphere/local/home/domain.com/cache/_arcompile
/hsphere/local/home/domain.com/upload/tmp


He has suggested the following. Create a directory called "files/" in the root folder, then create another directory with the domain name and then sub-dirs so that the 777 directories are not located within the domain folders but outside in "files/". Moodle does this for the 777 directories and writable files

/hsphere/local/home/domain.com
/hsphere/local/home/files/domain.com/cache/_arcompile

CHMOD 755 755 777 777

/hsphere/local/home/files/domain.com/upload/tmp
CHMOD 755 755 777 777

etc

Do the same for all 777 directories used by the php code

What do you think of his suggestion? Will this work to make MDpro more secure?
With 1.083 in the early stages it might be worth implementing.

David
View user's profile Visit poster's website MSN Messenger
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
bannato
Post  Posted: Sep 07, 2008 - 12:02 PM Reply with quote Back to top

Forgot this bit in first post. It is the message from the admin I spoke with

Quote:
The security of the website I would recommend any folder that needs 777 permissions to be moved to a folder outside of the domain root. This way it can still have the permissions without being web associable without a script. I would also use the /tmp folder when you are needing to write session data or temp files. It is accessible by everyone but file within can only be accessed if you know the file directly.


the /tmp directory he refers to is the unix /tmp, like /usr/local/tmp
not one created within the MDPro directory

David
View user's profile Visit poster's website MSN Messenger
TiMax
Project Manager
Project Manager


Joined: July 31, 2003
Posts: 1560
Location: Quebec - Canada

Post  Posted: Sep 07, 2008 - 03:25 PM Reply with quote Back to top

First of all, you use php 4.3 this is a very old php version, unsupported and with several bugs, so please update.

then, you don't tell us witch mdpro version you use.

then where is the logs, what the hackers have done to crack your site

please come back with more info's

_________________
TiMaxMAX s.o.s.Fantasia e dinamicità Italiane, qualità e servizi Canadesi Web Services, hosting ed housing professionali
View user's profile Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
bannato
Post  Posted: Sep 07, 2008 - 03:50 PM Reply with quote Back to top

Currently in the process of moving all of the domains to updated PhP, MySQL, Apache, etc

As I have been using MDPro since the beginning the sites have not been updated, mostly due to loss of many modules if I do update them. A guess would be a range from 1.07 to 1.082

This afternoon I managed to notice one of the sites was hacked while I was talking to a tech manager. I am now analysing 3000 lines of log files with httpd access

What we were lucky enough to catch was the hacker's IP. I will have this dealt with by some law enforcement contacts in his country.

I will post the hackers access from the logs when I locate it.

TiMax wrote:
First of all, you use php 4.3 this is a very old php version, unsupported and with several bugs, so please update.

then, you don't tell us witch mdpro version you use.

then where is the logs, what the hackers have done to crack your site

please come back with more info's
View user's profile Visit poster's website MSN Messenger
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
bannato
Post  Posted: Sep 07, 2008 - 03:56 PM Reply with quote Back to top
Post subject: htaccess file

A starting point to possibly make security better for all of us.

from: http://forum.mamboserver.com/showthread.php?t=83000

register_globals should be OFF not set to register_globals On
added in this format
php_flag register_globals OFF


Something like the following should be added to all php files in the modules:

** ensure this file is being included by a parent file and stop direct linking */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

.htaccess

########## Begin - Rewrite rules to block out some common exploits
# Register Globals
php_flag register_globals OFF
#
# Block out any script trying to set a Config value through the URL
RewriteCond %{QUERY_STRING} config_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<3C>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
View user's profile Visit poster's website MSN Messenger
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
bannato
Post  Posted: Sep 08, 2008 - 10:22 AM Reply with quote Back to top

I notice that some of the SQL Injection attach strings target pn_uid 2

I believe this issue was fixed in the Topics update. At some time in the future another module could have the same attack vulnerability.

Suggestion for release 1.083 or even a 1.821 update.

Could the pn_uid be selectable during the install process when the Admin Login and Password is set? It could either be a randonly generated number or user selected within a range and should not effect the site's operation.

David
View user's profile Visit poster's website MSN Messenger
Skin
MD Staff
MD Staff


Joined: July 31, 2003
Posts: 410
Location: Italy

Post  Posted: Sep 09, 2008 - 11:31 AM Reply with quote Back to top

Are you talking about MD1076 or older? Because this bug (I mean Topics id Remote SQL Injection Vulnerability) has been fixed about a year ago.

_________________
PointNet: Web and Design
View user's profile Visit poster's website
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
bannato
Post  Posted: Sep 09, 2008 - 12:26 PM Reply with quote Back to top

I realize it was fixed last year but was thinking of a module, possibly ported from Post-Nuke or other CMS that may be vulnerable to a user ID attack. Smile

On one of the sites (release 1.76) I have just found over 260,000 user accounts injected in a pn_commerce_users table.

Don't think this vulnerablity has been reported before. No results on a Google. All the accounts were numeric with an IP affixed to the end. The MySQL tables were 46 Megs.
Code:
(267605, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1220753516', '122075351566.249.67.147', 0, '', '', '', '', '', '', '', '', '', 0),
(267606, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1220753657', '122075365066.249.67.147', 0, '', '', '', '', '', '', '', '', '', 0);

That's one way to slow a site down. Smile
David
View user's profile Visit poster's website MSN Messenger
Skin
MD Staff
MD Staff


Joined: July 31, 2003
Posts: 410
Location: Italy

Post  Posted: Sep 14, 2008 - 02:21 AM Reply with quote Back to top

What version of pncommerce?
There is an italian user that is working of a new version of PNCommerce for MDPo 108x, may be he can investigate on this bug.

_________________
PointNet: Web and Design
View user's profile Visit poster's website
dpottier
MD user level 5
MD user level 5


Joined: July 17, 2004
Posts: 254
Location: Victoria, British Columbia
bannato
Post  Posted: Sep 14, 2008 - 10:31 AM Reply with quote Back to top

Skin wrote:
What version of pncommerce?

I tested the original pnCommerce from the very early days in development. I might even have a set of the icons I designed for it. This was one of the earlier releases before it changed hands, then got dropped, etc.

The pnVersion shows "0.81a". When the module went to the German company I stopped testing.

I don't think this security hole has been found before, nor do I know what string was launched by the hackers. But I do think this is a serious issue for an eCommerce module.

David
View user's profile Visit poster's website MSN Messenger
Display posts from previous:     
Jump to:  
All times are GMT + 13 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by MDForum 2.0.8© 2003-2007 MAXdev Team
Credits