用工具检测到网站存在SQL注入点,那么如何进行修补

来源:百度文库 编辑:神马文学网 时间:2024/04/28 07:22:31
检测工具:明小子旁注Domain V3.5
用工具检测到网站存在SQL注入点,那么如何进行修补呢?
1.新建一个asp文件,写入以下代码,保存文件名为checkSQL.asp。<%
Dim Fy_Url,Fy_a,Fy_x,Fy_Cs(),Fy_Cl,Fy_Ts,Fy_Zx
‘---定义部份 头------
Fy_Cl = 3     ‘处理方式:1=提示信息,2=转向页面,3=先提示再转向
Fy_Zx = "[color=Red]输入你的网页地址[/color]"   ‘出错时转向的页面
‘---定义部份 尾------
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 ""
Case "2"
Response.Write ""
Case "3"
Response.Write ""
End Select
Response.End
End If
End If
Next
%>
然后把此文件放到网站目录上去,然后在被发现有注入点的文件里,找到以下代码,
注意,“***.***”为连接的文件,找到相关类似的代码即可,然后在后面添加一句
要注意checkSQL.asp所放在的路径,对应修改。完成后再用工具后在扫一次,确定不在被发现SQL注入点后,问题解决