sql注入利用group_concat函数

1.group_concat函数的作用:

首先根据group by指定的列进行分组,将同一组的列显示出来,并且用分隔符分隔。

2.group_concat运用

这里我使用的是sqllab-less1,通过对数据库的查询,我们发现数据库表名,列名,等数据在information_schema数据库中。

就可以通过以下语句注入

复制代码
?id=-1' union select 1,2,table_name from information_schema.tables where table_schema='security'--+

但是这样只能回显某一个表,这时就可以使用group_concat函数把security的每一个表回显出来

同理可以查询列名。

当库名、表名、列名都查到了之后,选择最有用的回显出来就成功的注入了。

这里我们选择users表回显出用户名username和密码password。

复制代码
?id=-1' union select 1,group_concat(username,0x3e,password),3 from users--+

当然这是最简单的注入。

相关推荐
柒.梧.几秒前
从原理到实战:Spring AOP全解析
数据库·sql
山峰哥4 分钟前
SQL优化中的索引策略与Explain分析实战
大数据·汇编·数据库·sql·编辑器
galaxyffang10 分钟前
Redis 的 16 个数据库应用场景
数据库·redis·缓存
喜欢猪猪10 分钟前
深度解析 SGLang:大模型编程新范式——从 Prompt Engineering 到 Structured Generation 的系统性跃迁
java·数据库·prompt
·云扬·15 分钟前
利用Orchestrator Hook实现MySQL高可用切换与VIP管理
android·数据库·mysql
shdwak....sad44 分钟前
DeepAudit AI多智能体代码审计项目学习与解读(一)
人工智能·安全
小鸡脚来咯1 小时前
MySQL索引优化
sql·mysql
YIN_尹2 小时前
【MySQL】数据库基础
数据库·mysql·adb
秃狼2 小时前
mysql explain 使用入门
数据库·mysql
冰暮流星2 小时前
数据库事务四个特性
数据库