<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [https://cloud.tencent.com/developer/article/1036569](https://cloud.tencent.com/developer/article/1036569) PHP代碼審計工具大致上可以分為兩類: 1. 靜態自動化 2. 動態自動化 ## **靜態自動化** 靜態自動化其實是指通過對代碼進行靜態語義分析等步驟,最后輸出安全隱患的自動化工具,當然也有工具是通過正則匹配的方式來進行安全風險的發現。這一類常見的一個例子便是[RIPS](http://rips-scanner.sourceforge.net/),目前公開了源碼的版本可以在github上找到 ### **1、DVWA** [官網下載](http://www.dvwa.co.uk/) [github下載](https://github.com/ethicalhack3r/DVWA) DVWA必要配置: 修改DVWA\config\config.inc.php.dist到同級目錄,并重命名為config.inc.php 修改config.inc.php內容如下: ~~~ $_DVWA[ 'db_server' ] = '127.0.0.1'; $_DVWA[ 'db_user' ] = 'root'; $_DVWA[ 'db_password' ] = ''; $_DVWA[ 'recaptcha_public_key' ] = '6LdK7xITAAzzAAJQTfL7fu6I-0aPl8KHHieAT_yJg'; $_DVWA[ 'recaptcha_private_key' ] = '6LdK7xITAzzAAL_uw9YXVUOPoIHPZLfw2K1n5NVQ'; //可修改默認為最低幾倍方便入門 $_DVWA[ 'default_security_level' ] = 'low'; ~~~ 安裝之前一般需要修改php.ini的幾個默認配置 ~~~ #允許包含遠程文件 allow_url_fopen = On allow_url_include = On //如果php<=5.4配置允許進行SQL注入 safe_mode = off magic_quotes_gpc = off //可選:隱藏PHP警告消息以使其不再那么冗長 display_errors = off ~~~ sql注入在v5.26+不起作用,如果使用的是PHP v5.2.6或更高版本,則需要執行以下操作才能使SQL注入和其他漏洞起作用 在`.htaccess`中將 ~~~ <IfModule mod_php5.c> php_flag magic_quotes_gpc off #php_flag allow_url_fopen on #php_flag allow_url_include on </IfModule> ~~~ 替換成 ~~~ <IfModule mod_php5.c> magic_quotes_gpc = Off allow_url_fopen = On allow_url_include = On </IfModule> ~~~ 配置好以后訪問首頁點擊create/reset Database按鈕進行安裝 登錄賬戶: admin 密碼: password 將DVWA Security菜單中的安全級別改為low ![](https://img.kancloud.cn/2d/1e/2d1e5dec7e6c79defcada6a175641958_926x200.png) 注入測試 ``` http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=%27+union+select+user%2Cpassword+from+users%23&Submit=Submit ``` ``` http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=1'%20and(select%201%20from(select%20count(*),concat((select%20(select%20concat(0x7e,0x27,unhex(Hex(cast(database()%20as%20char))),0x27,0x7e))%20from%20information_schema.tables%20limit%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)%20and%20'1'='1&Submit=Submit# //sql解析為 1' and(select 1 from(select count(*),concat((select (select concat(0x7e,0x27,unhex(Hex(cast(database() as char))),0x27,0x7e)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and '1'='1 //0x7e是~的16進制, 0x27是'的16進制 //輸出: Duplicate entry '~'dvwa'~1' for key '' ``` **命令注入將不起作用?** ``` Apache可能沒有足夠高的特權來在Web服務器上運行命令。 如果您在Linux下運行DVWA,請確保以root用戶身份登錄。 在Windows下,以管理員身份登錄 ``` ***** ### [**2、ZVulDrill**](https://github.com/710leo/ZVulDrill) 除了RIPS外,還有一些開源了的工具,以及幫助我們進行語義分析的第三方庫: ### [**3、phpvulhunter**](https://github.com/OneSourceCat/phpvulhunter) ### [**4、Cobra-W**](https://github.com/LoRexxar/Cobra-W) ### [**5、PHP-Parser**](https://github.com/nikic/PHP-Parser) ### [**6、rips**](https://github.com/ripsscanner/rips) ### [**7、rips-scanner**](https://github.com/robocoder/rips-scanner) ### [**8、progpilot**](https://github.com/designsecurity/progpilot) ## **動態自動化** PHP中的動態自動化一般是通過PHP擴展,在底層完成對敏感函數的HOOK,在敏感函數調用時進行回溯的方法來進行代碼審計的,之所以稱為動態也有需要依賴于用戶操作的原因。這種方式的使用難度相較于靜態自動化會高一點,但是準確性能夠大大提高,幾個常見的工具有: [taint](https://github.com/laruence/taint) [prvd](https://github.com/fate0/prvd) [xmark](https://github.com/fate0/xmark) 其中taint或許不算是標準的代碼審計工具,但是借助taint,可以開發出優秀的PHP代碼審計工具,第二個推薦的prvd的部分實現與taint也是非常相似的。 上面推薦的工具中,有開箱即用的,也有輔助我們自行開發的,按需自用即可 php的[Taint模塊](https://www.php.net/manual/en/book.taint.php)
                  <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>

                              哎呀哎呀视频在线观看