天天看點

phpMyAdmin setup.php腳本的任意PHP代碼注入漏洞phpMyAdmin (/scripts/setup.php) PHP 注入代碼PhpMyAdmin setup.php RFI Attacks Detected

  此漏洞代碼在以下環境測試通過:

      phpMyAdmin 2.11.4, 2.11.9.3, 2.11.9.4, 3.0.0 及 3.0.1.1版本;

      Linux核心版本 2.6.24-24-generic i686 GNU/Linux (Ubuntu 8.04.2);

      攻擊環境要求:

      phpMyAdmin版本:早于2.11.9.5的2.11.x和早于3.1.3.1的3.x;

      此漏洞隻針對采用向導模式安裝的phpMyAdmin有效,而對采用手動安裝的無效;

      管理者必須未删除"/phpMyAdmin/"目錄下的"/config/"子目錄,因為"/scripts/setup.php"嘗試建立的下面PHP代碼注入的"config.inc.php"檔案正是在這個子目錄下。

http://www.cfresh.net/web-security/179

-----------------------------------------------------------------------------------------

受影響系統:

phpMyAdmin phpMyAdmin 3.x

phpMyAdmin phpMyAdmin 2.11.x

不受影響系統:

phpMyAdmin phpMyAdmin 3.1.3.1

phpMyAdmin phpMyAdmin 2.11.9.5

描述:

phpMyAdmin是用PHP編寫的工具,用于通過WEB管理MySQL。

phpMyAdmin的Setup腳本用于生成配置。如果遠端攻擊者向該腳本送出了特制的POST請求的話,就可能在生成的config.inc.php配置檔案中包含任意PHP代碼。由于配置檔案被儲存到了伺服器上,未經認證的遠端攻擊者可以利用這個漏洞執行任意PHP代碼。

廠商更新檔:

目前廠商已經釋出了更新更新檔以修複這個安全問題,請到廠商的首頁下載下傳:

http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin?view=rev&revision=12301

---------------------------------------------------------------------

SpiderLabs is the corporate sponsor of the WASC Distributed Web Honeypots Project which is an awesome research project to identify automated web attacks. I was looking in our central ModSecurity AuditConsolelogging host today and I noticed a spike in traffic from some Russian IPs that were scanning for the PMASA-2010-4 vulnerability in the PhpMyAdmin setup.php script.

phpMyAdmin setup.php腳本的任意PHP代碼注入漏洞phpMyAdmin (/scripts/setup.php) PHP 注入代碼PhpMyAdmin setup.php RFI Attacks Detected

    Let's look at the raw ModSecurity audit log data of the inbound request:

    If we URL decode the request body data, we get this:

    As you can see, the attacker is attempting overwrite the PhpMyAdmin configuration file by instructing it to use FTP to download and run the "id.txt" file on a remote site. The contents of the id.txt file is PHP code:

    Looking at what this file is doing, it appears to be a simple probe to identify if the target web application is vulnerable to this type of RFI attack. If the application responds with the output from these PHP commands, then the attacker will proceed with other attacks. SpiderLabs Research was able to find the following script. in public forums that launch similar attacks:

    This issue was patched in the php source code with the following update:

phpMyAdmin setup.php腳本的任意PHP代碼注入漏洞phpMyAdmin (/scripts/setup.php) PHP 注入代碼PhpMyAdmin setup.php RFI Attacks Detected

    By filtering out non-word characters, it would prevent the attacker from injecting the RFI code

如何聯系我:【萬裡虎】www.bravetiger.cn

【QQ】3396726884 (咨詢問題100元起,幫助解決問題500元起)

【部落格】http://www.cnblogs.com/kenshinobiy/