diff --git a/lib/msf/base/sessions/meterpreter_options.rb b/lib/msf/base/sessions/meterpreter_options.rb index 09c8a97eff..a037203e72 100644 --- a/lib/msf/base/sessions/meterpreter_options.rb +++ b/lib/msf/base/sessions/meterpreter_options.rb @@ -66,6 +66,10 @@ module Msf OptInt.new( 'SessionCommunicationTimeout', [ false, 'The number of seconds of no activity before this session should be killed', TIMEOUT_COMMS] + ), + OptString.new( + 'PayloadProcessCommandLine', + [ false, 'The displayed command line that will be used by the payload', ''] ) ], self.class diff --git a/lib/msf/base/sessions/mettle_config.rb b/lib/msf/base/sessions/mettle_config.rb index 369562a9c1..a1878269a3 100644 --- a/lib/msf/base/sessions/mettle_config.rb +++ b/lib/msf/base/sessions/mettle_config.rb @@ -65,6 +65,12 @@ module Msf end def generate_config(opts={}) + ds = opts[:datastore] || datastore + + if ds['PayloadProcessCommandLine'] != '' + opts[:name] ||= ds['PayloadProcessCommandLine'] + end + opts[:uuid] ||= generate_payload_uuid case opts[:scheme] @@ -85,7 +91,7 @@ module Msf end opts[:session_guid] = Base64.encode64(guid).strip - opts.slice(:uuid, :session_guid, :uri, :debug, :log_file) + opts.slice(:uuid, :session_guid, :uri, :debug, :log_file, :name) end end