Land #10687, add pry command to meterpreter.
parent
62dacb3d1e
commit
0c88820fce
|
@ -112,14 +112,28 @@ class Msf::Ui::Console::CommandDispatcher::Developer
|
|||
# Open a Pry session on the current module or Framework
|
||||
#
|
||||
def cmd_pry(*args)
|
||||
begin
|
||||
require 'pry'
|
||||
rescue LoadError
|
||||
print_error("Failed to load Pry, try 'gem install pry'")
|
||||
if args.include?('-h')
|
||||
cmd_pry_help
|
||||
return
|
||||
end
|
||||
|
||||
active_module ? active_module.pry : framework.pry
|
||||
begin
|
||||
require 'pry'
|
||||
rescue LoadError
|
||||
print_error('Failed to load Pry, try "gem install pry"')
|
||||
return
|
||||
end
|
||||
|
||||
print_status('Starting Pry shell...')
|
||||
|
||||
unless active_module
|
||||
print_status("You are in the \"framework\" object\n")
|
||||
framework.pry
|
||||
return
|
||||
end
|
||||
|
||||
print_status("You are in #{active_module.fullname}\n")
|
||||
active_module.pry
|
||||
end
|
||||
|
||||
def cmd_edit_help
|
||||
|
|
|
@ -53,6 +53,7 @@ class Console::CommandDispatcher::Core
|
|||
'exit' => 'Terminate the meterpreter session',
|
||||
'help' => 'Help menu',
|
||||
'irb' => 'Drop into irb scripting mode',
|
||||
'pry' => 'Open a Pry session on the current session',
|
||||
'use' => 'Deprecated alias for "load"',
|
||||
'load' => 'Load one or more meterpreter extensions',
|
||||
'machine_id' => 'Get the MSF ID of the machine attached to the session',
|
||||
|
@ -570,6 +571,35 @@ class Console::CommandDispatcher::Core
|
|||
end
|
||||
end
|
||||
|
||||
def cmd_pry_help
|
||||
print_line 'Usage: pry'
|
||||
print_line
|
||||
print_line 'Open a Pry session on the current session.'
|
||||
print_line
|
||||
end
|
||||
|
||||
#
|
||||
# Open a Pry session on the current session
|
||||
#
|
||||
def cmd_pry(*args)
|
||||
if args.include?('-h')
|
||||
cmd_pry_help
|
||||
return
|
||||
end
|
||||
|
||||
begin
|
||||
require 'pry'
|
||||
rescue LoadError
|
||||
print_error('Failed to load Pry, try "gem install pry"')
|
||||
return
|
||||
end
|
||||
|
||||
print_status('Starting Pry shell...')
|
||||
print_status("You are in the \"client\" (session) object\n")
|
||||
|
||||
client.pry
|
||||
end
|
||||
|
||||
@@set_timeouts_opts = Rex::Parser::Arguments.new(
|
||||
'-c' => [true, 'Comms timeout (seconds)'],
|
||||
'-x' => [true, 'Expiration timout (seconds)'],
|
||||
|
|
Loading…
Reference in New Issue