CVE-2011-4107 PoC - phpMyAdmin Local File Inclusion via XXE injection

简介:   CVE-2011-4107 PoC - phpMyAdmin Local File Inclusion via XXE injection An interesting local...
 

CVE-2011-4107 PoC - phpMyAdmin Local File Inclusion via XXE injection

An interesting local file inclusion vulnerability has been recently published. An XXE (XML eXternal Entity) injection attack, which affects phpMyAdmin 3.4.x previous to 3.4.7.1 and 3.3.x previous to 3.3.10.5. - CVE-2011-4107

The issue is located in the libraries\import\xml.php file, where the simplexml_load_string() function is called without validating the existence of a reference to an external entity on the file:

$xml = simplexml_load_string($buffer, “SimpleXMLElement”, LIBXML_COMPACT);

Patched versions make use of the libxml_disable_entity_loader() PHP function before loading the XML document, in order to prevent the injection. libxml_disable_entity_loader() function disables the ability to load external entities.

phpMyAdmin offers the functionality of importing a database from a user-specified XML file. In vulnerable versions importing a specially-crafted XML file which contains an external XML entity permits an authenticated attacker to retrieve a local file from the server or network (limited by the privileges of the user running the web server).

It is well understood that the LOAD_FILE MySQL function could be used to gain read access to files in the database file system, however there are configurations where phpMyAdmin is installed on a different host than the database and therefore exploitation of this issue could become handy in penetration testing engagements.

SECFORCE has developed a metasploit module to assist the exploitation of this vulnerability. It is available for download from our security tools section on our website.

This module automates the process of local file inclusion in the following way:

  1. Logging in into phpMyAdmin using provided credentials.
  2. Crafting an XML using XXE with the given file to read.
  3. Uploading the XML
  4. Retrieving the file from the server or network (restricted by the privileges of the user running the web server ).

The module has the options shown in the following screenshot:


An example of a successful run of the module is presented in the screenshot below:

Example of a successful file read Example of successfully reading a file


Defining XML external entity (XXE) injection attack as part of XML injection vulnerability:

XML injection

XML Injection is when is is possible to change the values of an XML document and the XML parser fails to make an appropriate data validation this way making the injection possible.

XML external entity injection attack (XXE)

“External Entity: The set of valid entities can be extended by defining new entities. If the definition of an entity is a URI, the entity is called an external entity. Unless configured to do otherwise, external entities force the XML parser to access the resource specified by the URI, e.g., a file on the local machine or on a remote systems. This behavior exposes the application to XML eXternal Entity (XXE) attacks, which can be used to perform denial of service of the local system, gain unauthorized access to files on the local machine, scan remote machines, and perform denial of service of remote systems.” - (OWASP-DV-008)

XXE Example:

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE foo [
   <!ELEMENT foo ANY >
   <!ENTITY xxe SYSTEM "file:///c:/boot.ini" >]><foo>&xxe;</foo>

phpMyAdmin has released patched versions available for download from here.

目录
相关文章
|
26天前
[dvwa] file inclution
[dvwa] file inclution
|
26天前
|
安全 Linux Windows
[dvwa] Command Injection
[dvwa] Command Injection
|
8月前
|
Web App开发 移动开发 安全
WordPress插件wp-file-manager任意文件上传漏洞(CVE-2020-25213)
WordPress插件WPFileManager中存在一个严重的安全漏洞,攻击者可以在安装了此插件的任何WordPress网站上任意上传文件并远程代码执行。
279 1
|
SQL 安全 数据库
HMS v1.0 appointment.php editid参数 SQL注入漏洞(CVE-2022-25491)
HMS v1.0 appointment.php editid参数 SQL注入漏洞(CVE-2022-25491)
784 0
HMS v1.0 appointment.php editid参数 SQL注入漏洞(CVE-2022-25491)
|
Web App开发 安全 PHP
【DVWA】Web漏洞实战之File Upload
File Upload File Upload,即文件上传漏洞,一般的上传漏洞可能是未验证上传后缀 或者是验证上传后缀被bypass 或者是上传的文件验证了上传后缀但是文件名不重命名。 LOW 直接上传任意文件    MEDIUM  验证Content-Type,修改Content-Type为 image/jpeg直接绕过   HIGH 验证了后缀名、文件大小及限制了上传文件的文件头必须为图像类型。
1615 0
|
Linux PHP Apache
apache 提示You don't have permission to access /test.php on this server.怎样解决
原文:apache 提示You don't have permission to access /test.php on this server.怎样解决 关键字: Apache   403  Forbidden系统配置:操作系统:Red Hat Linux 6.2Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1数据库服务器:oracle 8i    Apache服务器是目前应用最多的web服务器,据统计在世界上的服务器中有超过一半采用Apache服务器.关于它的好处,您可以自己到http://www.apache.org/上去看。
1881 0
|
SQL 监控 安全
Zabbix SQL Injection/RCE – CVE-2013-5743
from:https://www.corelan.be/index.php/2013/10/04/zabbix-sql-injectionrce-cve-2013-5743/ 0x00 背景 该漏洞于2013年9月11号提交,9月23号得到确认,10月2号发布补丁。
897 0
|
PHP
Plesk PHP Code Injection
Reliable exploit for the Plesk PHP code injection vulnerability disclosed by Kingcope in June 2013.
918 0
SSRF pentest
https://docs.google.com/document/d/1v1TkWZtrhzRLy0bYXBcdLUedXGb9njTNIJXa3u9akHM/edit# ...
686 0