博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CVE-2011-4107 PoC - phpMyAdmin Local File Inclusion via XXE injection
阅读量:2436 次
发布时间:2019-05-10

本文共 3077 字,大约阅读时间需要 10 分钟。

 

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

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  PHP function before loading the XML document, in order to prevent the injection.  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 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 engagements.

SECFORCE has developed a metasploit module to assist the exploitation of this vulnerability. It is available for download from our  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.” - ()

XXE Example:

]>
&xxe;

phpMyAdmin has released patched versions available for download from .

转载地址:http://ejhmb.baihongyu.com/

你可能感兴趣的文章
限制只能中文输入的方法(转)
查看>>
MySQL进阶SELECT篇(转)
查看>>
SQL Server中死锁产生的原因及解决办法(转)
查看>>
南阳铁通推出宽带“网吧式”服务(转)
查看>>
共享池 shared pool
查看>>
一张图搞定Java面向对象
查看>>
DOORS需求管理工具的其他资料
查看>>
使用 Rational RequisitePro 进行需求管理的新技术
查看>>
最新解决方案助力Borland ALM亚太应用
查看>>
Borland ALM之需求定义和管理解决方案
查看>>
需求管理详解
查看>>
Verizon选择Borland控制开发流程并降低风险
查看>>
Borland 崭新的Caliber Define IT产品
查看>>
IBM Rational RequisitePro集成简介
查看>>
集成 IBM Rational RequisitePro 与 IBM Rational Portfolio Manager
查看>>
OOAD利器Rational Rose的介绍
查看>>
SCA客户端以及基于Java的模型实现(一)
查看>>
后CMMI时代的软件过程改进
查看>>
SCA及未来软件系统的开发
查看>>
CaliberRM 需求管理系统
查看>>