Lucene search

K
seebugRootSSV:60769
HistoryApr 28, 2013 - 12:00 a.m.

phpMyAdmin preg_replace()远程PHP代码执行

2013-04-2800:00:00
Root
www.seebug.org
45

EPSS

0.973

Percentile

99.9%

BUGTRAQ ID: 59460
CVE(CAN) ID: CVE-2013-3238

phpmyadmin是MySQL数据库的在线管理工具,主要功能包括在线创建数据表、运行SQL语句、搜索查询数据以及导入导出数据等。

phpMyAdmin 3.5.8、4.0.0-rc2及其他版本的preg_replace()函数可被利用在服务器端执行任意PHP代码,攻击者用特制参数作为常规表达式,在此表达式内包含空字节,当phpMyAdmin使用"Replace table prefix"功能时,会错误地过滤传递到preg_replace()的特制参数。导致在Web服务器上下文中执行任意PHP代码。
0
phpMyAdmin < 3.5.8.1


                                                Tests:
 
1. Log in to PMA and select database:
 
http://localhost/PMA/index.php?db=test&token=25a6ce9e288070bd28c3f9aebffad1b8
 
2. select one table from database by using checkbox and then select 
"Replace table prefix" from select control "With selected:".
 
3. We can see form named "Replace table prefix:" with two input fields.
Type "/e%00" to the "From" field and "phpinfo()" to the "To" field.
 
4. Activate Tamper Data Firefox add-on:
 
https://addons.mozilla.org/en-us/firefox/addon/tamper-data/
 
5. Click "Submit", Tamper Data pops up, choose "Tamper".
 
6. Now we can modify POST request. Look for parameter "from_prefix".
It should be "%2Fe%2500", remove "25", so that it becomes "%2Fe%00".
Click "OK" and Firefox will send out manipulated POST request.
 
7. We are greeted by phpinfo function output - code execution is confirmed.