Class: Rex::Post::Meterpreter::Extensions::Unhook::Unhook

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

Overview

This meterpreter extension can be used to unhook PSP products

Constant Summary collapse

UNHOOK_ERROR_SUCCESS =
0

Instance Attribute Summary

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

#client, #name

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Unhook

Returns a new instance of Unhook.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rex/post/meterpreter/extensions/unhook/unhook.rb', line 25

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

  client.register_extension_aliases(
    [
      {
        'name' => 'unhook',
        'ext'  => self
      },
    ])
end

Class Method Details

.extension_idObject



21
22
23
# File 'lib/rex/post/meterpreter/extensions/unhook/unhook.rb', line 21

def self.extension_id
  EXTENSION_ID_UNHOOK
end

Instance Method Details

#unhook_peObject

Raises:

  • (Exception)


37
38
39
40
41
42
43
44
# File 'lib/rex/post/meterpreter/extensions/unhook/unhook.rb', line 37

def unhook_pe
  request = Packet.create_request(COMMAND_ID_UNHOOK_PE)
  response = client.send_request(request)
  response_code = response.get_tlv_value(TLV_TYPE_UNHOOK_ERROR_CODE)

  raise Exception, 'Did not get ERROR_SUCCESS back!' if response_code != UNHOOK_ERROR_SUCCESS
  return 0, response_code, nil
end