Class: Rex::Post::Meterpreter::Extensions::Stdapi_Ui::Stdapi_Ui

Inherits:
Rex::Post::Meterpreter::Extension show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.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_Ui

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 49

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

  # Alias the following things on the client object so that they
  # can be directly referenced
  client.register_extension_aliases(
    [
      {
        'name' => 'audio_output',
        'ext' => Rex::Post::Meterpreter::Extensions::Stdapi_Ui::AudioOutput::AudioOutput.new(client)
      },
      {
        'name' => 'mic',
        'ext' => Rex::Post::Meterpreter::Extensions::Stdapi_Ui::Mic::Mic.new(client)
      },
      {
        'name' => 'sys',
        'ext' => ObjectAliases.new(
          {
            'config' => Rex::Post::Meterpreter::Extensions::Stdapi_Ui::Sys::Config.new(client),
            'process' => process,
            'registry' => registry,
            'eventlog' => eventlog,
            'power' => power
          }
        )
      },
      {
        'name' => 'ui',
        'ext' => Rex::Post::Meterpreter::Extensions::Stdapi::UI.new(client)
      },
      {
        'name' => 'webcam',
        'ext' => Rex::Post::Meterpreter::Extensions::Stdapi_Ui::Webcam::Webcam.new(client)
      },
    ]
  )
end

Class Method Details

.extension_idObject



42
43
44
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 42

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.



91
92
93
94
95
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 91

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

#eventlogObject

Returns a copy of the EventLog class.



114
115
116
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 114

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

#powerObject

Returns a copy of the Power class.



121
122
123
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 121

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

#processObject

Returns a copy of the Process class.



100
101
102
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 100

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

#registryObject

Returns a copy of the Registry class.



107
108
109
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 107

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