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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mybatis如何防止SQL隱碼攻擊MyBatisSQL
- SQL隱碼攻擊SQL
- SQL隱碼攻擊(pikachu)SQL
- SQL隱碼攻擊方法SQL
- MYSQL SQL隱碼攻擊MySql
- SQL隱碼攻擊原理是什麼?如何防範SQL隱碼攻擊?SQL
- SQL隱碼攻擊速查表(上)SQL
- 攻擊JavaWeb應用[4]-SQL隱碼攻擊[2]JavaWebSQL
- 攻擊JavaWeb應用[3]-SQL隱碼攻擊[1]JavaWebSQL
- 防止web專案中的SQL隱碼攻擊MUHEWebSQL
- 在Linux中,如何檢測和防止SQL隱碼攻擊和跨站指令碼(XSS)攻擊?LinuxSQL指令碼
- SQL隱碼攻擊導圖SQL
- SQL隱碼攻擊語句SQL
- pikachu-SQL隱碼攻擊SQL
- SQL隱碼攻擊總結SQL
- XSS與SQL隱碼攻擊SQL
- 如何防止SQL隱碼攻擊?網路安全防禦方法SQL
- WEB三大攻擊之—SQL隱碼攻擊與防護WebSQL
- 【網路安全】什麼是SQL隱碼攻擊漏洞?SQL隱碼攻擊的特點!SQL
- 預編譯SQL為什麼能夠防止SQL隱碼攻擊編譯SQL
- DVWA-SQL Injection(SQL隱碼攻擊)SQL
- SQL隱碼攻擊關聯分析SQL
- Nacos Derby SQL隱碼攻擊漏洞SQL
- MSSQL SQL隱碼攻擊 總結SQL
- Oracle SQL隱碼攻擊 總結OracleSQL
- SQL隱碼攻擊-堆疊注入SQL
- SQL隱碼攻擊基礎原理SQL
- 【網路安全入門】SQL隱碼攻擊是什麼?SQL隱碼攻擊危害有哪些?SQL
- Akamai:65.1%的Web應用程式攻擊來自SQL隱碼攻擊AIWebSQL
- 什麼是SQL隱碼攻擊(SQLi)SQL
- SQL隱碼攻擊讀寫檔案SQL
- Mura CMS processAsyncObject SQL隱碼攻擊漏洞ObjectSQL
- 預防SQL隱碼攻擊筆記SQL筆記
- SQL隱碼攻擊——時間盲注SQL
- SQL隱碼攻擊基礎入門SQL
- 前端如何預防SQL隱碼攻擊?前端SQL
- SQL隱碼攻擊:Sqlmap初體驗SQL
- SQL隱碼攻擊及如何解決SQL
- SQL隱碼攻擊個人小記(以MySQL為例)MySql