phpcms安全如何做,phpcms漏洞修复探讨
最好的解决办法是隔离动态,对外只展示静态,这样是很安全的网站了,
当然你可以限制下模块访问~前端只需要访问content和seach模块~
限制模块访问 加在index.php里就可以了
同时可以把不用的模板删除。。比如会员,没有会员的站就直接删了会员模块
如果用的是一些知名的csm,尽量排除cms的特征。让人不知道是什么系统。
分享一份比较安全的phpcms伪静态 规则
RewriteEngine on
RewriteRule ^((?!statics)[A-Za-z][A-Za-z_0-9])(/|$)$ index.php?m=content&c=index&a=init&dirname=$1
RewriteRule ^([0-9]+) index.php?m=content&c=index&a=init&siteid=$1
RewriteRule ^([A-Za-z][A-Za-z_0-9])/content-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([A-Za-z][A-Za-z_0-9])/show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([A-Za-z][A-Za-z_0-9])/list-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=lists&dirname=$1&catid=$2&page=$3
RewriteRule ^([A-Za-z][A-Za-z_0-9])/search-([0-9]+).html index.php?m=search&siteid=$2
RewriteRule ^([A-Za-z][A-Za-z_0-9])/search-([0-9]+)-([0-9]+)-(.*?)-([0-9]+).html index.php?m=search&typeid=$3&siteid=$2&q=$4&page=$5 [QSA,NU,PT,L]
RewriteRule ^([0-9]+)/content-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([0-9]+)/show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([0-9]+)/list-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=lists&dirname=$1&catid=$2&page=$3
RewriteRule ^([0-9]+)/search-([0-9]+).html index.php?m=search&siteid=$2
RewriteRule ^([0-9]+)/search-([0-9]+)-([0-9]+)-(.*?)-([0-9]+).html index.php?m=search&typeid=$3&siteid=$2&q=$4&page=$5 [QSA,NU,PT,L]
RewriteRule ^content-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^list-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=lists&catid=$1&page=$2
RewriteRule ^search-([0-9]+).html index.php?m=search&siteid=$1
RewriteRule ^search-([0-9]+)-([0-9]+)-(.*?)-([0-9]+).html index.php?m=search&typeid=$2&siteid=$1&q=$3&page=$4 [QSA,NU,PT,L]
RewriteRule ^([A-Za-z][A-Za-z_0-9])/content/([0-9]+)-([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([A-Za-z][A-Za-z_0-9])/show/([0-9]+)/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([A-Za-z][A-Za-z_0-9])/list/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=lists&dirname=$1&catid=$2&page=$3
RewriteRule ^([A-Za-z][A-Za-z_0-9])/search/([0-9]+).html index.php?m=search&siteid=$2
RewriteRule ^([A-Za-z][A-Za-z_0-9])/search/([0-9]+)/([0-9]+)/(.*?)-([0-9]+).html index.php?m=search&typeid=$3&siteid=$2&q=$4&page=$5 [QSA,NU,PT,L]
RewriteRule ^([0-9]+)/content/([0-9]+)/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([0-9]+)/show/([0-9]+)/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=show&dirname=$1&catid=$2&id=$3&page=$4
RewriteRule ^([0-9]+)/list/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=lists&dirname=$1&catid=$2&page=$3
RewriteRule ^([0-9]+)/search/([0-9]+).html index.php?m=search&siteid=$2
RewriteRule ^([0-9]+)/search/([0-9]+)/([0-9]+)/(.*?)/([0-9]+).html index.php?m=search&typeid=$3&siteid=$2&q=$4&page=$5 [QSA,NU,PT,L]
RewriteRule ^content/([0-9]+)/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^show/([0-9]+)/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^list/([0-9]+)/([0-9]+).html index.php?m=content&c=index&a=lists&catid=$1&page=$2
RewriteRule ^search/([0-9]+).html index.php?m=search&siteid=$1
RewriteRule ^search/([0-9]+)/([0-9]+)/(.*?)/([0-9]+).html index.php?m=search&typeid=$2&siteid=$1&q=$3&page=$4 [QSA,NU,PT,L]
#隐藏index.php
RewriteRule ^(.*)$ index.php?$1 [QSA,PT,L]
这样适应多环境。毕竟找隐藏index.php的规则容易找。
西安网站建设|西安网站制作|西安网页设计|西安APP开发|西安小程序开发|建站公司
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/262958.html