ASP下的两个防止SQL注入式攻击的Function
2023-06-13 09:13:58 时间
用于防止sql注入攻击的函数,大家可以直接用了,不过大家光会用不行,要增强安全意识
复制代码代码如下:
"==========================
"过滤提交表单中的SQL
"==========================
function ForSqlForm()
dim fqys,errc,i,items
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)="%"
"nothis(19)="@"
errc=false
for i= 0 to ubound(nothis)
for each items in request.Form
if instr(request.Form(items),nothis(i))<>0 then
response.write("<div>")
response.write("你所填写的信息:" & server.HTMLEncode(request.Form(items)) & "<br>含非法字符:" & nothis(i))
response.write("</div>")
response.write("对不起,你所填写的信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>")
response.End()
end if
next
next
end function
"==========================
"过滤查询中的SQL
"==========================
function ForSqlInjection()
dim fqys,errc,i
dim nothis(19)
fqys = request.ServerVariables("QUERY_STRING")
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)="%"
nothis(19)="@"
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 "查询信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>"
response.end
end if
end function
相关文章
- Unity 如何实现游戏中技能的扇形攻击范围
- php和asp网络验证码,Verifycode 1个简单的网页图片验证码的示例程序,基本上现有 字和字母都可以识别。 WEB(ASP,PHP,…) 238万源代码下载- www.pudn.com…
- 行业安全解决方案|腾讯游戏安全一站式防护,助力对抗外挂和DDoS攻击
- 实现无线邪恶双胞胎Evil Twins社会工程学钓鱼攻击
- 约束委派攻击
- 攻击Linux防止SYN攻击:简单有效的方法(linux防syn)
- 防范Oracle注入攻击 保障权限提升安全(oracle注入提权)
- ASP操作MySQL数据库的实现(asp读取mysql)
- 漫画告诉你什么是DDoS攻击?
- 针对TP-LINK的CSRF攻击来劫持DNS案例
- 防止mysql SQL注入攻击的措施(Mysql的sql注入)
- Linux脚本攻击:防范技巧与实践(linux脚本攻击)
- 击破Linux代码之谜:如何攻击系统(linux如何攻击)
- 如何防范SQL注入攻击:MySQL的几种安全策略(sql注入mysql)
- 企业攻防实战:六大秘诀有效对抗APT攻击
- asp构建基于SQL Server和ASP的全新应用(sqlserver 和)
- ASP网页MySQL注入及防御研究(asp页面mysql注入)
- ASP连接MySQL编码入门实战(asp链接mysql代码)
- 数据库ASP环境下注册MySQL数据库步骤指南(asp注册mysql)
- 基于ASP技术连接MySQL数据库(asp支持mysql)
- 数据库探索ASP环境搭建MySQL数据库方法(asp搭建mysql)
- 数据ASP解析MySQL中文数据实现无缝互联(asp接受mysql中文)
- 利用ASP技术进行MySQL数据库开发(asp可以使用mysql)
- 如何突破外网Redis的安全防火墙(如何攻击外网的redis)
- Oracle ASP程序助你轻松下载(oracle asp下载)
- 万能Asp防注入代码拒绝攻击
- SQL注入式攻击的终极防范
- asp.net(C#)动态添加非ASP的标准html控件(如添加Script标签)