日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

ASP防止GET,Post注入和防止服務(wù)器攻擊,并記錄IP(2)_ASP教程

編輯Tag賺U幣
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

推薦:ASP將IP地址最后一位替換成星號(hào)實(shí)例代碼
先將IP地址存入數(shù)據(jù)庫(kù),然后取出來(lái),效果如圖: 代碼如下: % '來(lái)源 ipstr= rs(cIP) ipstr=split(ipstr,.,-1,1) ipstrout=ipstr(0).ipstr(1).ipstr(2).* response.write ipstrout %


' Write current information to Log Text File.
TS_Post.writeline "攻擊者詳細(xì)資料:"
TS_Post.writeline "攻擊者IP地址:"&strip_Post
TS_Post.writeline "攻擊時(shí)間:"&strTime_Post
TS_Post.writeline "攻擊頁(yè)面:"&Request.ServerVariables("URL")
TS_Post.writeline "提交參數(shù):"&Fy_Post
TS_Post.writeline "提交數(shù)據(jù):"&Request.Form(Fy_Post)
TS_Post.writeline "提交方式:post"
TS_Post.writeline "----------------------------------------"
TS_Post.Writeline ""
' Create a session varialbe to check next time for ValidEntry_Post
Session("LogIn_post") = "yes"
Set TS_Post = Nothing
Set FSO_Post = Nothing
end if
'記錄post攻擊結(jié)束
Response.Write "<Script Language=JavaScript>alert('警告:此操作已被記錄! 提示:POST傳值請(qǐng)不要在參數(shù)中包含非法字符【"&replace(Fy_Inf(Fy_Xh),"'","’")&"】. 頁(yè)面將返回!');history.go(- 1);</Script>"
response.End()
end if
Next
Next
end if
'--------GET部份-------------------
If Request.QueryString<>"" Then
For Each Fy_Get In Request.QueryString

For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.QueryString(Fy_Get)),Fy_Inf(Fy_Xh))<>0 Then

'記錄Get攻擊開始

ValidEntry_Get = True
If not IsEmpty(Session("LogIn_get")) Then ValidEntry_Get = False
If ValidEntry_Get Then
Const ForAppending_Get = 8
Const Create_Get = true
Dim FSO_Get
DIM TS_Get
DIM MyFileName_Get
'Dim strLog
Dim strTime_Get,strip_Get,strurll_Get,strwords_Get
MyFileName_Get = Server.MapPath(fxjt111_Attack_Get)
Set FSO_Get = Server.CreateObject("Scripting.FileSystemObject")
Set TS_Get = FSO_Get.OpenTextFile(MyFileName_Get, ForAppending_Get, Create_Get)
strip_Get=Request.ServerVariables ("REMOTE_ADDR") & ""
if strip_Get="" then
strip_Get=Request.ServerVariables("HTTP_X_FORWARDED_FOR") & ""
end if
'strurll_Get=request.servervariables("http_referer")
strwords_Get=request.servervariables("query_string")
strTime_Get=now()
' Write current information to Log Text File.
TS_Get.writeline "攻擊者詳細(xì)資料:"
TS_Get.writeline "攻擊者IP地址:"&strip_Get
TS_Get.writeline "攻擊時(shí)間:"&strTime_Get
TS_Get.writeline "攻擊頁(yè)面:"&Request.ServerVariables("URL")
TS_Get.writeline "提交參數(shù):"&Fy_Get
TS_Get.writeline "提交數(shù)據(jù):"&Request.QueryString(Fy_Get)
TS_Get.writeline "提交方式:Get"
TS_Get.writeline "----------------------------------------"
TS_Get.Writeline ""
' Create a session varialbe to check next time for ValidEntry_Get
Session("LogIn_get") = "yes"
Set TS_Get = Nothing
Set FSO_Get = Nothing
end if

分享:全角半角轉(zhuǎn)換代碼
javascript轉(zhuǎn)換: SCRIPT /* **************************** * 參數(shù)說(shuō)明: * str:要轉(zhuǎn)換的字符串 * flag:標(biāo)記,為0時(shí)半轉(zhuǎn)全,為非0時(shí)全轉(zhuǎn)半 * 返回值類型:字符串 **************************** */ function DBC2SBC(str,flag) { var i; var result=''; if (

來(lái)源:模板無(wú)憂//所屬分類:ASP教程/更新時(shí)間:2012-06-08
相關(guān)ASP教程