校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > ASP下的兩個防止SQL注入式攻擊的Function

ASP下的兩個防止SQL注入式攻擊的Function

熱門標簽:調度系統外呼 伊春外呼業務系統 福建外呼增值業務線路 宜賓語音外呼系統軟件 中國辦理電信400電話 電銷機器人教育 綿陽防封電銷卡價格 電銷機器人源碼網盤下載 河北智能外呼系統軟件
用于防止sql注入攻擊的 函數,大家可以直接用了,不過大家光會用不行,要增強安全意識
復制代碼 代碼如下:

'==========================
'過濾提交表單中的SQL
'==========================
function ForSqlForm()
dim fqys,errc,i,items
dim nothis(18)
nothis(0)="net user"
nothis(1)="xp_cmdshell"
nothis(2)="/add"
nothis(3)="exec%20master.dbo.xp_cmdshell"
nothis(4)="net localgroup administrators"
nothis(5)="select"
nothis(6)="count"
nothis(7)="asc"
nothis(8)="char"
nothis(9)="mid"
nothis(10)="'"
nothis(11)=":"
nothis(12)=""""
nothis(13)="insert"
nothis(14)="delete"
nothis(15)="drop"
nothis(16)="truncate"
nothis(17)="from"
nothis(18)="%"
'nothis(19)="@" 
errc=false
for i= 0 to ubound(nothis)
  for each items in request.Form
  if instr(request.Form(items),nothis(i))>0 then
   response.write("div>")
   response.write("你所填寫的信息:"  server.HTMLEncode(request.Form(items))  "br>含非法字符:"  nothis(i))
   response.write("/div>")
   response.write("對不起,你所填寫的信息含非法字符!a href=""#"" onclick=""history.back()"">返回/a>")
   response.End()
  end if
  next
next
end function
'==========================
'過濾查詢中的SQL
'==========================
function ForSqlInjection()
dim fqys,errc,i
dim nothis(19)
fqys = request.ServerVariables("QUERY_STRING")
nothis(0)="net user"
nothis(1)="xp_cmdshell"
nothis(2)="/add"
nothis(3)="exec%20master.dbo.xp_cmdshell"
nothis(4)="net localgroup administrators"
nothis(5)="select"
nothis(6)="count"
nothis(7)="asc"
nothis(8)="char"
nothis(9)="mid"
nothis(10)="'"
nothis(11)=":"
nothis(12)=""""
nothis(13)="insert"
nothis(14)="delete"
nothis(15)="drop"
nothis(16)="truncate"
nothis(17)="from"
nothis(18)="%"
nothis(19)="@" 
errc=false
for i= 0 to ubound(nothis)
if instr(FQYs,nothis(i))>0 then
errc=true
end if
next
if errc then
response.write "查詢信息含非法字符!a href=""#"" onclick=""history.back()"">返回/a>"
response.end
end if
end function

標簽:延邊 電商邀評 那曲 河池 優質小號 銅川 蘇州 新鄉

巨人網絡通訊聲明:本文標題《ASP下的兩個防止SQL注入式攻擊的Function》,本文關鍵詞  ASP,下,的,兩個,防止,SQL,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《ASP下的兩個防止SQL注入式攻擊的Function》相關的同類信息!
  • 本頁收集關于ASP下的兩個防止SQL注入式攻擊的Function的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 盐池县| 沛县| 宣汉县| 婺源县| 富顺县| 阜平县| 宜兰县| 青田县| 雷州市| 广安市| 绥德县| 吴川市| 嫩江县| 方正县| 滦平县| 梧州市| 左贡县| 陆川县| 静海县| 杭州市| 镇巴县| 亚东县| 定边县| 大新县| 舞钢市| 沐川县| 泸定县| 玉屏| 巴彦淖尔市| 宝鸡市| 湖南省| 焦作市| 历史| 扶风县| 大化| 明光市| 湘潭县| 汨罗市| 南丹县| 合山市| 固始县|