ASP上兩個防止SQL隱碼攻擊式攻擊Function
過濾提交表單中的SQL
過濾查詢中的SQL
[@more@]''==========================
''過濾提交表單中的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("
response.write("你所填寫的資訊:" & server.HTMLEncode(request.Form(items)) & "
含非法字元:" & nothis(i))
response.write("
response.write("對不起,你所填寫的資訊含非法字元!返回")
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 "查詢資訊含非法字元!返回"
response.end
end if
end function
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/310974/viewspace-810096/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 六個建議防止SQL隱碼攻擊式攻擊SQL
- 防止SQL隱碼攻擊SQL
- Mybatis如何防止SQL隱碼攻擊MyBatisSQL
- SQL隱碼攻擊式攻擊掃描器SQL
- SQL隱碼攻擊SQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊-防衛SQL隱碼攻擊-顯式格式化模型SQL模型
- PHP中該怎樣防止SQL隱碼攻擊?PHPSQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊-SQL隱碼攻擊技術-語句注入SQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊-SQL隱碼攻擊技術-語句修改SQL
- MYSQL SQL隱碼攻擊MySql
- 【SQL隱碼攻擊原理】SQL
- SQL隱碼攻擊(一)SQL
- SQL隱碼攻擊速查表(上)SQL
- 【SQL Server】--SQL隱碼攻擊SQLServer
- 攻擊JavaWeb應用[3]-SQL隱碼攻擊[1]JavaWebSQL
- 攻擊JavaWeb應用[4]-SQL隱碼攻擊[2]JavaWebSQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊SQL
- SQL隱碼攻擊原理是什麼?如何防範SQL隱碼攻擊?SQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊-防衛SQL隱碼攻擊-驗證檢查SQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊-防衛SQL隱碼攻擊-繫結變數SQL變數
- 防止web專案中的SQL隱碼攻擊MUHEWebSQL
- 怎樣在網站中防止SQL隱碼攻擊?網站SQL
- 反恐精英之動態SQL和SQL隱碼攻擊-SQL隱碼攻擊-SQL隱碼攻擊技術-資料型別轉換SQL資料型別
- SQL隱碼攻擊語句SQL
- pikachu-SQL隱碼攻擊SQL
- SQL隱碼攻擊導圖SQL
- SQL隱碼攻擊問題SQL
- SQL隱碼攻擊的例子SQL
- ZMLCMS-SQL隱碼攻擊SQL
- SQL隱碼攻擊演練SQL
- 預防SQL隱碼攻擊SQL
- 修復SQL隱碼攻擊漏洞 兩種方法SQL
- 如何防止SQL隱碼攻擊?網路安全防禦方法SQL
- WEB三大攻擊之—SQL隱碼攻擊與防護WebSQL
- 【網路安全】什麼是SQL隱碼攻擊漏洞?SQL隱碼攻擊的特點!SQL
- 在Linux中,如何檢測和防止SQL隱碼攻擊和跨站指令碼(XSS)攻擊?LinuxSQL指令碼
- DVWA-SQL Injection(SQL隱碼攻擊)SQL
- SQL隱碼攻擊關聯分析SQL