Setting up security
Here you will find some hints and tips on how to stop hackers from compromising your store.
Preventive Measures
Rename your admin folder
Lock down admin access
Use secure passwords
-
Turn off tell a friend
Install a captcha form on your contact us page
-
Make sure you have installed all of the security patches (these are not optional)
Check your local machine for Malware, Keyloggers, Trojans, etc.
If you are running an osCmax version below 2.0.4 - remove filemanager.php and define_language.php -
Patch
The Cure
1. Rename your admin folder
In order to prevent people from trying to hack your admin panel you should rename your admin folder and update your configure.php file.
define('DIR_WS_ADMIN', '/admin/');
define('DIR_FS_ADMIN', '/home/mystore.com/www/public/admin/');
If you have an SSL certificate then access your new admin directory
securely.
2. Lock down admin access
Give users secure user names
Ensure that users use secure passwords - letters, numbers, upper and lower case, symbols etc
-
Restricted IP access is often not possible due to dynamic IP address assignment. Only implement if you know that you have a fixed IP address or have some method of IP management
3. Use secure passwords
4. CHMOD your files to the correct settings
The most common cause of hacks is code inserted into unprotected files and folders.
Folders should be CHMOD to a maximum of 755.
Files should be CHMOD to a maximum of 644.
Both configure files should be a maximum of 444.
However, if you are using suPHP on your server (ask your host if you are not sure or run this suPHP check) then …
Install Check Permissions
If you are a slightly more advanced user you can use a tip from Michael_S for setting this directly on the server.
These commands can be run from the linux command line or from an executable file via cronjob.
Here is the command run to set all directories:
find . -type d -exec chmod 755 {} ;
Here is the command run to set all php files:
find . -type f -name “*.php” | xargs chmod 644
5. Turn off tell a friend
This infobox allows unscrupulous users to use your server to send emails out to people.
6. Install a captcha form on your contact us page
7. Monitor unauthorised file changes
In order to do this you will need to install SiteMonitor.
8. Make sure you have installed all of the security patches
Make sure that you installed all of the security updates for osCMax. You can get updates about osCMax from Michael_S's blog
9. Check your local machine for Malware, Keyloggers, Trojans, etc.
10. Remove filemanger and define_language
The following files must be removed from your site's administrative panel folder:
/admin/file_manager.php
/admin/define_language.php
Removing these files will close a security vulnerability.
What to do if you are hacked?
Okay the worst has happened … Here is what you need to do: (Source: Michael_S, osCmax forums)
Do a complete scan on all your work computers (machines that you access your site from). Make sure you have no malware, trojans, viruses, etc. Once you have certified your machines are clean go to step 2.
Change all your passwords. This includes ALL passwords related to your site.
FTP (all ftp accounts), Control Panel, osCMax admin panel (all admin accounts), mysql database password, email account passwords.
If you have a clean backup, completely wipe your files (all directories and files). Then restore your clean backup. This will guarantee no backdoor files left hidden somewhere in your file tree.
Double check all of the admin settings including email addresses, payment details, store name, copy emails to etc.
Lock down permissions. This means absolutely no directories or files with 777 permissions at a bare minimum. You should remove write permissions from all directories and files that do not need it.
Change behavior - stop using clear text email and ftp. Only use encrypted email (pop3/smtp logins and data transmission) and encrypted ftp (FTPS, FTPES or SFTP).
The Eval base64 hack
Check this if you want to pay with different payment method
Another hack which inserts an iframe and tries to send customers credit card details to a third party tracker … once card details are sent then it pushes client through to official payment gateway so store owner will be unaware.
You will find additional code inserted in templates/fallback/checkout_payment.tpl.php file which is generating the iframe inside a base64 string. Remove this code immediately.