English
 电子信箱
 加入收藏

  威盾防火墙 >> 新闻中心 >> 业界动态 >> 防cc攻击代码

 

防cc攻击代码

威盾防火墙 2014-11-12

 
<% 
'================== 
'防CC攻击ASP程序插件 
'建议除必须修改的参数内容外不要修改其他内容  
'================== 
dim FYCC_19,FYCC_20,FYCC_21,FYCC_05 
dim FYCC_18 
FYCC_05="" 
'CCLog.txt存放的路径文件夹!需要手动创建!建议留空 
'如果输入,请在前面加上符号"/" 
FYCC_18=1 
'防刷新CC攻击关闭与启动,1为启动0为关闭 
FYCC_17=1 
'防刷新禁止IP功能关闭与启动,1为启动0为关闭 
FYCC_19=10 
'每分钟刷新次数,将会出现提示 
FYCC_20="http://www.163.com" 
'被封IP后自动转入的页面,建议输入存127.0.0.1让攻击者攻击自已!!! 
FYCC_21=21 
'恶意刷新几次将禁止IP 
dim realip,proxy 
realip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
proxy = Request.ServerVariables("REMOTE_ADDR") 
if realip = "" then 
GetIp = proxy 
else 
GetIp = realip 
end if 
Sub FYCC_03() 
Set fsoObject = Server.CreateObject("Scripting.FileSystemObject") 
file = server.mappath(""&FYCC_05&"/CCLog.txt") 
if not fsoObject.fileexists(file) then 
fsoObject.createtextfile file,true,false 
end if 
set tsObject = fsoObject.OpenTextFile(file,8) 
tsObject.Writeline " "&GetIp&"" 
Set tsObject = Nothing 
Set fsoObject = Nothing 
End Sub 
if FYCC_18<>0 then 
if FYCC_17<>0 then 
if minute(now())>-1 and minute(now())<4 then 
Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 
Set objCountFile=objFSO.CreateTextFile(Server.MapPath(""&FYCC_05&"/CCLog.txt"),True) 
objCountFile.Write " " 
objCountFile.Close 
Set objCountFile=Nothing 
Set objFSO = Nothing 
end if 
Set fsoObject = Server.CreateObject("Scripting.FileSystemObject") 
file = server.mappath(""&FYCC_05&"/CCLog.txt") 
if not fsoObject.fileexists(file) then 
fsoObject.createtextfile file,true,false 
if err.number<>0 then 
response.write "您的空间不支持FSO,请同您的空间商联系,或者查看相关权限设置" 
response.end 
end if 
end if 
Set objCountFile = fsoObject.OpenTextFile(Server.MapPath(""&FYCC_05&"/CCLog.txt"),1,True) 
If Not objCountFile.AtEndOfStream Then fdata = objCountFile.ReadAll 
Set objCountFile = Nothing 
if instr(fdata,""&GetIp&"")>0 then 
response.write "您的IP["&GetIp&"]已经被禁止!如需要解封,请联系本站管理员或在下一个小时的前3分钟内再访问本站" 
response.end 
end if 
Set fsoObject = Nothing 
end if 
if Session("FYCC_01")>FYCC_19 and minute(now())<>Session("FYCC_02") then 
Session("FYCC_01")=1 
Session("FYCC_02")=minute(now()) 
elseif Session("FYCC_01")>FYCC_21-1 and minute(now())=Session("FYCC_02") then 
if FYCC_17<>0 and Session("FYCC_01")>FYCC_21-1 then 
Call FYCC_03() 
end if 
response.redirect ""&FYCC_20&"" '建议输入存放病毒的网址!!! 
response.end 
elseif Session("FYCC_01")>FYCC_19 and minute(now())=Session("FYCC_02") then 
response.write "本站启动防刷新功能,1分钟内只能翻"&FYCC_19&"页,请在下一分钟再刷新本页面" 
Session("FYCC_01")=Session("FYCC_01")+1 
response.end 
else 
if Session("FYCC_01")="" then 
Session("FYCC_01")=1 
Session("FYCC_02")=minute(now()) 
else 
if minute(now())<>Session("FYCC_02") then 
Session("FYCC_01")=1 
Session("FYCC_02")=minute(now()) 
else 
Session("FYCC_01")=Session("FYCC_01")+1 
end if 
end if 
End if 
end if 
%>
使用方法 
1,把FYCC.asp文件放置到你网站的根目录(要与网站首页同目录) 
3,打开网站默认访问文件(一般是index.asp),然后插入<!--#include file="FYCC.asp"--> 
4,打开FYCC.asp修改顶部您自已的设置参数 
5,两个文件保存上传

相关内容: 最新内容:
网络攻击技术包括哪些[2014-11-10]
DDoS攻防战:CC攻击及ip黑白名单防火墙frdev的原理与实现[2014-11-10]
CC攻击的原理和预防[2014-11-10]
CC攻击的原理及如何防范[2014-11-10]
CC攻击及ip黑白名单防火墙原理与实现[2014-11-10]
CC攻击原理及预防措施[2014-11-10]
HTTP协议/IIS 原理及ASP.NET运行机制浅析【图解】[2014-11-11]
Windows XP中配置PHP+IIS环境+mysql[2014-11-11]
Lighttpd 图片和视频等文件的防盗链处理[2014-11-11]
NET处理HTTP请求[2014-11-11]
ASP.NET页面与IIS底层交互和工作原理详解[2014-11-11]
解决在 IIS 6.0 中,无法下载超过4M的附件步骤[2014-11-11]