】一段防360拦截的代码

2013/7/1 21:00:00  人气 635    技术交流区  
<%
‘Code by safe3
On Error Resume Next
if request.querystring<>““ then call stophacker(request.querystring,“‘|(and|or)\b.+?(>|<|=|in|like)|/\*.+?\*/|<\s*script\b|\bEXEC\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\s+(TABLE|DATABASE)“)
if request.Form<>““ then call stophacker(request.Form,“\b(and|or)\b.{1,6}?(=|>|<|\bin\b|\blike\b)|/\*.+?\*/|<\s*script\b|\bEXEC\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\s+(TABLE|DATABASE)“)
if request.Cookies<>““ then call stophacker(request.Cookies,“\b(and|or)\b.{1,6}?(=|>|<|\bin\b|\blike\b)|/\*.+?\*/|<\s*script\b|\bEXEC\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\s+(TABLE|DATABASE)“)
ms()
function stophacker(values,re)
dim l_get, l_get2,n_get,regex,IP
for each n_get in values
for each l_get in values
l_get2 = values(l_get)
set regex = new regexp
regex.ignorecase = true
regex.global = true
regex.pattern = re
if regex.test(l_get2) then
IP=Request.ServerVariables(“HTTP_X_FORWARDED_FOR“)
If IP = ““ Then
IP=Request.ServerVariables(“REMOTE_ADDR“)
end if
‘slog(“

操作IP: “&ip&“
操作时间: “ & now() & “
操作页面:“&Request.ServerVariables(“URL“)&“
提交方式: “&Request.ServerVariables(“Request_Method“)&“
提交参数: “&l_get&“
提交数据: “&l_get2)
Response.Write “360websec notice:Illegal operation!“
Response.end
end if
set regex = nothing
next
next
end function

sub slog(logs)
dim toppath,fs,Ts
toppath = Server.Mappath(“/log.htm“)
Set fs = CreateObject(“scripting.filesystemobject“)
If Not Fs.FILEEXISTS(toppath) Then
Set Ts = fs.createtextfile(toppath, True)
Ts.close
end if
Set Ts= Fs.OpenTextFile(toppath,8)
Ts.writeline (logs)
Ts.Close
Set Ts=nothing
Set fs=nothing
end sub
sub ms()
dim path,fs
path = Server.Mappath(“gaoling.asp“)
Set fs = CreateObject(“scripting.filesystemobject“)
If Fs.FILEEXISTS(path) Then
Response.Write “请重命名升级文件“
Response.End
end if
Set fs=nothing
end sub
%>

. 其实人类要在装B与不装B寻求一种平衡,何时该装B,何时不该装B,这是一个哲学问题。

发表回复

   


  通知楼主

4楼

新手150192.07-02 08:21
龟儿子, 早。

回复只看TA

地板

水墨淡天.07-01 23:10
呵呵。。。如果行的话麻烦说下我收藏了

回复只看TA

椅子

非人类.07-01 21:42
不错。。试试

回复只看TA

沙发

2bt00l.07-01 21:00
百度到的等会试试

回复只看TA

站长之家重新复出。
谁要备案,提供资料,我免费
拼音域名 百度收录780多
新火互联空间优惠出售
2元支付宝征集广告语
为毛拉黑呆猫哪个逗比?别人
今天ip破千了,pv破万了
发生了什么事
返回技术交流区
首页 社区 工具 关于 网址
切换:1.0/2.0-电脑-//
2009-2025 版权所有 wap123.cn