<small id="qqqqq"></small>
<tr id="qqqqq"></tr>
<tr id="qqqqq"></tr>
  • <tfoot id="qqqqq"></tfoot>
    <tfoot id="qqqqq"><noscript id="qqqqq"></noscript></tfoot>
    <small id="qqqqq"><blockquote id="qqqqq"></blockquote></small>
    <sup id="qqqqq"></sup><noscript id="qqqqq"><dd id="qqqqq"></dd></noscript>
    <tfoot id="qqqqq"><dd id="qqqqq"></dd></tfoot>
    <nav id="qqqqq"><code id="qqqqq"></code></nav>
    <sup id="qqqqq"><code id="qqqqq"></code></sup><noscript id="qqqqq"></noscript>
  • 日本不卡a不v免费高清,五月天无码视频在线,人妻有码字幕在线,久久久一本二本三本,色色综合久久鬼色,少妇人妻久久无码专区

     
    售房快車 售房客車 房屋租賃 牽線搭橋 供求信息 南陽人才網(wǎng) 文藝沙龍
     
    域名注冊 虛擬主機(jī) 云服務(wù)器 企業(yè)云郵箱 網(wǎng)站制作 網(wǎng)站推廣 無紙辦公 成功案例
       
    服務(wù)熱線:0377-63392646 13782137062
    虛擬主機(jī)  
    預(yù)防SQL注入漏洞函數(shù)-中國開網(wǎng)網(wǎng)絡(luò)學(xué)院
    · 網(wǎng) 絡(luò) 學(xué) 院
    ·友情鏈接 更多>>>
    標(biāo)題:預(yù)防SQL注入漏洞函數(shù)

     

    僅僅代表我的觀點.不怕見笑.有問題請大家指教!我想如果你是牛人,那這個已經(jīng)不是值得你看的內(nèi)容,只是覺得對與很多剛?cè)腴T的ASP程序員來說還是有點實際意義,所以不怕被大家笑話,寫了貼在這里!

     

    <%
    Function checkStr(str)

    if isnull(str) then

    checkStr = ""

    exit function

    end if

    checkStr=replace(str," ","")

    checkStr=replace(str,"'","'")

    checkStr=replace(str,";","'")

    checkStr=replace(str,"--","'")

    checkStr=replace(str,"(","'")

    checkStr=replace(str,"[","'")

    checkStr=replace(str,"$","'")

    end function

    %>


    相關(guān)函數(shù)
    Left(string, length)
     返回指定數(shù)目的從字符串的左邊算起的字符
     
    Asc(string)
     返回與字符串的第一個字母對應(yīng)的 ANSI 字符代碼。
     
    Mid(string, start[, length])
     從字符串中返回指定數(shù)目的字符。
     
    ***********************************
    我自己的做法是把字符串限定在8個字符內(nèi),呵!(千萬條數(shù)據(jù)啊,沒誰有這樣大的記錄吧?99,999,999呵!不夠用,才怪了!除非你的數(shù)據(jù)從來不更新刪出,那也沒辦法,問題是sql到了這樣的時會是怎么樣的速度)


    ---<%
    if len(request.querystring("ddd"))> 8 then
    response.write(黑我啊,不要了。少來)
    response.end '最好有這句

    '''初步是判斷是否是數(shù)字=======IsNumeric 函數(shù)
    if IsNumeric(request.querystring("ddd")) then

    Execute("select * from [table]")

    ....

    else

    response.write(黑我啊,不要了。少來)
    response.end '最好有這句

    %>

    當(dāng)然了,加上上面的函數(shù),在你的SQL過程里,效果就非常完美了!

    呵!!!在變態(tài)點做個函數(shù)。

    ---<%
    Function checkStr(str)

    if isnull(str) then

    checkStr = ""

    exit function

    end if

    checkStr=replace(str," ","")

    checkStr=replace(str,"'","'")

    checkStr=replace(str,";","'")

    checkStr=replace(str,"--","'")

    checkStr=replace(str,"(","'")

    checkStr=replace(str,"[","'")

    checkStr=replace(str,"$","'")

    checkStr=replace(str,"asc'," ")

    checkStr=replace(str,"mid"," ")

    checkStr=replace(str,"delete"," ")

    checkStr=replace(str,"drop"," ")

    '''呵!!我這里沒屏蔽select,count,哈!想起來我就笑,太變態(tài)了,那其不是我什么都不用了不是更更安全啊!!!呵!!~^)^~
    end function

    %>


    足夠了,這個函數(shù)加載到sql選取記錄集的地方。
    如:rsql="select * from table where xxx="&checkstr(request.querystring("xxyy"))&""
    或者來就判斷字符串

    說的有點林亂,但是就是這些了,對于普通的"黑客"已經(jīng)足夠他毫些時間了。但是對于老到的真正意義的黑客,這些都不是萬能的東西,人家連服務(wù)器都黑,你能怎么樣啊?嘿!!

    看了些資料,結(jié)合自己的經(jīng)驗,寫在這里。算是自己復(fù)習(xí)一下,看到的朋友也可以一起交流!

     

    點擊[4467]次  發(fā)布日期: 2007-3-26 21:40:20    發(fā)布人:中國開網(wǎng)
    :上一篇
      下一篇:

    返回首頁 |公司簡介 |開網(wǎng)招聘 |支付說明 |行業(yè)新聞 | 聯(lián)系方式 |客服中心| 相關(guān)咨詢|廣告服務(wù) |郵箱登錄

    豫公網(wǎng)安備 41130302000019號


    豫ICP備2024042951號

    南陽市開網(wǎng)網(wǎng)絡(luò)技術(shù)有限公司◎0377-63392646

    業(yè)務(wù)專線: 0377-63392646 1378217062

    總部地址: 河南省南陽市車站路146號新城百樂大廈13樓12室

    業(yè)務(wù)①Q(mào)Q:401853676 客服①Q(mào)Q:776288762 

    Email:xuejinfu@kyxxw.com  Copyright © 2023 中國開網(wǎng)◇版權(quán)所有

    中國開網(wǎng)旗下網(wǎng)站:
    信息版:digis.net.cn 
    網(wǎng)絡(luò)版:www.cnkw.cn
    成賣網(wǎng):www.cmai.cn
    PC手機(jī)微信APP小程序五合一網(wǎng)站
     
     
    日本不卡a不v免费高清
    <small id="qqqqq"></small>
    <tr id="qqqqq"></tr>
    <tr id="qqqqq"></tr>
  • <tfoot id="qqqqq"></tfoot>
    <tfoot id="qqqqq"><noscript id="qqqqq"></noscript></tfoot>
    <small id="qqqqq"><blockquote id="qqqqq"></blockquote></small>
    <sup id="qqqqq"></sup><noscript id="qqqqq"><dd id="qqqqq"></dd></noscript>
    <tfoot id="qqqqq"><dd id="qqqqq"></dd></tfoot>
    <nav id="qqqqq"><code id="qqqqq"></code></nav>
    <sup id="qqqqq"><code id="qqqqq"></code></sup><noscript id="qqqqq"></noscript>