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--+

当然这是最简单的注入。

相关推荐
snow@li5 小时前
数据库:市场中都有哪些数据库 / 优缺点 使用情况
数据库
NoSi EFUL5 小时前
MySQL中ON DUPLICATE KEY UPDATE的介绍与使用、批量更新、存在即更新不存在则插入
android·数据库·mysql
河阿里6 小时前
SQL数据库:五大范式(NF)
数据库·sql·oracle
云安全助手6 小时前
弹性云服务器+高防IP:让DDoS攻击不再是业务“生死劫”
运维·网络·安全
l1t7 小时前
DeepSeek总结的PostgreSQL 19查询提示功能
数据库·postgresql
chenxu98b8 小时前
MySQL如何执行.sql 文件:详细教学指南
数据库·mysql
刘晨鑫18 小时前
MongoDB数据库应用
数据库·mongodb
梦想的颜色9 小时前
mongoTemplate + Java 增删改查基础介绍
数据结构·数据库·mysql
kang0x09 小时前
easyRSA - Writeup by AI
安全
小小小米粒10 小时前
redis命令集合
数据库·redis·缓存