zoukankan      html  css  js  c++  java
  • asp防SQL注入

    <%

     Dim Fy_Post,Fy_Get,Fy_cook,Fy_In,Fy_Inf,Fy_Xh,Fy_db,Fy_dbstr,aa

    On Error Resume Next

    Fy_In = "'|exec|insert|select|delete|update|count|chr|truncate|char|declare|--|script|*|char|set|(|)"

    aa=" "    '------------------------------------------如入侵记录保存文件

    Fy_Inf = split(Fy_In,"|")

    '1--------POST部份------------------

    If Request.Form<>"" Then

    For Each Fy_Post In Request.Form

    For Fy_Xh=0 To Ubound(Fy_Inf)

    If Instr(LCase(Request.Form(Fy_Post)),Fy_Inf(Fy_Xh))<>0 Then

    flyaway1=""&Request.ServerVariables("REMOTE_ADDR")&","&Request.ServerVariables("URL")&"+'post'+"&Fy_post&"+"&replace(Request.Form(Fy_post),"'","*")&""

    set fs=server.CreateObject("Scripting.FileSystemObject")

    set file=fs.OpenTextFile(server.MapPath(aa),8,True)

    file.writeline flyaway1

    file.close

    set file=nothing

    set fs=nothing

    call aaa()

    End If

    Next

    Next

    End If

    '2--------GET部份-------------------

    If Request.QueryString<>"" Then

    For Each Fy_Get In Request.QueryString

    For Fy_Xh=0 To Ubound(Fy_Inf)

    If Instr(LCase(Request.QueryString(Fy_Get)),Fy_Inf(Fy_Xh))<>0 Then

    flyaway2=""&Request.ServerVariables("REMOTE_ADDR")&","&Request.ServerVariables("URL")&"+'get'+"&Fy_get&"+"&replace(Request.QueryString(Fy_get),"'","*")&""

    set fs=server.CreateObject("Scripting.FileSystemObject")

    set file=fs.OpenTextFile(server.MapPath(aa),8,True)

    file.writeline flyaway2

    file.close

    set file=nothing

    set fs=nothing

    call aaa()

    End If

    Next

    Next

    End If

    '3--------cookies部份-------------------

    If Request.Cookies<>"" Then

    For Each Fy_cook In Request.Cookies

    For Fy_Xh=0 To Ubound(Fy_Inf)

    If Instr(LCase(Request.Cookies(Fy_cook)),Fy_Inf(Fy_Xh))<>0 Then

    flyaway3=""&Request.ServerVariables("REMOTE_ADDR")&","&Request.ServerVariables("URL")&"+'cook'+"&Fy_cook&"+"&replace(Request.Cookies(Fy_cook),"'","*")&""

    set fs=server.CreateObject("Scripting.FileSystemObject")

    set file=fs.OpenTextFile(server.MapPath(aa),8,True)

    file.writeline flyaway3

    file.close

    set file=nothing

    set fs=nothing

    call aaa()

    End If

    Next

    Next

    End If

  • 相关阅读:
    poj 2104 C
    2015 百度之星初赛 1 2 2015ACM/ICPC亚洲区上海站 codeforces 851
    3.10补
    3.9补
    3.8补
    3.6补
    3.5补
    3.4补
    3.3补
    2.35补
  • 原文地址:https://www.cnblogs.com/ince/p/9154900.html
Copyright © 2011-2022 走看看