揭秘asp常用函数库大全(4)_ASP教程
教程Tag:暂无Tag,欢迎添加,赚取U币!
推荐:详解将ASP页面改为伪静态的简单方法目前很多网站都采用生成静态页的方法,原因是这样访问速度会得到提高(服务器端CPU利用率很低),另外也容易被搜索引擎收录,但是这带来的一个问题就是需要足够大的空间存放这些静态页面,如果你的空间不是很富裕,而又想有利于被搜索引擎收录,其实可以采用伪
’----------------------------------数据过滤 ↓---------------------------------------
Function CheckSql() ’防止SQL注入
Dim sql_injdata
SQL_injdata = "’|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.QueryString<>"" Then
For Each SQL_Get In Request.QueryString
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
Response.Write "<Script Language=’javascript’>{alert(’请不要在参数中包含非法字符!’);history.back(-1)}</Script>"
Response.end
end if
next
Next
End If
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
Response.Write "<Script Language=’javascript’>{alert(’请不要在参数中包含非法字符!’);history.back(-1)} </Script>"
Response.end
end if
next
next
end if
End Function
Function CheckStr(byVal ChkStr) ’检查无效字符
Dim Str:Str=ChkStr
Str=Trim(Str)
If IsNull(Str) Then
CheckStr = ""
Exit Function
End If
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="(\r\n){3,}"
Str=re.Replace(Str,"$1$1$1")
Set re=Nothing
Str = Replace(Str,"’","’’")
Str = Replace(Str, "select", "select")
Str = Replace(Str, "join", "join")
Str = Replace(Str, "union", "union")
Str = Replace(Str, "where", "where")
Str = Replace(Str, "insert", "insert")
Str = Replace(Str, "delete", "delete")
Str = Replace(Str, "update", "update")
Str = Replace(Str, "like", "like")
Str = Replace(Str, "drop", "drop")
Str = Replace(Str, "create", "create")
Str = Replace(Str, "modify", "modify")
Str = Replace(Str, "rename", "rename")
Str = Replace(Str, "alter", "alter")
Str = Replace(Str, "cast", "cast")
CheckStr=Str
End Function
Function UnCheckStr(Str) ’检查非法sql命令
Str = Replace(Str, "select", "select")
Str = Replace(Str, "join", "join")
Str = Replace(Str, "union", "union")
Str = Replace(Str, "where", "where")
Str = Replace(Str, "insert", "insert")
Str = Replace(Str, "delete", "delete")
Str = Replace(Str, "update", "update")
Str = Replace(Str, "like", "like")
Str = Replace(Str, "drop", "drop")
Str = Replace(Str, "create", "create")
Str = Replace(Str, "modify", "modify")
Str = Replace(Str, "rename", "rename")
Str = Replace(Str, "alter", "alter")
Str = Replace(Str, "cast", "cast")
UnCheckStr=Str
End Function
分享:解析有关eWebEditor网页编辑器的漏洞首先介绍编辑器的一些默认特征: 默认登陆admin_login.asp 默认数据库db/ewebeditor.mdb 默认帐号admin密码admin或admin888 在baidu/google搜索inurl:ewebeditor 几万的站起码有几千个是具有默认特征的,那么试一下默认后台 http://www.xxx.com.cn/admin/eweb
相关ASP教程:
- 相关链接:
- 教程说明:
ASP教程-揭秘asp常用函数库大全(4)。