欧美性猛交黑人xxxx,成人毛片一区二区三区,久久综合九色综合精品,男的把j放进女人下面视频免费

ASP防SQL注入終極防范實例

  • 發布于:2020-01-06
  • 274 人圍觀

下面給出4個函數,足夠你抵擋一切SQL注入漏洞!讀懂代碼,你就能融會貫通。

注意要對所有的request對象進行過濾:包括 request.cookie, request.ServerVariables 等等容易被忽視的對象:

程序代碼

復制代碼 代碼如下:

function killn(byval s1) '過濾數值型參數
if not isnumeric(s1) then 
killn=0
else
if s1〈0 or s1〉2147483647 then 
killn=0
else
killn=clng(s1)
end if
end if
end function

function killc(byval s1) 過濾貨幣型參數
if not isnumeric(s1) then 
killc=0
else
killc=formatnumber(s1,2,-1,0,0)
end if
end function

function killw(byval s1) '過濾字符型參數
if len(s1)=0 then
killw=""
else
killw=trim(replace(s1,"'",""))
end if
end function

function killbad(byval s1) 過濾所有危險字符,包括跨站腳本
If len(s1) = 0 then
killbad=""
else
killbad = trim(replace(replace(replace(replace(replace(replace(replace(replace(s1,Chr(10), "〈br〉"), Chr(34), """), "〉", ">"), "〈", "<"), "&", "&"),chr(39),"'"),chr(32)," "),chr(13),""))
end if
end function 

萬企互聯
標簽: