参考joolma的mvc框架讲解:http://www.360doc.com/content/11/1219/18/1372409_173441270.shtml

从这个页面开始下断点:Joomla_3.7.0/components/com_fields/controller.php

调用父类的构造方法

继续跟:/Applications/MAMP/htdocs/Joomla_3.7.0/libraries/legacy/controller/legacy.php

-------分割线-------

跟进函数,位于/Joomla_3.7.0/libraries/legacy/model/legacy.php

在这里调用第一个的get()函数 $this->state = $this->get('State');

跟进以后构造成模块也就是 getState($property = null, $default = null) 函数

$this->populateState();

遇到这个继续跟进

位于 /Joomla_3.7.0/administrator/components/com_fields/models/fields.php    p73-89

protected function populateState($ordering = null, $direction = null)

可以看到这里有调用了父类populateState方法,我们跟进到父类
parent::populateState('a.ordering', 'asc');
继续跟进

位于/Joomla_3.7.0/libraries/legacy/model/list.php 

跟进getUserStateFromRequest()函数

/Applications/MAMP/htdocs/Joomla_3.7.0/libraries/cms/application/cms.php

这里的$request=list  $key=com_fields.fields  继续跟进$cur_state = $this->getUserState($key, $default);

这里的$key是等于com_fields.fields.list

经过一系列for循环

$cur_state的值变成了注入payload。

返回$list的值

位于 /Applications/MAMP/htdocs/Joomla_3.7.0/libraries/legacy/model/list.php   第495-570行 

第566行:

跟进setState函数

这时候就设定了list.fullordering的值。

接着看第二个$this->items = $this->get('Items');

走get函数,执行了getItems()

 

跟进getItems()  位于 /Joomla_3.7.0/libraries/legacy/model/list.php   第172-186行

可以看到执行了_getListQuery()  函数,位于同一目录下。

然后执行getListQuery() 函数,位于/Joomla_3.7.0/administrator/components/com_fields/models/fields.php  第124-328行

执行到305行

取list.fullordering的值,我们在前面$this->state = $this->get('State');  操作中,已经把$this->state = $this->get('State');设成了sql语句的值。

赋值给$listOrdering,然后进入order查询。

就这样产生注入了。

后记。模模糊糊跟着函数看了大半天的参考文章,才写成的,对于joolma这种大程序,函数那么多还是容易犯迷糊,最后经过指点,用phpstorm看调用堆栈就有过程,然后慢慢回溯回去,才有了这篇文章。

参考:http://bobao.360.cn/learning/detail/3870.html

poc:index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x3a,concat(1,(select%20md5(1))),1)

最新文章

  1. Day23_IO第五天
  2. 一种扩大View点击范围的方法
  3. BarManager.ContextMenu
  4. TCP 滑动窗口的简介
  5. Qt中的多线程编程
  6. Monkey Test
  7. wordpress教程之修改上传文件大小限制
  8. windows平台vhd磁盘文件挂载
  9. Qt学习之路:自定义Model三篇,自定义委托等等
  10. Git 删除文件
  11. angularJS 系列(二)——理解指令 understanding directives
  12. ListView的使用(一)
  13. Python删除list中多个相同元素
  14. 解决UIScrollView,UIImageView等控件不能响应touch事件的问题
  15. layabox typescript 安装固定版本
  16. 转*SqlSever查询某个表的列名称、说明、备注、注释,类型等
  17. PHP中Snoopy类的使用
  18. WEKA结果解读
  19. 走进windows编程的世界-----消息处理函数(1)
  20. pythonweb框架Flask学习笔记02-一个简单的小程序

热门文章

  1. ConcurrentHashMap 源码分析
  2. input输入框限制输入正整数、小数、字母、文字
  3. 使用 win10 的正确姿势 (第二版)
  4. Elasticsearch安装详解
  5. Beta Scrum
  6. Node.js系列文章:编写自己的命令行界面程序(CLI)
  7. MobileNet_v2
  8. Android广播发送失败
  9. Appium+python测试app实例
  10. Ansible性能调优