您现在的位置是:首页 > cms教程 > phpcms教程phpcms教程
PHPCMSv9安全设置防挂码教程
孙奎汝2025-05-21 12:03:41phpcms教程已有5人查阅
导读一、目录权限设置很重要:可以有效防范黑客上传木马文件.如果通过 chmod 644 * -R 的话,php文件就没有权限访问了。如果通过chmod 755 * -R 的话,php文件的权限就高了。
一、目录权限设置很重要:可以有效防范黑客上传木马文件.
如果通过 chmod 644 * -R 的话,php文件就没有权限访问了。
如果通过chmod 755 * -R 的话,php文件的权限就高了。
所以就需要分开设置目录权限和文件权限:
linux 服务器权限:经常要用到的命令: 设置完成后,再通过命令:chown root:root * -R 将目录和文件的所有者改为root。
这样就更加安全了。
FTP用户,确定使用的是linux主机。windows需要登录到服务器中设置。
进入到phpcms 安装根目录,选取所有文件:
设置数字值为:755,同时选定:选择递归处理子目录,只应用到目录
同样再选择所有文件,数字值为:644,选择递归处理子目录,只应用到文件
如果设置错了,重新再设置就可以了。
二、Linux find命令 查找可疑的木马文件
查找:30天内被修改的文件 找到目录下所有的txt文件 找到目录下所有的txt文件并删除 找到目录下所有的php文件 并且在30天之类被修改的文件 找到目录下所有的php文件,同时,满足 30天以内,1天之前的 三、通过apache配置限定:
1、apache 下 禁止目录执行php
通过目录下面放置 .htaccess文件来限制权限。
该方 将php文件当做附件并下载。同时,可以通过浏览器访问到文件。
php_flag engine off
使用场景:在下面目录放置
\uploadfile\
\statics\
\html\
\phpsso_server\uploadfile\
\phpsso_server\statics\
2、禁止通过浏览器访问所有文件
通过目录下面放置 .htaccess文件来限制权限。 使用场景:
\caches\
\phpsso_server\caches\
3、禁止php跨目录浏览权限配置:
虚拟主机配置样例: 4、按天存放apache日志:
参考上面配置文件:
如果通过 chmod 644 * -R 的话,php文件就没有权限访问了。
如果通过chmod 755 * -R 的话,php文件的权限就高了。
所以就需要分开设置目录权限和文件权限:
linux 服务器权限:经常要用到的命令: 设置完成后,再通过命令:chown root:root * -R 将目录和文件的所有者改为root。
这样就更加安全了。
FTP用户,确定使用的是linux主机。windows需要登录到服务器中设置。
进入到phpcms 安装根目录,选取所有文件:
设置数字值为:755,同时选定:选择递归处理子目录,只应用到目录
同样再选择所有文件,数字值为:644,选择递归处理子目录,只应用到文件
如果设置错了,重新再设置就可以了。
二、Linux find命令 查找可疑的木马文件
查找:30天内被修改的文件 找到目录下所有的txt文件 找到目录下所有的txt文件并删除 找到目录下所有的php文件 并且在30天之类被修改的文件 找到目录下所有的php文件,同时,满足 30天以内,1天之前的 三、通过apache配置限定:
1、apache 下 禁止目录执行php
通过目录下面放置 .htaccess文件来限制权限。
该方 将php文件当做附件并下载。同时,可以通过浏览器访问到文件。
php_flag engine off
使用场景:在下面目录放置
\uploadfile\
\statics\
\html\
\phpsso_server\uploadfile\
\phpsso_server\statics\
2、禁止通过浏览器访问所有文件
通过目录下面放置 .htaccess文件来限制权限。 使用场景:
\caches\
\phpsso_server\caches\
3、禁止php跨目录浏览权限配置:
虚拟主机配置样例: 4、按天存放apache日志:
参考上面配置文件:
本文标签:
很赞哦! (1)
上一篇:PHPCMS本地文件包含漏洞
暂无内容 |
暂无内容 |
相关文章
暂无内容 |
暂无内容 |
随机图文
phpcms完美实现导航栏当前栏目高亮的方法
我们在用phpcms做网站的时候,经常碰到导航栏高亮功能,或者侧栏高亮,这个会涉及到几个问题:1.栏目列表页子栏目高亮判断,如果当前页面为子栏目,他的顶级栏目如果在导航栏也要高亮。PHPCMS怎么采集文章内容
首先进入【内容发布管理】下的【采集管理】,并点击【添加节点】;然后填写【内容规则】中的信息,需要根据页面的结构进行填写;最后点击【提交】,并找到新添加的采集节点进行【内容采集】即可。phpcms的SEO标题设置方法
phpcms v9网站首页的标题可以控制,但是栏目页,内容页的标题非常的长,用户体验不好修改模板文件header html的< title>改成</span></a></li> <li><a href="https://www.ebingou.cn/dmh/15184.html" target="_blank"><i><img src="/skin/ebingou/images/titlepic/43.jpg"></i> <p>phpcms上传图片的方法</p> <span>phpcms怎么上传图片1、首先在模板页,引用 js与css,两个文即可搞定。2、然后调用上传图片功能</span></a></li> </ul> </div> <div id="comments" class="comments"> <div id="comment_post" class="compost"> <div class="cp_post"> <link href="https://www.ebingou.cn/skin/ecmspl/css/pl.css" rel="stylesheet"> <div class="showpage" id="plpost"> <table style="line-height: 25px; padding: 5px 3px 1px 8px; font-size: 18px;" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr><td><strong><font color="#333333">留言与评论 (共有 <span id="infocommentnumarea"><script type="text/javascript" src="https://www.ebingou.cn/e/public/ViewClick/?classid=28&id=15530&down=2"></script></span> 条评论)</font></strong></td></tr> </tbody></table> <script> function CheckPl(obj) { if(obj.saytext.value=="") { alert("您没什么话要说吗?"); obj.saytext.focus(); return false; } return true; } </script> <form action="https://www.ebingou.cn/e/pl/doaction.php" method="post" name="saypl" id="saypl" onSubmit="return CheckPl(document.saypl)"> <table id="plpost" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td> <table width="100%" cellspacing="10" cellpadding="0" border="0"> <tbody><tr> <td> <script src="https://www.ebingou.cn/e/pl/test.php"></script> <textarea name="saytext" rows="6" id="saytext" placeholder="请遵守互联网相关规定,不要发布广告和违法内容!"></textarea> <script src="https://www.ebingou.cn/skin/ecmspl/js/plface.js"></script> <table width="100%" cellspacing="1" cellpadding="3" bgcolor="#FFF" align="left"> <tbody><tr> <td width="80%" height="40" bgcolor="#FFFFFF">验证码:<input name="key" type="text" class="inputText" size="16"> <img src="https://www.ebingou.cn/e/ShowKey/?v=pl" align="absmiddle" name="plKeyImg" id="plKeyImg" onClick="plKeyImg.src='https://www.ebingou.cn/e/ShowKey/?v=pl&t='+Math.random()" title="看不清楚,点击刷新" /> </td> <td width="20%" height="40" bgcolor="#FFFFFF"> <input name="sumbit" type="submit" value="提交评论" tabindex="6" style="border-radius: 5px;font-size: 16px;background: #e94c3d none repeat scroll 0% 0%;border: 0px none;margin: 0px 16px;padding: 1px 16px;height: 33px;line-height: 30px;color: rgb(255, 255, 255);opacity: 0.95;"> <input name="id" type="hidden" id="id" value="15530" /> <input name="classid" type="hidden" id="classid" value="28" /> <input name="enews" type="hidden" id="enews" value="AddPl" /> <input name="repid" type="hidden" id="repid" value="0" /> <input type="hidden" name="ecmsfrom" value="https://www.ebingou.cn/dmh/15530.html"> </td> </tr> </tbody></table> </td> </tr> </tbody></table> </td> </tr> </tbody></table></form> <script src=https://www.ebingou.cn/e/pl/more?classid=28&id=15530&num=10></script> </div> </div> </div> </div> </div> <!--lbox end--> <div class="rbox"> <div class="whitebg paihang"> <h2 class="htitle">大家在看</h2> <section class="topnews imgscale"><a href="https://www.ebingou.cn/dmh/15882.html"><img src="/skin/ebingou/images/titlepic/48.jpg"><span>Phpcms二次开发框架目录介绍</span></a></section> <ul> <li><i></i><a href="https://www.ebingou.cn/dmh/15882.html" title="Phpcms二次开发框架目录介绍" target="_blank">Phpcms二次开发框架目录介绍</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15883.html" title="phpcmsV9数据模型基类解析" target="_blank">phpcmsV9数据模型基类解析</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15879.html" title="phpcmsv9自定义分页带下拉跳转的实现方法" target="_blank">phpcmsv9自定义分页带下拉跳转的实现方法</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15884.html" title="phpcms根目录结构" target="_blank">phpcms根目录结构</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15881.html" title="PHPCMSv9安全防范设置方法" target="_blank">PHPCMSv9安全防范设置方法</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15887.html" title="PHPCMS加载完公共函数库源码分析" target="_blank">PHPCMS加载完公共函数库源码分析</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15885.html" title="phpcms企业站常用标签和调用" target="_blank">phpcms企业站常用标签和调用</a></li> <li><i></i><a href="https://www.ebingou.cn/dmh/15880.html" title="PHPCMS碎片管理" target="_blank">PHPCMS碎片管理</a></li> </ul> </div> <!--右侧广告位一--> <div class="ad whitebg imgscale"> <ul> <script src='/d/js/acmsd/thea3.js'></script> </ul> </div> <!--/右侧广告位一--> <div class="whitebg tuijian"> <h2 class="htitle">本栏推荐</h2> <ul> </div> <!--右侧广告位二--> <div class="ad whitebg imgscale"> <ul> <script src='/d/js/acmsd/thea4.js'></script> </ul> </div> <!--/右侧广告位二--> <div class="whitebg cloud"> <h2 class="htitle">相关标签</h2> <ul> </ul> </div> <div class="whitebg wenzi"> <h2 class="htitle">大家喜欢</h2> <ul> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15090.html">phpcmsv9登录失败的原因和解决办法</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15660.html">phpcms完美实现导航栏当前栏目高亮的方法</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15631.html">phpcms万能字段的使用方法教程</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/14953.html">phpcms模板制作方法</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15176.html">phpcms安装失败报错的解决方法</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15611.html">Phpcmsv9怎么开发留言板</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15048.html">phpcms批量移动使用方法</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15164.html">phpcms备份数据的方法</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15517.html">phpcms评论页面修改方法示例</a></li> <li><a target="_blank" href="https://www.ebingou.cn/dmh/15529.html">PHPCMS本地文件包含漏洞</a></li> </ul> </div> <!--右侧广告位三--> <div class="ad whitebg imgscale"> <ul> <script src='/d/js/acmsd/thea5.js'></script> </ul> </div> <!--/右侧广告位三--> <!--<div class="whitebg tongji"> <h2 class="htitle">关注我们</h2> <ul> <li><b>微信公众号</b>:扫描二维码,关注我们</li> <li class="tongji_gzh"><img src='https://www.ebingou.cn/skin/ebingou/images/wxgzh.png'></li> </ul> </div>--> </div> </article> <footer> <div class="box"> <div class="wxbox"> <ul> <li><img src="https://www.ebingou.cn/skin/ebingou/images/wxgzh.png"><span>微信公众号</span></li> <li><img src="https://www.ebingou.cn/skin/ebingou/images/wx.png"><span>我的微信</span></li> </ul> </div> <div class="endnav"> <p><b>站点声明:</b></p> <p>1、本站属个人博客,网站中涉及的专业知识仅仅属于个人见解,用户自行甄别可行性,本站不负任何责任。</p> <p>2、所有文章未经授权禁止转载、摘编、复制或建立镜像,如有违反,追究法律责任。廉正举报站内留言</p> <p>Copyright © <a rel="nofollow" href="http://www.ebingou.cn/" target="_blank">www.ebingou.cn</a> All Rights Reserved|<a rel="nofollow" href="https://beian.miit.gov.cn/" target="_blank">皖ICP备2022014118号-1</a></p> </div> </div> <a rel="nofollow" href="#"> <div class="top"></div> </a> </footer> <script type="text/javascript" src="https://www.ebingou.cn/skin/ebingou/js/theia-sticky-sidebar.js"></script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('.rbox').theiaStickySidebar({ // Settings additionalMarginTop: 30 }); }); </script> </body> </html>