防SQL注入

2021-04-12 12:27:53 字數 922 閱讀 8461

這段**有好處也有壞處,用的時候得小心,搞不好就會跳進錯誤

dimsql_injdata

sql_injdata ="

;|'|and|exec|insert|select|delete|update|*|%|chr|mid|master|truncate|char|declare

"sql_inj 

=split

(sql_injdata,"|

")ifrequest.querystring

<>

""then

foreach

sql_get in request.querystring

forsql_data=0

toubound

(sql_inj)

ifinstr

(request.querystring(sql_get),sql_inj(sql_data))

>

0then

response.write 

" "

response.end

endif

next

next

endif

ifrequest.form

<>

""then

foreach

sql_post in request.form

forsql_data=0

toubound

(sql_inj)

ifinstr

(request.form(sql_post),sql_inj(sql_data))

>

0then

response.write 

" "

response.end

endif

next

next

endif

防SQL注入

1.必須認定使用者輸入的資料都是不安全的 使用者輸入的資料進行過濾處理 if preg match w get username matches else 讓我們看下在沒有過濾特殊字元時,出現的sql情況 設定 name 中插入了我們不需要的sql語句 name qadir delete from ...

防SQL注入

與資料庫互動的 web 應用程式中最嚴重的風險之一 sql 注入攻擊。sql 注入是應用程式開發人員未預期的把 sql 傳入到應用程式的過程,它由於應用程式的糟糕設計而使攻擊成為可能,並且只有那些直接使用使用者提供的值構建 sql 語句的應用程式才會受影響。sql 語句通過字串的構造技術動態建立,文...

被動防SQL注入

call sql into check 呼叫ql防注入 2008 05 14 kz sql防注入 2008 05 14 kz sub sql into check dim sql injdata sql injdata and exec insert select delete update cou...