自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

新手入門:防范SQL注入攻擊的新辦法

安全 應(yīng)用安全
以下的文章主要描述的是新手入門之防范SQL注入攻擊的好用辦法,在實際操作中可能會有會給用戶帶來不便,以下的文章就是相關(guān)破解方案的介紹。

此文章主要向大家描述的是正確防范SQL注入攻擊的好用方案,近段時間由于修改一個ASP程序(有SQL注入漏洞),在網(wǎng)上找了一些防范辦法,可執(zhí)行性都不咋地,所以我將現(xiàn)在網(wǎng)上的一些方法綜合改良了一下,寫出這個ASP函數(shù),供大家參考。

以下是引用片段:

  1. Function SafeRequest(ParaName)   
  2. Dim ParaValue   
  3. ParaValue=Request(ParaName)   
  4. if IsNumeric(ParaValue) = True then   
  5. SafeRequest=ParaValue   
  6. exit Function   
  7. elseIf Instr(LCase(ParaValue),"select ") > 0 or Instr(LCase(ParaValue),"insert ") 

     

    > 0 or Instr(LCase(ParaValue),"delete from") > 0 or Instr(LCase(ParaValue),"count(") 

     

    > 0 or Instr(LCase(ParaValue),"drop table") > 0 or Instr(LCase(ParaValue),"update ") 

     

    > 0 or Instr(LCase(ParaValue),"truncate ") > 0 or Instr(LCase(ParaValue),"asc(") > 0 

     

    or Instr(LCase(ParaValue),"mid(") 
    > 0 or Instr(LCase(ParaValue),"char(") > 0 or 

     

    Instr(LCase(ParaValue),"xp_cmdshell") 
    > 0 or Instr(LCase(ParaValue),"exec master") 

     

    > 0 or Instr(LCase(ParaValue),"net localgroup administrators") > 0 or Instr(LCase(ParaValue)," and ") 

     

    > 0 or Instr(LCase(ParaValue),"net user") > 0 or Instr(LCase(ParaValue)," or ") > 0 then   
  8. Response.Write "<script language='javascript'>"   
  9. Response.Write "alert('非法的請求!');" ' 

發(fā)現(xiàn)SQL注入攻擊提示信息

Response.Write "location.發(fā)現(xiàn)SQL注入攻擊轉(zhuǎn)跳網(wǎng)址

 

  1. Response.Write "<script>"   
  2. Response.end   
  3. else   
  4. SafeRequest=ParaValue   
  5. End If   
  6. End function  

使用SafeRequest函

上述的相關(guān)內(nèi)容就是對新手入門:防范SQL注入攻擊的新辦法

 

的描述,希望會給你帶來一些幫助在此方面。

 

【編輯推薦】

  1. 防止SQL注入攻擊:網(wǎng)絡(luò)管理員的前景展望
  2. ScanSafe:近期3波SQL注入攻擊100萬中國網(wǎng)站
  3. 圖文詳解網(wǎng)站SQL注入攻擊解決全過程
  4. 有效預(yù)防SQL注入攻擊的六脈神劍
  5. 防止SQL注入攻擊:網(wǎng)絡(luò)管理員的前景展望

     

     
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2013-12-24 10:04:01

PostgreSQL

2011-02-21 17:51:39

Zimbra入門新手

2010-09-08 13:31:24

2011-03-22 11:06:52

Nagios安裝

2011-01-10 14:36:00

新手linux基礎(chǔ)

2011-05-31 16:47:47

SEO

2024-10-12 10:57:21

2010-06-23 15:00:50

Fix協(xié)議

2010-09-09 13:40:19

XML DOM

2012-12-19 10:36:06

2010-05-28 18:22:51

MySQL基本操作

2011-03-04 17:35:16

2010-06-21 15:27:38

Linux apt-g

2011-06-30 17:41:46

SEO

2010-06-19 13:47:39

AMF協(xié)議

2009-07-16 09:07:46

Linux使用技巧Linux入門Linux開發(fā)

2010-05-14 18:31:17

MySQL 定時數(shù)據(jù)備

2010-05-17 09:52:55

虛擬化VMware Play

2010-06-10 10:31:36

MySQL出錯代碼列表

2009-03-19 09:24:50

XML標(biāo)記XML結(jié)構(gòu)XML入門
點贊
收藏

51CTO技術(shù)棧公眾號