Zen Cart中文版网站安全

Zen Cart™软件使用的是GNU通用公共许可协议,您可以免费使用、修改 Zen Cart™ 软件。

虽然该软件是免费的,但是欢迎您每次下载新版本前捐款,以帮助我们继续软件开发、升级,和维护免费论坛。

捐款网址: Zen Cart™ 团队

感谢您的支持
Zen Cart China



Zen Cart™ 源自: Copyright 2003 osCommerce
该软件希望提供有用的功能,但[不做保证],也不保证[适用于特定用途]
该软件受限于GNU通用公共许可协议


O S I Certified
该软件通过OSI开源软件认证。
OSI Certified是开源动力的认证标志。


ZEN CART中文版安全建店的方法

下面是强化Zen Cart网店安全的几个步骤:

1. 安装后从服务器上删除多余的目录

删除以下目录 (以及目录中的所有文件), 以降低安全风险:

可选: 另外,*如果* 您不打算使用下载类或音乐相关产品,*也可以* 删除这些目录:

(需要在管理页面->商店设置->属性设置->启用下载,设置为 False 来关闭没有下载目录的提示信息)

2. 修改 "/admin" 目录名

修改 "admin" 目录名,用一个很难猜测到的名字。

(在进行下面的修改前,请备份文件和数据库。)

A- 通过FTP软件或者主机商的文件管理工具找到 Zen Cart /admin/ 目录。
修改目录名。

B - 使用上面的新目录名来访问管理页面。例如,原来是 http://www.example.com/admin/ 现在改为 http://www.example.com/NeW_NamE4u/

3. 使用 SMTPAUTH 或 SMTP 作为邮件发送方式,而不是普通的 "PHP" 设置。

进入管理页面->商店设置->电子邮件选项,修改邮件发送方式为 SMTPAUTH,然后输入屏幕下面所有的 SMTP 相关参数。

这不仅有助于防止邮件进入垃圾箱,同时避免从管理页面发送邮件时泄漏管理目录名。

4. 设置configure.php文件为只读

将两个 configure.php 文件设置为只读很重要。
通常就是设置为"644",有时是"444"。

配置文件 configure.php 位于:
/<商店目录>/includes/configure.php
/<商店目录>/renamed_admin/includes/configure.php

有时通过FTP设置文件为只读不起作用。尽管看起来已经设置为只读了,实际上没有。通过查看商店首页的顶部是否有警告信息来确定设置是否生效。如果还是显示警告信息,请通过主机商提供的"文件管理"功能来修改。

如果您用的是Windows服务器,只要将文件设置 只读所有人,如果在IIS下,是IUSR_xxxxx用户,在Apache下,是apache user帐号。

5. 删除不用的管理员帐号

管理页面->工具->管理设置
在管理页面下,打开工具菜单,选择管理设置
- 检查所有没有使用的管理员帐号并删除。特别注意是否有"Demo"帐号。

6. 管理员密码安全

一定要使用一定强度、不易猜测的密码。

要修改管理员密码,进入管理页面->工具->管理设置,点击"重置密码"按钮。

建议使用至少8位密码。
密码最好包含字母、数字、符号、以及大小写等。
如果使用常见词语,最好使用两个通常不一起使用的词。

7. 保护管理页面

在管理页面工作时需要注意:

8. 保护"自定义页面" "html_includes"中的内容

修改自定义页面后,(管理页面->工具->页面编辑), 需要保护这些文件:

A. 用 FTP 软件下载备份,这些文件位于/includes/languages/schinese/html_includes目录。

B. 修改文件 CHMOD 644 或 444 (例如: “只读”)。见上面的 CHMOD 说明
/includes/languages/schinese/html_includes – 下面的所有文件/目录
(提示: 在"某些"主机,需要设置 645 或者 555 才能显示内容)

如果设置为只读,那么潜在的黑客即使能访问您的系统也不能修改这些文件。除非他们有修改只读的权限,而这更难做到。

9. 使用 .htaccess 文件来强化安全

在几个目录中有 .htaccess 文件,用于防止用户浏览目录,还可以防止直接访问"any" .PHP 脚本,这些目录中的所有 PHP 文件是通过其它 PHP 文件访问,而不是直接通过浏览器。这有利于安全。
如果删除这些文件,会增加被窥视系统的风险。

某些目录下还有一些半"空白" index.html 文件,这些文件用于保护目录,万一FTP软件不能上传.htaccess文件,或您的服务器不接受,可以防止目录浏览,但不会停止执行.PHP文件。这也是"可行"的方法,当然在服务器支持的情况下,在所有目录下使用 .htaccess 文件更好。

要使用 Zen Cart® 自带的 .htaccess 设置,主机需要包含 'All' 或所有的: 'Limit Options Indexes' 参数到服务器上的 apache/conf/httpd.conf 文件的 AllowOverride 配置中。
某些主机不让你使用 OPTIONS 参数,所以需要去掉这行,或者在它前面加上 # 。

如果主机配置不允许使用 .htaccess 文件,有时在主机的管理面板中会提供一个界面,用于设定 .htaccess 的参数。

10. 保护 "images" 及其它目录

During initial installation, you are advised to set your images folder to read/write, so that you can use the Admin interface to upload product/category images without having to use FTP for each one. Similar recommendations are made to other files for various reasons.

However, leaving the images (or any other) folder in read/write mode means that hackers might be able to put malicious files in this (or other) folder(s) and thus create access points from which to attempt nasty exploits.

Thus, once your site is built and your images have been created/loaded, you should drop the security down from read/write to read. ie: change from CHMOD 777 down to 644 for files, and to 755 for folders.

文件/目录权限设置

在 Linux/Unix 主机上,常用的权限安全建议设置为:

在 Windows 主机上,通常设置文件为只读就可以了。需要检查 Internet Guest Account 帐号被限制为(只读)。

目录功能

The folders for which installation suggests read-write access for setup are these. If your site supports .htaccess protection, then you should use it for these folders. (The .htaccess files included with v1.3.9 and newer should already cover the basics.)

11. 从浏览器头删除网址

To stop the browser from printing a URL (which discloses your Admin foldername) on the invoice or any other document on the web, follow these steps:

针对 Internet Explorer:
o 点击 File 然后 Page Setup
o At page setup, remove this two character combination: "&u" from the header or footer text box.

针对 Firefox:
o 点击 File 然后 Page Setup
o
On page setup window click on the tab "Margins & Header/Footer". In the "Header & Footer" section set all of the drop downs to --blank--. (Or at least remove all references to "Title" and "URL".)

12. 需要经常检查的项目

  1. Be sure you've done all the steps listed in this document
  2. Keep good backups of your website files and database (frequently)
    • Backup the database over a secure connection (ie: if you're using phpMyAdmin to backup, then make sure you're using HTTPS addresses in your URLs).
    • Backup the website files over a secure connection (If you're copying files via FTP, be sure to use SECURE-FTP FTP over SSL/TLS). A good tool that supports Secure FTP (SFTP) is WinSCP, provided you configure your connection in it accordingly.)
    • Store the backed up database and website files into an encrypted file. (You should NOT keep your backups on your server. But if you do, encrypt them securely. See your hosting company for advice.)
  3. Check your server's errorlog regularly for odd or suspicious activity (Your hosting control panel should give you access to the Apache error_log)
    • look for any links that went to a page that isn't in your site
    • look for links that have http after the index.php
  4. Check your website files regularly to be sure nothing's been added or altered
  5. Ask your webhost what they have done to be sure the server you're on is safe and secure so that outsiders cannot do any harm, and so that other websites on your server cannot be used to get to your site and cause any harm (in case they have security holes in them)
  6. If your business warrants, or you still want additional assurance (esp if running forum software on your site, or other scripts outside of Zen Cart®), hire a security consultant to check your site regularly and give you peace of mind in exchange for a few dollars
  7. Check your Zen Cart /cache/ folder for leftover files that don't belong there.
  8. Check your Zen Cart /logs/ folder for myDebug-XXXXX.log files to see whether any errors are happening which need to be fixed. Delete the log files after you've addressed the errors.

版权所有 2004 - 2015 Zen Cart 中文版 www.zen-cart.cn