回 帖 发 新 帖 刷新版面

主题:ASP高手帮看看这段代码,有没有后门,或木马什么的,

ASP高手帮看看这段代码,有没有后门,或木马什么的,这段是干什么用的,谁用过或了解帮看看,谢谢

<%
'★★--------防SQL注入----------------★★
Dim Fy_Url,Fy_a,Fy_x,Fy_Cs(),Fy_Cl,Fy_Ts,Fy_Zx
'---定义部份  头------
Fy_Cl = 2        '处理方式:1=提示信息,2=转向页面,3=先提示再转向
Fy_Zx = "http://www.qdaax.com/"    '出错时转向的页面
'---定义部份  尾------

On Error Resume Next
Fy_Url=Request.ServerVariables("QUERY_STRING")
Fy_a=split(Fy_Url,"&")
redim Fy_Cs(ubound(Fy_a))
On Error Resume Next
for Fy_x=0 to ubound(Fy_a)
Fy_Cs(Fy_x) = left(Fy_a(Fy_x),instr(Fy_a(Fy_x),"=")-1)
Next
For Fy_x=0 to ubound(Fy_Cs)
If Fy_Cs(Fy_x)<>"" Then
If Instr(LCase(Request(Fy_Cs(Fy_x))),"'")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"and")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"select")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"update")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"chr")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"delete%20from")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),";")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"insert")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"mid")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"master.")<>0 Then

Select Case Fy_Cl
  Case "1"
Response.Write "<Script Language=JavaScript>alert('出现错误!参数 "&Fy_Cs(Fy_x)&" 的值中包含非法字符串!\n\n请不要在参数中使用非法字符!\n\n请自觉守法、文明访问!');window.close();</Script>"
  Case "2"
Response.Write "<Script Language=JavaScript>location.href='"&Fy_Zx&"'</Script>"
  Case "3"
Response.Write "<Script Language=JavaScript>alert('出现错误!参数 "&Fy_Cs(Fy_x)&"的值中包含非法字符串!\n\n请不要在参数中使用非法字符!\n\n请自觉守法、文明访问!');location.href='"&Fy_Zx&"';</Script>"
End Select

Response.End
End If
End If
Next
%>

回复列表 (共2个回复)

沙发

过滤非法字符的吧。。。。

和后门,木马的没有关系

板凳

好,谢谢

我来回复

您尚未登录,请登录后再回复。点此登录或注册