Class: Rex::Post::Meterpreter::Extensions::Stdapi_Sys::Stdapi_Sys

Inherits:
Rex::Post::Meterpreter::Extension show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb

Instance Attribute Summary

Attributes inherited from Rex::Post::Meterpreter::Extension

#client, #name

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Stdapi_Sys

Initializes an instance of the Standard API (Sys Namespace) extension.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 32

def initialize(client)
  super(client, 'stdapi_sys')

  # Alias the following things on the client object so that they
  # can be directly referenced
  client.register_extension_aliases(
    [
      {
        'name' => 'sys',
        'ext'  => ObjectAliases.new(
          {
            'config'   => Rex::Post::Meterpreter::Extensions::Stdapi_Sys::Sys::Config.new(client),
            'process'  => self.process,
            'registry' => self.registry,
            'eventlog' => self.eventlog,
            'power'    => self.power
          })
      },
    ])
end

Class Method Details

.extension_idObject



25
26
27
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 25

def self.extension_id
  Rex::Post::Meterpreter::Extensions::Stdapi::EXTENSION_ID_STDAPI
end

Instance Method Details

#brand(klass) ⇒ Object

Sets the client instance on a duplicated copy of the supplied class.



56
57
58
59
60
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 56

def brand(klass)
  klass = klass.dup
  klass.client = self.client
  return klass
end

#eventlogObject

Returns a copy of the EventLog class.



79
80
81
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 79

def eventlog
  brand(Rex::Post::Meterpreter::Extensions::Stdapi_Sys::Sys::EventLog)
end

#powerObject

Returns a copy of the Power class.



86
87
88
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 86

def power
  brand(Rex::Post::Meterpreter::Extensions::Stdapi_Sys::Sys::Power)
end

#processObject

Returns a copy of the Process class.



65
66
67
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 65

def process
  brand(Rex::Post::Meterpreter::Extensions::Stdapi_Sys::Sys::Process)
end

#registryObject

Returns a copy of the Registry class.



72
73
74
# File 'lib/rex/post/meterpreter/extensions/stdapi_sys/stdapi_sys.rb', line 72

def registry
  brand(Rex::Post::Meterpreter::Extensions::Stdapi_Sys::Sys::Registry)
end