针对 Claroty Team82 披露、并由 Danfoss 在 R4.2 / R4.3.1 中修复的三个 AK-SM 8xxA Web 界面漏洞(DSA-2025-03-01、DSA-2025-08-01、CISA ICSA-25-140-03)的研究/检测工程 PoC:
| CVE | 弱点 | 受影响版本 | 修复版本 |
|---|---|---|---|
| CVE-2025-41450 | xml.cgi?action=getauth 上隐藏的“当日代码”认证绕过(基于日期时间推导的密码) | < R4.2 | R4.2 |
| CVE-2025-41451 | 告警转邮件 / SMTP 配置(条目 0x1be1)中的认证后 OS 命令注入 | < 4.3.1 | 4.3.1 |
| CVE-2025-41452 | 通过 action=load_nginx_headers 进行认证后 nginx headers.conf 替换 → 指令注入 + sm_app 崩溃 DoS | < 4.3.1 | 4.3.1 |
emulator/aksm800a_emulator.py vulnerable-behavior emulator (127.0.0.1 only)
poc/cve_2025_41450_code_of_the_day.py
poc/cve_2025_41451_alarm_mail_cmd_injection.py
poc/cve_2025_41452_nginx_conf_injection.py
detection/suricata/danfoss-aksm-cves.rules Suricata rules (see in-file caveats)
detection/sigma/*.yml Sigma host/log rules
detection/test_rules_against_captures.py replay captures against the ruleset
captures/http-requests.jsonl full request log, tagged per CVE
WRITEUP.md FROMAGEGATE incident context + full research summary
仅使用 Python 3 标准库;无依赖。
python3 emulator/aksm800a_emulator.py 8080 & # start the target
python3 poc/cve_2025_41450_code_of_the_day.py # exit 0 = bypass works
python3 poc/cve_2025_41451_alarm_mail_cmd_injection.py
python3 poc/cve_2025_41452_nginx_conf_injection.py # add --no-dos to skip DoS
python3 detection/test_rules_against_captures.py # replay captures vs Suricata rules
41451 和 41452 的 PoC 默认通过 41450 的绕过进行串联(真实攻击者没有已配置的凭据);两者都接受 --user/--password(41451),以便从合法会话开始。所有 PoC 都接受 --target HOST:PORT,因此它们也能针对真实存在漏洞的固件工作——但 code-of-the-day 算法和绕过属性名称必须替换为从固件中恢复的值(见下方注意事项)。
每个模拟器请求都会带标签记录到 captures/http-requests.jsonl。稳定且值得作为签名的网络产物包括:
CVE-2025-41450(认证绕过)
POST /xml.cgi?action=getauth 携带除用户名/密码之外的意外属性(此处为:codeofday=1 / support=1;真实名称在公开来源中已被隐去——最终规则需从固件中恢复)。Server: nginx)出现在低于 R4.2 的固件上时,本身就存在漏洞——横幅/版本检测是保真度最高的信号。CVE-2025-41451(命令注入 → RCE)
POST /xml.cgi?action=set_email_config,在电子邮件密码字段(配置项 0x1be1)中包含 shell 元字符(; | & $() `)。合法的 SMTP 密码很少包含 ;+命令。x'; <cmd> # / $(<cmd>) 等——请查看带标签的 constructed_cmd: 日志行,了解该值究竟如何进入 shell。id、curl 等)。CVE-2025-41452(nginx 配置注入 → 流量操纵 / DoS)
xml.cgi?action=load_nginx_headers(文件名为 headers.conf)。除罕见的管理维护外,此端点没有正当理由被调用——基于调用量的告警即可生效。location、proxy_pass、rewrite、add_header 指令。emulator/aksm800a_emulator.py:generate_code),它保留了文档中描述的特性(代码仅由设备日期派生)。PoC 和模拟器共用该算法,因此整条链路可端到端运行。对于真实硬件,请从固件中提取 check_code_of_day 并替换进去。id → 证明文件)。仅绑定/运行在 127.0.0.1 上。