在asp头加上这条一般就可以很好的防御CC的攻击了
<%
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")>"" then response.end
%>
作者: 慕容豪情 时间: 2005-8-9 19:23 标题: [原创]CC分布式拒绝服务攻击临时解决方案
碰到CC攻击请把下面的代码放做成conn.asp,原理大家可以自己研究
<%
Dim fsoObject
Dim tsObject
dim file
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" then
response.write "系统维护中"
response.end
end if
Set fsoObject = Server.CreateObject("Scripting.FileSystemObject")
file = server.mappath("CCLog.txt")
if not fsoObject.fileexists(file) then
fsoObject.createtextfile file,true,false
end if
set tsObject = fsoObject.OpenTextFile(file,8)
tsObject.Writeline Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"["&Request.ServerVariables("REMOTE_ADDR")&"]"&now()
Set fsoObject = Nothing
Set tsObject = Nothing
response.write "系统维护中."
%>
作者: 黑色叶子 时间: 2005-8-9 22:34 标题: [原创]CC分布式拒绝服务攻击临时解决方案