当前位置:网站首页>[CISCN2019 华东南赛区]Web11
[CISCN2019 华东南赛区]Web11
2022-08-05 03:52:00 【pakho_C】
[CISCN2019 华东南赛区]Web11
头一次见smarty ssti的题
smart ssti:
smart是php的模板引擎,模板引擎的作用就是分离前端页面和数据的,题目中显示API的URL由于环境的原因无法使用,但我们的IP依旧显示在了页面的右上角,且根据它的提示XFF我们很容易想到,在X-Forwarded-For里构造ssti:payload。
又祭出这张图了:
根据页面的提示,很可能要在XFF头中构造:
测试:
确实存在smarty ssti
看了另一位师傅的wp:
Smarty支持使用{php}{/php}标签来执行被包裹其中的php指令,那么我们可以使用{php}{/php}标签来构造payload,但是本题会报错
因为现在的smart已经不用此标签了。
可以用{$smarty.version}来看一下版本。
测试了一下,的确如此

这个版本已经不支持php标签了
虽然php标签不能用,但是还有个{if}标签。 Smarty的{if}条件判断和PHP的if
非常相似,只是增加了一些特性。每个{if}必须有一个配对的{/if}. 也可以使用{else} 和 {elseif}.
全部的PHP条件表达式和函数都可以在if内使用,如*||*,or,&&,and,is_array(), 等等既然全部的PHP条件表达式和函数都可以在if内使用,那我们在里面写php代码也行。 {if phpinfo()}{/if}
执行 {if phpinfo()}{/if}尝试
成功回显
直接执行命令:{if system('cat /flag')}{/if}
原理介绍,参考另一位师傅的wp里的:
<?php
require_once('./smarty/libs/' . 'Smarty.class.php');
$smarty = new Smarty();
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
//获取XFF
$smarty->display("string:".$ip);
//此处并不是以smart模板格式,而是以字符串形式,所以会解析我们的标签,也就是if,解析后把内容回显到页面上的相应位置
}
边栏推荐
- Android interview question - how to write with his hands a non-blocking thread safe queue ConcurrentLinkedQueue?
- ffmpeg 像素格式基础知识
- Android Practical Development - Kotlin Tutorial (Introduction - Login Function Implementation 3.3)
- 惨遭打脸:字节某部门竟有这么多测试员
- Fifteen. Actual combat - MySQL database building table character set and collation
- UE4 opens doors with overlapping events
- 炎炎夏日教你利用小米智能家居配件+树莓派4接入Apple HomeKit
- How to wrap markdown - md file
- Bosses, I noticed that a mysql CDC connector parameters scan. The incremental. Sna
- [论文笔记] MapReduce: Simplified Data Processing on Large Clusters
猜你喜欢

多御安全浏览器 V10.8.3.1 版正式发布,优化多项内容

shell脚本:for循环与while循环

测试薪资这么高?刚毕业就20K
![Spark Basics [Introduction, Getting Started with WordCount Cases]](/img/90/ebe887db0f8c36895691dea05f62cf.png)
Spark Basics [Introduction, Getting Started with WordCount Cases]

Haproxy搭建Web群集

UE4 第一人称角色模板 添加蹲伏功能

MySql的索引学习和使用;(本人觉得足够详细)
![[Solved] Unity Coroutine coroutine is not executed effectively](/img/ab/035ef004a561fb98d3dd1d7d8b5618.png)
[Solved] Unity Coroutine coroutine is not executed effectively

token、jwt、oauth2、session解析

21 Days Learning Challenge (2) Use of Graphical Device Trees
随机推荐
Slapped in the face: there are so many testers in a certain department of byte
Use CH341A to program external Flash (W25Q16JV)
Android interview question - how to write with his hands a non-blocking thread safe queue ConcurrentLinkedQueue?
The test salary is so high?20K just graduated
2022.8.4-----leetcode.1403
BI业务分析思维:现金流量风控分析(二)信用、流动和投资风险
Summary of common methods of arrays
This year's Qixi Festival, "love vegetables" are more loving than gifts
ffmpeg enumeration decoders, encoders analysis
SkiaSharp 之 WPF 自绘 粒子花园(案例版)
How to find all fields with empty data in sql
运维监控系统之Open-Falcon
大佬们,我注意到mysql cdc connector有参数scan.incremental.sna
905. 区间选点
国学*周易*梅花易数 代码实现效果展示 - 梅花心易
Bosses, I noticed that a mysql CDC connector parameters scan. The incremental. Sna
2022-08-04 The sixth group, hidden from spring, study notes
DEJA_VU3D - Cesium功能集 之 059-腾讯地图纠偏
数据库设计的酸(ACID)碱(BASE)原则
ffmpeg 枚举decoders, encoders 分析