Class: Rex::Post::Meterpreter::Ui::Console::CommandDispatcher::Unhook

Inherits:
Object
  • Object
show all
Includes:
Rex::Post::Meterpreter::Ui::Console::CommandDispatcher
Defined in:
lib/rex/post/meterpreter/ui/console/command_dispatcher/unhook.rb

Overview

Unhook extension - unhook PSP products

Constant Summary collapse

Klass =
Console::CommandDispatcher::Unhook
@@bf_execute_opts =
Rex::Parser::Arguments.new(
  '-h' => [false, 'Help banner']
)

Instance Attribute Summary

Attributes included from Ui::Text::DispatcherShell::CommandDispatcher

#shell, #tab_complete_items

Instance Method Summary collapse

Methods included from Rex::Post::Meterpreter::Ui::Console::CommandDispatcher

check_hash, #client, #docs_dir, #filter_commands, #initialize, #log_error, #msf_loaded?, set_hash, #unknown_command

Methods included from Ui::Text::DispatcherShell::CommandDispatcher

#cmd_help, #cmd_help_help, #cmd_help_tabs, #deprecated_cmd, #deprecated_commands, #deprecated_help, #docs_dir, #help_to_s, included, #initialize, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #tab_complete_directory, #tab_complete_filenames, #tab_complete_generic, #tab_complete_source_address, #unknown_command, #update_prompt

Instance Method Details

#cmd_unhook_pe(*args) ⇒ Object

Execute a simple BF command string



50
51
52
53
54
55
56
57
58
59
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/unhook.rb', line 50

def cmd_unhook_pe(*args)
  if args.include?('-h')
    unhook_execute_usage
    return false
  end

  result = client.unhook.unhook_pe

  print_good("Command execution completed:\n#{result}")
end

#commandsObject

List of supported commands.



30
31
32
33
34
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/unhook.rb', line 30

def commands
  {
    'unhook_pe'  => 'Unhook the current process'
  }
end

#nameObject

Name for this dispatcher



23
24
25
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/unhook.rb', line 23

def name
  'Unhook'
end

#unhook_execute_usageObject



40
41
42
43
44
45
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/unhook.rb', line 40

def unhook_execute_usage
  print_line('Usage: unhook_pe')
  print_line
  print_line('Removes any runtime hooks placed by PSPs')
  print_line(@@bf_execute_opts.usage)
end