复制代码 代码如下:
<%
Dim CC_Info(4),strInfo,strTemp
If Session("CC_Info") = "" Then
CC_Info(0) = "cclog.txt" '日志文件名
CC_Info(1) = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
CC_Info(2) = Request.ServerVariables("REMOTE_ADDR")
CC_Info(3) = 10 'N秒内禁止刷新当前页面
CC_Info(4) = "badip.txt" 'IP黑名单文件名
Session("CC_Info") = CC_Info(0) &"|"& CC_Info(1) &"|"& CC_Info(2) &"|"& CC_Info(3) &"|"& CC_Info(4)
Else
strInfo = Split(Session("CC_Info"),"|")
CC_Info(0) = strInfo(0)
CC_Info(1) = strInfo(1)
CC_Info(2) = strInfo(2)
CC_Info(3) = strInfo(3)
CC_Info(4) = strInfo(4)
End If
Const chkRefresh = 1 '0关闭防刷新
Const chkProxy = 1 '0关闭代理验证
Const chkBadIP = 1 '0关闭IP黑名单
If Session("BadIP") = "" Then
strInfo = ReadFile(CC_Info(4))
If strInfo = "" Then strInfo = "chinavb.net"
Session("BadIP") = strInfo
Else
strInfo = Session("BadIP")
End If
'/*第一层判断,N秒内禁止刷新*/
If chkRefresh = 1 Then
If Session("RefreshTime")="" Then
Session("RefreshTime")=Now()
Else
If DateDiff("s", Session("RefreshTime"), Now()) < CInt(CC_Info(3)) Then
Response.Write("系统繁忙,请稍候再试!错误代码001")
Response.End()
Else
Session("RefreshTime")=Now()
End If
End If
End If
'/*第二层判断,代理禁止查看*/
If chkProxy = 1 Then
If CC_Info(1) <> "" Then
If InStr(strInfo,CC_Info(1)) = 0 Then
strTemp = CC_Info(1) & vbCrLf
If InStr(strInfo,CC_Info(2)) = 0 Then
strTemp = strTemp & "[" & CC_Info(2) & "]" & vbCrLf
End If
SaveLog CC_Info(4),strTemp
strInfo = strInfo & strTemp
Session("BadIP") = strInfo
End If
'记录CC攻击日志
SaveLog CC_Info(0),CC_Info(1) & "["& CC_Info(2) & "]" & Now() &vbCrLf
Response.Write("系统繁忙,请稍候再试!错误代码002")
Response.End()
End If
End If
'/*第三层判断,IP黑名单禁止查看*/
If chkBadIP = 1 Then
If InStr(strInfo,CC_Info(2))>0 Then
Response.Write("系统繁忙,请稍候再试!错误代码003")
Response.End()
End If
End If
'ForReading=1,ForWriting=2,ForAppending=8
Function SaveLog(filename, filecontent)
On Error Resume Next
Dim fso, thisfile
filename = Server.MapPath(filename)
Set fso = CreateObject("Scripting.FileSystemObject")
If Err <> 0 Then
Response.Write("写入文件"&filename&"失败,可能您的系统不支持FSO!")
Response.End()
End If
Set thisfile = fso.OpenTextFile(filename, 8, True)
thisfile.write (filecontent)
thisfile.Close
Set fso = Nothing
End Function
Function ReadFile(filename)
On Error Resume Next
Dim fso, thisfile
Set fso = CreateObject("Scripting.FileSystemObject")
If Err <> 0 Then
Response.Write("读取文件"&filename&"失败,可能您的系统不支持FSO!")
Response.End()
End If
Set thisfile = fso.OpenTextFile(Server.MapPath(filename), 1, True)
ReadFile = thisfile.ReadAll
thisfile.Close
Set thisfile = Nothing
Set fso = Nothing
End Function
%>
<%
Dim CC_Info(4),strInfo,strTemp
If Session("CC_Info") = "" Then
CC_Info(0) = "cclog.txt" '日志文件名
CC_Info(1) = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
CC_Info(2) = Request.ServerVariables("REMOTE_ADDR")
CC_Info(3) = 10 'N秒内禁止刷新当前页面
CC_Info(4) = "badip.txt" 'IP黑名单文件名
Session("CC_Info") = CC_Info(0) &"|"& CC_Info(1) &"|"& CC_Info(2) &"|"& CC_Info(3) &"|"& CC_Info(4)
Else
strInfo = Split(Session("CC_Info"),"|")
CC_Info(0) = strInfo(0)
CC_Info(1) = strInfo(1)
CC_Info(2) = strInfo(2)
CC_Info(3) = strInfo(3)
CC_Info(4) = strInfo(4)
End If
Const chkRefresh = 1 '0关闭防刷新
Const chkProxy = 1 '0关闭代理验证
Const chkBadIP = 1 '0关闭IP黑名单
If Session("BadIP") = "" Then
strInfo = ReadFile(CC_Info(4))
If strInfo = "" Then strInfo = "chinavb.net"
Session("BadIP") = strInfo
Else
strInfo = Session("BadIP")
End If
'/*第一层判断,N秒内禁止刷新*/
If chkRefresh = 1 Then
If Session("RefreshTime")="" Then
Session("RefreshTime")=Now()
Else
If DateDiff("s", Session("RefreshTime"), Now()) < CInt(CC_Info(3)) Then
Response.Write("系统繁忙,请稍候再试!错误代码001")
Response.End()
Else
Session("RefreshTime")=Now()
End If
End If
End If
'/*第二层判断,代理禁止查看*/
If chkProxy = 1 Then
If CC_Info(1) <> "" Then
If InStr(strInfo,CC_Info(1)) = 0 Then
strTemp = CC_Info(1) & vbCrLf
If InStr(strInfo,CC_Info(2)) = 0 Then
strTemp = strTemp & "[" & CC_Info(2) & "]" & vbCrLf
End If
SaveLog CC_Info(4),strTemp
strInfo = strInfo & strTemp
Session("BadIP") = strInfo
End If
'记录CC攻击日志
SaveLog CC_Info(0),CC_Info(1) & "["& CC_Info(2) & "]" & Now() &vbCrLf
Response.Write("系统繁忙,请稍候再试!错误代码002")
Response.End()
End If
End If
'/*第三层判断,IP黑名单禁止查看*/
If chkBadIP = 1 Then
If InStr(strInfo,CC_Info(2))>0 Then
Response.Write("系统繁忙,请稍候再试!错误代码003")
Response.End()
End If
End If
'ForReading=1,ForWriting=2,ForAppending=8
Function SaveLog(filename, filecontent)
On Error Resume Next
Dim fso, thisfile
filename = Server.MapPath(filename)
Set fso = CreateObject("Scripting.FileSystemObject")
If Err <> 0 Then
Response.Write("写入文件"&filename&"失败,可能您的系统不支持FSO!")
Response.End()
End If
Set thisfile = fso.OpenTextFile(filename, 8, True)
thisfile.write (filecontent)
thisfile.Close
Set fso = Nothing
End Function
Function ReadFile(filename)
On Error Resume Next
Dim fso, thisfile
Set fso = CreateObject("Scripting.FileSystemObject")
If Err <> 0 Then
Response.Write("读取文件"&filename&"失败,可能您的系统不支持FSO!")
Response.End()
End If
Set thisfile = fso.OpenTextFile(Server.MapPath(filename), 1, True)
ReadFile = thisfile.ReadAll
thisfile.Close
Set thisfile = Nothing
Set fso = Nothing
End Function
%>
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年11月06日
2024年11月06日
- 雨林唱片《赏》新曲+精选集SACD版[ISO][2.3G]
- 罗大佑与OK男女合唱团.1995-再会吧!素兰【音乐工厂】【WAV+CUE】
- 草蜢.1993-宝贝对不起(国)【宝丽金】【WAV+CUE】
- 杨培安.2009-抒·情(EP)【擎天娱乐】【WAV+CUE】
- 周慧敏《EndlessDream》[WAV+CUE]
- 彭芳《纯色角3》2007[WAV+CUE]
- 江志丰2008-今生为你[豪记][WAV+CUE]
- 罗大佑1994《恋曲2000》音乐工厂[WAV+CUE][1G]
- 群星《一首歌一个故事》赵英俊某些作品重唱企划[FLAC分轨][1G]
- 群星《网易云英文歌曲播放量TOP100》[MP3][1G]
- 方大同.2024-梦想家TheDreamer【赋音乐】【FLAC分轨】
- 李慧珍.2007-爱死了【华谊兄弟】【WAV+CUE】
- 王大文.2019-国际太空站【环球】【FLAC分轨】
- 群星《2022超好听的十倍音质网络歌曲(163)》U盘音乐[WAV分轨][1.1G]
- 童丽《啼笑姻缘》头版限量编号24K金碟[低速原抓WAV+CUE][1.1G]