您现在的位置是:网站首页> 编程资料编程资料
Kindeditor特定情况可能会导致全盘浏览的漏洞_漏洞分析_网络安全_
2023-05-24
551人已围观
简介 Kindeditor特定情况可能会导致全盘浏览的漏洞_漏洞分析_网络安全_
因为例子很少,开始想了下不是他们的漏洞,后面想了下,后面没有检查好用户的正常配置内容导致,还是提下吧。
下载地址:
貌似是最新版本的。
测试语言:PHP
测试漏洞文件:/kindeditor/php/file_manager_json.php
默认配置(第16行):
$root_path = $php_path . '../attached/';
当/attached/文件夹不存在(被删)或者被改名为一个不存在的目录时,如网上的一个例子:
$root_path = $php_path . '../../../upload/';
这个CMS下面的目录根本就没得这个目录,所以就造成了漏洞。
怎么造成了漏洞的呢?我们分析下。
下载地址:
貌似是最新版本的。
测试语言:PHP
测试漏洞文件:/kindeditor/php/file_manager_json.php
默认配置(第16行):
$root_path = $php_path . '../attached/';
当/attached/文件夹不存在(被删)或者被改名为一个不存在的目录时,如网上的一个例子:
$root_path = $php_path . '../../../upload/';
这个CMS下面的目录根本就没得这个目录,所以就造成了漏洞。
怎么造成了漏洞的呢?我们分析下。
PHP Code复制内容到剪贴板
- /**
- * KindEditor PHP
- *
- * 本PHP程序是演示程序,建议不要直接在实际项目中使用。
- * 如果您确定直接使用本程序,使用之前请仔细确认相关安全设置。
- *
- */
- require_once 'JSON.php';
- $php_path = dirname(__FILE__) . '/';
- $php_url = dirname($_SERVER['PHP_SELF']) . '/';
- //根目录路径,可以指定绝对路径,比如 /var/www/attached/
- $root_path = $php_path . '../../../upload/';
- //根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
- $root_url = $php_url . '../../../upload/';
- //图片扩展名
- $ext_arr = array('gif', 'jpg', 'jpeg', 'png', 'bmp');
- //目录名
- $dir_name = emptyempty($_GET['dir']) ? '' : trim($_GET['dir']);
- if (!in_array($dir_name, array('', 'image', 'flash', 'media', 'file'))) {
- echo "Invalid Directory name.";
- exit;
- }
- if ($dir_name !== '') {
- $root_path .= $dir_name . "/";
- $root_url .= $dir_name . "/";
- if (!file_exists($root_path)) {
- mkdir($root_path);
- }
- }
- //根据path参数,设置各路径和URL
- if (emptyempty($_GET['path'])) {
- $current_path = realpath($root_path) . '/';
- $current_url = $root_url;
- $current_dir_path = '';
- $moveup_dir_path = '';
- } else {
- $current_path = realpath($root_path) . '/' . $_GET['path'];
- $current_url = $root_url . $_GET['path'];
- $current_dir_path = $_GET['path'];
- $moveup_dir_path = preg_replace('/(.*?)[^\/]+\/$/', '$1', $current_dir_path);
- }
- //echo realpath($root_path);
- //排序形式,name or size or type
- $order = emptyempty($_GET['order']) ? 'name' : strtolower($_GET['order']);
- //不允许使用..移动到上一级目录
- if (preg_match('/\.\./', $current_path)) {
- echo 'Access is not allowed.';
- exit;
- }
- //最后一个字符不是/
- if (!preg_match('/\/$/', $current_path)) {
- echo 'Parameter is not valid.';
- exit;
- }
- //目录不存在或不是目录
- if (!file_exists($current_path) || !is_dir($current_path)) {
- echo 'Directory does not exist.';
- exit;
- }
- //遍历目录取得文件信息
- $file_list = array();
- if ($handle = opendir($current_path)) {
- $
相关内容
- Kindeditor遍历目录0DAY问题_漏洞分析_网络安全_
- 历史悠久的3个经典网站安全漏洞介绍_漏洞分析_网络安全_
- WordPress 4.0以下版本存在跨站脚本漏洞_漏洞分析_网络安全_
- 服务器上网站被挂Iframe木马的解决方法_漏洞分析_网络安全_
- LoveCMS 1.6.2 Final Update Settings Remote Exploit _Exploit_网络安全_
- Discuz! 6.0.1 (searchid) Remote SQL Injection Exploit _Exploit_网络安全_
- Sun xVM VirtualBox _Exploit_网络安全_
- BlazeDVD 5.0 PLF Playlist File Remote Buffer Overflow Exploit _Exploit_网络安全_
- Download Accelerator Plus - DAP 8.6 (AniGIF.ocx) Buffer Overflow PoC _Exploit_网络安全_
- Belkin wireless G router ADSL2 modem Auth Bypass Exploit _Exploit_网络安全_
点击排行
本栏推荐
