设为首页
加入收藏
帮助中心
首页 | 红盾通告 | 信息中心 | ASP技术 | 数据库 | 网页设计 | 网管专栏 | OICQ攻略 | 墨客频道 | 网站运营 |
当前位置:首页 >> ASP技术 >> 安全加密 >> 正文
最新信息
·ASP防止同时登陆的问题
·ASP隐藏下载地址及防盗代码
·ASP,PHP,.NET伪造HTTP-REF…
·网站常用的屏蔽字符
·防止从外部提交数据的方法
·SHA256 加密的ASP实现
·网页脚本攻击防范全攻略
·识别常见Web应用安全漏洞 …
·include文件的利弊及其安全…
·改mdb为asp所带来的灾难
资料搜索
热点信息
·过滤特殊字符和处理数字
·网站常用的屏蔽字符
·ASP,PHP,.NET伪造HTTP-REF…
·改mdb为asp所带来的灾难
·堵住ASP漏洞
·杜绝入侵:八大法则防范AS…
·防止从外部提交数据的方法
·编写通用的asp防注入程序
·怎样给文件加密最安全(一种…
·ASP漏洞分析和解决方法(2)
推荐信息
·网页脚本攻击防范全攻略
·用MS script encode加密asp
·堵住ASP漏洞
·禁止站外提交表单
·彻底防止ACCESS数据库文件…
·Microsoft 脚本编码器Scri…
·Microsoft 脚本编码器Scri…
·Microsoft 脚本编码器Scri…
·Microsoft 脚本编码器Scri…
·两款比较典型的ASP 木马的…


Google
 
防止从外部提交数据的方法
〖编辑:Cloudy | 浏览:人次〗

第一种做法,屏蔽特殊字符和关键字

fqys=request.servervariables("query_string")

dim nothis(18)

nothis(0)="net user"

nothis(1)="xp_cmdshell"

nothis(2)="/add"

nothis(3)="exec%20master.dbo.xp_cmdshell"

nothis(4)="net localgroup administrators"

nothis(5)="select"

nothis(6)="count"

nothis(7)="asc"

nothis(8)="char"

nothis(9)="mid"

nothis(10)="'"

nothis(11)=":"

nothis(12)=""""

nothis(13)="insert"

nothis(14)="delete"

nothis(15)="drop"

nothis(16)="truncate"

nothis(17)="from"

nothis(18)="%"

errc=false

for i= 0 to ubound(nothis)

if instr(FQYs,nothis(i))<>0 then

errc=true

end if

next

if errc then

response.write "<script language=""javascript"">"

response.write "parent.alert('很抱歉!你正在试图攻击本服务器或者想取得本服务器最高管理权!将直接转向首页..');"

response.write "self.location.href='default.asp';"

response.write "</script>"

response.end

end if


--------------------------------------------------------------------------------

第二种可以防止客户从本地提交到网站上

<%

server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))

server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))

if mid(server_v1,8,len(server_v2))<>server_v2 then

response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"

response.write "<tr><td style=font:9pt Verdana>"

response.write "你提交的路径有误,禁止从站点外部提交数据请不要乱该参数!"

response.write "</td></tr></table></center>"

response.end

end if

%>


录入时间:2007-03-12 21:03:09 [打印本页] [关闭窗口] [返回顶部]
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

Copyright © 2006-2014 0733168.Com Inc All Rights Reserved
关于我们 | 广告合作 | 联系我们 | 法律声明 | 友情链接 | 意见反馈
本站所收录信息、社区话题、及本站所做之广告均属其个人行为,与本站立场无关
湘ICP备06008436号