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.



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
87
# File 'lib/rex/post/meterpreter/extensions/stdapi_ui/stdapi_ui.rb', line 50

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



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

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.



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

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

#eventlogObject

Returns a copy of the EventLog class.



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

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

#powerObject

Returns a copy of the Power class.



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

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

#processObject

Returns a copy of the Process class.



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

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

#registryObject

Returns a copy of the Registry class.



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

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