- 热门文章:
- · DataGrid 分页问题 -- 无法响应 PageIndexChanged 事件
- · ADO三大对象的属性、方法、事件及常数
- · Asp数据库访问代码自动产生工具-ASPRunner(适用初学者和为了提高开发效率的Developer)
- · Connection 对象
- · 如何在ado中使用connection 对象什么是connection对象?
- · 数据验证之特殊字符处理
- · 如何让DataGrid自动生成序号
- · 几个小时后,我学数据库,找到一些代码
- · DataGrid自定义分页存储过程
- · Asp 单页查询数据库!
- · 用WEB(ASP)方式实现SQL SERVER 数据库的备份和恢复
- · Asp备份与恢复SQL Server数据库
ASP上两个防止SQL注入式攻击Function
@#==========================
@#过滤提交表单中的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
- · XP 风格的可拖动列、可排序、可改变宽度的DataGrid的例子
- · datagrid编辑、修改、删除、翻页例子
- · DataGrid脚眉显示合计
- · datagrid编辑、修改、删除、翻页例子
- · 把dataset作为一个xml文件传给客户端
- · OLEDB Resource(Session) Pooling (在Ado开发中使用连接池)
- · DataReader使用
- · asp + oracle 分页方法 (不用存储过程)
- · 关于DropDownList绑定数据的一点认识
- · 在ASP中处理数据库的NULL记录
- · 求解在SQL中使用了where列所遇到的问题
- · asp + sqlserver 分页方法(不用存储过程)
- · 用的ASP防SQL注入攻击程序
- · MySQL数据库基础教程
- · ASP和SQLServer时间处理方法Ⅰ
- · 在SQL Server中保存和输出图片
- · 用ASP实现文档资料管理
- · ASP连接数据库的5种方法
- · 随机提取数据库记录
- · 常用Response对象的使用详解
- · 在DataGrid中删除记录时弹出确认窗口
- · SQL Server CHARINDEX和PATINDEX详解
- · DataGrid单击一行改变此行背景色
- · [分享]解决Access错误 Selected collating sequence not supported by the operating system
- · 如何使用标签显示完整的svg图像?
- · datagrid与DataSet结合使用中出现的索引问题
- · web.config配置web应用程序中的数据库连接
- · ASP构造大数据量的分页SQL语句
- · 方便的使用单击和双击更新DataGrid中的数据的例子
- · 一个离线ADO数据管理模块的实现
- · DataGrid在PostBack后定位记录的简单办法
- · DataGrid和存储过程结合的分页,只读取当前页数据
- · 利用Application和Session优化Asp的数据库联接
- · 动态载入树 (ASP+数据库)
- · 解决使用ASP无法连接 ORACLE 9i 数据库的问题。
- · 一次编程实践[ASP+MSSQL]
- · 根据传入的recordset对象实例,按表格输出内容子过程
- · URL编码与SQL注射
