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
|
# Open a Pry session on the current module or Framework
|
||||||
#
|
#
|
||||||
def cmd_pry(*args)
|
def cmd_pry(*args)
|
||||||
begin
|
if args.include?('-h')
|
||||||
require 'pry'
|
cmd_pry_help
|
||||||
rescue LoadError
|
|
||||||
print_error("Failed to load Pry, try 'gem install pry'")
|
|
||||||
return
|
return
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def cmd_edit_help
|
def cmd_edit_help
|
||||||
|
|
|
@ -53,6 +53,7 @@ class Console::CommandDispatcher::Core
|
||||||
'exit' => 'Terminate the meterpreter session',
|
'exit' => 'Terminate the meterpreter session',
|
||||||
'help' => 'Help menu',
|
'help' => 'Help menu',
|
||||||
'irb' => 'Drop into irb scripting mode',
|
'irb' => 'Drop into irb scripting mode',
|
||||||
|
'pry' => 'Open a Pry session on the current session',
|
||||||
'use' => 'Deprecated alias for "load"',
|
'use' => 'Deprecated alias for "load"',
|
||||||
'load' => 'Load one or more meterpreter extensions',
|
'load' => 'Load one or more meterpreter extensions',
|
||||||
'machine_id' => 'Get the MSF ID of the machine attached to the session',
|
'machine_id' => 'Get the MSF ID of the machine attached to the session',
|
||||||
|
@ -570,6 +571,35 @@ class Console::CommandDispatcher::Core
|
||||||
end
|
end
|
||||||
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(
|
@@set_timeouts_opts = Rex::Parser::Arguments.new(
|
||||||
'-c' => [true, 'Comms timeout (seconds)'],
|
'-c' => [true, 'Comms timeout (seconds)'],
|
||||||
'-x' => [true, 'Expiration timout (seconds)'],
|
'-x' => [true, 'Expiration timout (seconds)'],
|
||||||
|
|
Loading…
Reference in New Issue