网上找的所谓过滤

简介:
img_a6339ee3e57d1d52bc7d02b338e15a60.gif < %@ LANGUAGE  =  VBScript CodePage  =   936 % >
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
< %
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Option   Explicit
img_a6339ee3e57d1d52bc7d02b338e15a60.gifResponse.Buffer 
=   true
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
dim  GQ,Checki,errc
img_a6339ee3e57d1d52bc7d02b338e15a60.gifGQ
= request.servervariables( " HTTP_USER_AGENT " )
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
img_a6339ee3e57d1d52bc7d02b338e15a60.giferrc
= false
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
dim  nothis( 19
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
0 ) = " net user "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
1 ) = " xp_cmdshell "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
2 ) = " /add "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
3 ) = " exec%20master.dbo.xp_cmdshell "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
4 ) = " net localgroup administrators "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
5 ) = " select "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
6 ) = " count "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
7 ) = " asc "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
8 ) = " char "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
9 ) = " mid "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
10 ) = " ' "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
11 ) = " : "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
12 ) = " "" "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
13 ) = " insert "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
14 ) = " delete "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
15 ) = " drop "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
16 ) = " truncate "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
17 ) = " from "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
18 ) = " % "  
img_a6339ee3e57d1d52bc7d02b338e15a60.gifnothis(
19 ) = " declare"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
for  checki =   0   to   ubound (nothis)
img_a6339ee3e57d1d52bc7d02b338e15a60.gif  
' --------------Get Filter
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
   if   instr ( lcase (GQ),nothis(checki)) <> 0   then
img_a6339ee3e57d1d52bc7d02b338e15a60.gif   errc
= true
img_a6339ee3e57d1d52bc7d02b338e15a60.gif   
exit   for
img_a6339ee3e57d1d52bc7d02b338e15a60.gif  
end   if
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
next
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
if  errc  then
img_a6339ee3e57d1d52bc7d02b338e15a60.gifresponse.
end
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
end   if
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Dim  Startime
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Dim  Dvbbs,template
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Dim  SqlNowString,Conn
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
' 定义数据库类别,1为SQL数据库,0为Access数据库
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Const  IsSqlDataBase  =   1
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
' 论坛缓存名称,如果一个站点有多个论坛请更改成不同名称
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Const  Forum_CacheName  =   " aspsky"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
' 定义运行模式,测试的时候设置1,正常运行的时候设置为0,不输出错误信息有利于安全,
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Const  IsDeBug  =   1
img_a6339ee3e57d1d52bc7d02b338e15a60.gifStartime 
=   Timer ()
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Dim  MyBoardOnline
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Dim  Db
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Set  Dvbbs  =   New  Cls_Forum
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Set  MyBoardOnline = new  Cls_UserOnlne 
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Set  template  =   New  cls_templates
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
If  IsSqlDataBase  =   1   Then
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    SqlNowString 
=   " GetDate()"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Else
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    SqlNowString 
=   " Now()"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
End   If
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
Sub  ConnectionDatabase
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
Dim  ConnStr
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
If  IsSqlDataBase  =   1   Then
img_a6339ee3e57d1d52bc7d02b338e15a60.gif        
' sql数据库连接参数:数据库名、用户密码、用户名、连接名(本地用local,外地用IP)
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
         Dim  SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
img_a6339ee3e57d1d52bc7d02b338e15a60.gif        SqlDatabaseName 
=   " dvbbs7"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        SqlPassword  =   " "
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        SqlUsername  =   " dvbbs"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        SqlLocalName  =   " (local)"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        ConnStr  =   " Provider = Sqloledb; User ID =  "   &  SqlUsername  &   " ; Password =  "   &  SqlPassword  &   " ; Initial Catalog =  "   &  SqlDatabaseName  &   " ; Data Source =  "   &  SqlLocalName  &   " ;"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
     Else
img_a6339ee3e57d1d52bc7d02b338e15a60.gif        
' 免费用户第一次使用请修改本处数据库地址并相应修改data目录中数据库名称,如将dvbbs6.mdb修改为dvbbs6.asp
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        Db  =   " data/dvbbs7.mdb"
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        ConnStr  =   " Provider = Microsoft.Jet.OLEDB.4.0;Data Source =  "   &  Server.MapPath(db)
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
End   If
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
On   Error   Resume   Next
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
Set  conn  =  Server. CreateObject ( " ADODB.Connection " )
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    conn.open ConnStr
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
If  Err  Then
img_a6339ee3e57d1d52bc7d02b338e15a60.gif        err.Clear
img_a6339ee3e57d1d52bc7d02b338e15a60.gif        
Set  Conn  =   Nothing
img_a6339ee3e57d1d52bc7d02b338e15a60.gif        Response.Write 
" 数据库连接出错,请检查连接字串。 " ' 注释,需要把这几个字翻译成英文。
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
        Response. End
img_a6339ee3e57d1d52bc7d02b338e15a60.gif    
End   If
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
End Sub
img_a6339ee3e57d1d52bc7d02b338e15a60.gif%
>
img_a6339ee3e57d1d52bc7d02b338e15a60.gif
原文件是动网SQL版本的conn.asp文件,是用来与sql连接的文件,朋友让我看看,是否做了过滤,一开始没懂,仔细一看,他所做的过滤是对"HTTP_USER_AGENT"接受到的字符进行检测,检测到则报错。
作用不言而喻,在程序出现了sql漏洞的时候,还能做到不让对方进行xp_cmdshell的操作,不过作用真的不是很大,只要在sql服务器上稍微做一下权限控制,或者删除xp_cmdshell的存储过程就可以了,实在有够多余,不过还是可以借鉴一下的。
相关文章
|
4天前
|
关系型数据库 MySQL
Mysql基础第九天,过滤数据
Mysql基础第九天,过滤数据
32 0
Mysql基础第九天,过滤数据
|
4天前
|
关系型数据库 MySQL
Mysql基础第十一天,用通配符进行过滤
Mysql基础第十一天,用通配符进行过滤
25 0
Mysql基础第十一天,用通配符进行过滤
|
4天前
|
搜索推荐 定位技术 SEO
360搜索引流怎么样?小马识途建议试试这七种方法
小马识途分享360搜索引流技巧:关键词优化提升SEO排名;创建360百科增加品牌曝光;地图注册便于客户查找;参与360问答互动引导流量;利用快资讯发布内容;上传360文库满足用户需求;360推广快速获取流量。多种方式结合,注意效果监测与优化,以赢得市场优势。
|
4天前
|
Perl
百度搜索:蓝易云【服务器日志处理,文件截取关键字教程】
通过按照上述步骤处理服务器日志并截取关键字,您可以有效地过滤和提取感兴趣的日志信息。请根据实际情况选择合适的工具和命令,以满足您的需求。
31 0
|
4天前
|
分布式计算 JavaScript 前端开发
给大家讲讲过滤查询的思路(一点就通)
给大家讲讲过滤查询的思路(一点就通)
23 1
|
存储 机器人 API
typecho博客增加评论过滤插件/违禁词拦截
typecho博客增加评论过滤插件/违禁词拦截
261 0
|
Web App开发
记一次burp抓包出错排查
记一次burp抓包出错排查
447 0
|
安全 JavaScript 前端开发
【知识】过滤漏洞上传姿势-客户端过滤-服务器端过滤-靶机挑战
漏洞上传是常见的web漏洞,但是我们上传文件总是会被过滤,那么,我们怎么才能绕过过滤呢?本文将为您细细道来。
112 0
|
SQL 安全 数据安全/隐私保护
|
SQL 存储 关系型数据库