<thead id="jxdzp"><address id="jxdzp"><pre id="jxdzp"></pre></address></thead>

<em id="jxdzp"><span id="jxdzp"></span></em>

    <listing id="jxdzp"><nobr id="jxdzp"><meter id="jxdzp"></meter></nobr></listing>

      <address id="jxdzp"></address>
      <noframes id="jxdzp"><form id="jxdzp"><th id="jxdzp"></th></form>
      <noframes id="jxdzp"><form id="jxdzp"><th id="jxdzp"></th></form>

          訂閱本欄目 RSS您所在的位置: 深山工作室 > ASP > 正文

          兩個ASP中防止SQL注入式攻擊

          深山工作室 2014/5/20 14:23:47 深山 字體: 瀏覽 4594
          兩個ASP中防止SQL注入式攻擊 
          <%
          '==========================
          '過濾提交表單中的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("<div>")
          response.write("你所填寫的信息:" & server.HTMLEncode(request.Form(items)) & "<br>含非法字符:" & nothis(i))
          response.write("</div>")
          response.write("對不起,你所填寫的信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>")
          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 "查詢信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>"
          response.end
          end if
          end function
          %>
          相關閱讀
          Dreamweaver錯誤:在onload運行_beforeSave.htm時,發生了一個JavaScript錯誤
          有利于搜索引擎的一些常用的CSS命名規則
          SEO工具讓你網站憂化更加隨心所欲
          2012-3-22中午的一件電話事件(一個不懂怎么定義的電話)(備份)
          針對table,div隔行變色的JS方法
          詳談CSS設計中import與link的區別所在
          IE6下用CSS使PNG半透明背景圖片效果
          利用background-color:#000000a8在背景顏色16進制代碼之后加字母加上數字讓背景色透明
          共有0條關于《兩個ASP中防止SQL注入式攻擊》的評論
          發表評論
          正在加載評論......
          返回頂部發表評論
          呢 稱:
          表 情:
          內 容:
          評論內容:不能超過 1000 字,需審核,請自覺遵守互聯網相關政策法規。
          驗證碼: 驗證碼 
          網友評論聲明,請自覺遵守互聯網相關政策法規。

          您發布的評論即表示同意遵守以下條款:
          一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權益;
          二、不得發布國家法律、法規明令禁止的內容;互相尊重,對自己在本站的言論和行為負責;
          三、本站對您所發布內容擁有處置權。

          更多信息>>欄目類別選擇
          百度小程序開發
          微信小程序開發
          微信公眾號開發
          uni-app
          asp函數庫
          ASP
          DIV+CSS
          HTML
          python
          更多>>同類信息
          ASP中Utf-8與Gb2312編碼轉換亂碼問題的解決方法頁面編碼聲明
          asp顯示隨機密碼
          通過阿里云服務接口獲得ip地址詳細信息
          iis點開后任務欄上有顯示,但是窗口看不到的解決辦法
          RSA加密解密插件
          微軟Encoder加密解密函數
          更多>>最新添加文章
          dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
          Android移動端自動化測試:使用UIAutomatorViewer與Selenium定位元素
          抖音直播音掛載小雪花 懂車帝小程序
          javascript獲取瀏覽器指紋可以用來做投票
          火狐Mozilla Firefox出現:無法載入您的Firefox配置文件 它可能已經丟失 或是無法訪問 問題解決集合處理辦法
          在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
          python通過代碼修改pip下載源讓下載庫飛起
          python里面requests.post返回的res.text還有其它的嗎
          更多>>隨機抽取信息
          昆山旅游網
          縮寫精簡不必要的css定義代碼來實現控制網頁文件大小
          uni-app與HTML的標簽變化對比
          javascript表單驗證!
          CSS語法在DW中無效的解決方法
          做在線客服時,聊天窗口的div滾動條始終在底部
          88国产精品视频一区二区三区