Ciscn 2024 final Fobee wp
本篇文章仅用于技术交流学习和研究的目的,严禁使用文章中的技术用于非法目的和破坏。 前言 拿到了前段时间ciscn 2024 final的web题附件,来复现一下Fobee这道题,顺便学习一下beetl的模板注入。 3.15.x及以前的版本 过滤的很少,随便绕过。贴几个公开的poc: https://gitee.com/xiandafu/beetl/issues/I6RUIP https://gitee.com/xiandafu/beetl/issues/I914H3 3.16.0 3.16.0是题目使用的版本也是本文使用的版本。 测试环境为java8u65, beetl 3.16.0, solon 2.8.5 入口 @Mapping("/render") public ModelAndView render(String pass, String tp) throws Exception { ModelAndView model = new ModelAndView("render.htm"); if (pass != null && pass.equals(password)) { byte[] decode = Base64.getDecoder().decode(tp); String result = BeetlKit.render(new String(decode), new HashMap()); System.out.println(result); model.put("msg", getMD5Hash(result)); } else { model.put("msg", "Render Page"); } return model; } 渲染过程 由renderTo进入execute函数。然后遍历所有要执行的语句然后依次执行。 每条语句的具体执行代码在org.beetl.core.statement.NativeCallExpression#evaluate函数。 public Object evaluate(Context ctx) { Class targetCls = null; Object targetObj = null; NativeNode lastNode = null; if (insNode !...