网站地图    收藏   

主页 > 后端 > 网站安全 >

Drupal 7.14 <= 完全路径泄露 - 网站安全 - 自学p

来源:自学PHP网    时间:2015-04-17 13:03 作者: 阅读:

[导读] Drupal 7.14 = Full Path Disclosure VulnerabilityAbout Drupal:Drupal is an open source content management platform powering millions of websites andapplications. It#39;s bui......

Drupal 7.14 <= Full Path Disclosure Vulnerability
 About Drupal:

"Drupal is an open source content management platform powering millions of websites and
applications. It's built, used, and supported by an active and diverse community of people
around the world."

Drupal is used by common companies like Ing/Diba, Amnesty International and The White House.

 Issue: Full Path Disclosure

风险等级: Medium

The remote attacker has the possibility to detect the full local path of drupal.
This information can be used for processing further attacks against the server.

In includes/bootstrap.inc, line 2695:

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

function request_path() {
static $path;

if (isset($path)) {
return $path;
}

if (isset($_GET['q'])) {
// This is a request with a ?q=foo/bar query string. $_GET['q'] is
// overwritten in drupal_path_initialize(), but request_path() is called
// very early in the bootstrap process, so the original value is saved in
// $path and returned in later calls.
$path = $_GET['q'];
}
elseif (isset($_SERVER['REQUEST_URI'])) {
// This request is either a clean URL, or 'index.php', or nonsense.
// Extract the path from REQUEST_URI.
$request_path = strtok($_SERVER['REQUEST_URI'], '?');
$base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/'));
// Unescape and strip $base_path prefix, leaving q without a leading slash.
$path = substr(urldecode($request_path), $base_path_len + 1);
// If the path equals the script filename, either because 'index.php' was
// explicitly provided in the URL, or because the server added it to
// $_SERVER['REQUEST_URI'] even when it wasn't provided in the URL (some
// versions of Microsoft IIS do this), the front page should be served.
if ($path == basename($_SERVER['PHP_SELF'])) {
$path = '';
}
}
else {
// This is the front page.
$path = ''; www.2cto.com
}

// Under certain conditions Apache's RewriteRule directive prepends the value
// assigned to $_GET['q'] with a slash. Moreover we can always have a trailing
// slash in place, hence we need to normalize $_GET['q'].
$path = trim($path, '/');

return $path;
}

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

Exploit / Proof Of Concept:

http://www.2cto.com /?q[]=x

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

修复方案:
Search for:

$path = trim($path, '/');

And add the following line above:

if(is_array($path)) { die(); }

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

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论