search
HomeCMS TutorialDEDECMSHow to prevent Dedecms from invading

How to prevent Dedecms from invading

怎么防止Dedecms入侵?

一、最基本的安全设置:修改dedecms默认后台目录/dede/和修改管理员帐号密码;

二、如网站不需要使用会员系统,建议删除/member/文件夹;

三、将/data/文件夹移到Web访问目录外,这条是dedecms官方建议,具体操作方法如下:

1. 将/data/文件夹移至web根目录的上一级目录

2. 修改/include/common.inc.php中DEDEDATA变量,将:define('DEDEDATA', DEDEROOT.'/data'); 改为define('DEDEDATA', DEDEROOT.'/../data');

3. 修改/index.php,删除如下代码(注:如首页生成静态且index.html索引优先于index.php可忽略此条修改。):

代码如下:

if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
{
header('Location:install/index.php');
exit();
}

4. 配置tplcache缓存文件目录:登陆后台 > 系统 > 系统基本参数 > 性能选项,将模板缓存目录值改为 /../data/tplcache

四、/plus/是dedecms漏洞高发目录,隐藏/plus/路径可防范该目录下文件产生的未知漏洞的利用,如需使用该目录下某个文件,可在.htaccess中添加相关规则实现白名单功能。

示例:假设plus目录名修改为/abcd9com/,网站需要使用后台栏目动态预览(路径:http://域名/plus/list.php?tid=栏目编号)和发布跳转文章(路径:http://域名/plus/view.php?aid=文章编号)的功能,则可在.htaccess添加如下代码:

代码如下:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^tid=(\d+)
RewriteRule ^plus/list.php$ /abcd9com/list.php$1 [L]
RewriteCond %{QUERY_STRING} ^aid=(\d+)
RewriteRule ^plus/view.php$ /abcd9com/view.php$1 [L]

推荐学习:织梦cms

The above is the detailed content of How to prevent Dedecms from invading. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools