主頁 > 知識(shí)庫 > 較為全面的asp防CC攻擊代碼分享

較為全面的asp防CC攻擊代碼分享

熱門標(biāo)簽:java外呼系統(tǒng)是什么 創(chuàng)意電話機(jī)器人 梧州市地圖標(biāo)注 石家莊慧營銷外呼系統(tǒng) 外呼線路批發(fā) 地圖標(biāo)注陽江 武穴地圖標(biāo)注 世界地圖標(biāo)注了哪些城市 濟(jì)源電銷外呼系統(tǒng)線路
復(fù)制代碼 代碼如下:

%
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秒內(nèi)禁止刷新當(dāng)前頁面
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關(guān)閉防刷新
Const chkProxy = 1 '0關(guān)閉代理驗(yàn)證
Const chkBadIP = 1 '0關(guān)閉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秒內(nèi)禁止刷新*/
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("系統(tǒng)繁忙,請稍候再試!錯(cuò)誤代碼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("系統(tǒng)繁忙,請稍候再試!錯(cuò)誤代碼002")
Response.End()
End If
End If

'/*第三層判斷,IP黑名單禁止查看*/
If chkBadIP = 1 Then
If InStr(strInfo,CC_Info(2))>0 Then
Response.Write("系統(tǒng)繁忙,請稍候再試!錯(cuò)誤代碼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"失敗,可能您的系統(tǒng)不支持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"失敗,可能您的系統(tǒng)不支持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
%>
您可能感興趣的文章:
  • Linux VPS下簡單解決CC攻擊的方法
  • PHP防CC攻擊實(shí)現(xiàn)代碼
  • php cc攻擊代碼與防范方法

標(biāo)簽:揭陽 淮北 甘南 迪慶 滁州 來賓 南寧 唐山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《較為全面的asp防CC攻擊代碼分享》,本文關(guān)鍵詞  較為,全,面的,asp,防,攻擊,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《較為全面的asp防CC攻擊代碼分享》相關(guān)的同類信息!
  • 本頁收集關(guān)于較為全面的asp防CC攻擊代碼分享的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章