Skip to content

Commit f18787e

Browse files
committed
fix: addressing review comments
1 parent da7ee9d commit f18787e

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

lib/msf/base/sessions/meterpreter.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def bootstrap(datastore = {}, handler = nil)
180180
print_warning('Meterpreter start up operations have been aborted. Use the session at your own risk.')
181181
return nil
182182
end
183-
extensions = datastore['AutoLoadExtensions']&.split(';') || []
183+
extensions = datastore['AutoLoadExtensions']&.delete(' ').split(',') || []
184184

185185
# BEGIN: This should be removed on MSF 7
186186
# Unhook the process prior to loading stdapi to reduce logging/inspection by any AV/PSP (by default unhook is first, see meterpreter_options/windows.rb)
@@ -195,9 +195,13 @@ def bootstrap(datastore = {}, handler = nil)
195195
# TODO: abstract this a little, perhaps a "post load" function that removes
196196
# platform-specific stuff?
197197
extensions.each do |extension|
198-
console.run_single("load #{extension}")
199-
console.run_single('unhook_pe') if extension == 'unhook'
200-
session.load_session_info if extension == 'stdapi' && datastore['AutoSystemInfo']
198+
begin
199+
console.run_single("load #{extension}")
200+
console.run_single('unhook_pe') if extension == 'unhook'
201+
session.load_session_info if extension == 'stdapi' && datastore['AutoSystemInfo']
202+
rescue => e
203+
print_warning("Failed loading extension #{extension}")
204+
end
201205
end
202206
console.disable_output = original
203207

lib/msf/base/sessions/meterpreter_options/android.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize(info = {})
1616
[
1717
OptString.new(
1818
'AutoLoadExtensions',
19-
[true, "Automatically load extensions on bootstrap, semicolon separated.", 'stdapi;android']
19+
[true, "Automatically load extensions on bootstrap, semicolon separated.", 'stdapi,android']
2020
),
2121
],
2222
self.class

lib/msf/base/sessions/meterpreter_options/windows.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize(info = {})
1616
[
1717
OptString.new(
1818
'AutoLoadExtensions',
19-
[true, "Automatically load extensions on bootstrap, semicolon separated.", 'unhook;priv;stdapi']
19+
[true, "Automatically load extensions on bootstrap, semicolon separated.", 'unhook,priv,stdapi']
2020
),
2121
OptBool.new(
2222
'AutoUnhookProcess',

tools/modules/meterpreter_reverse.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
module MetasploitModule
99

1010
include Msf::Payload::Single
11-
include Msf::Sessions::MeterpreterOptions::<%= platform.split('_').each { |s| s.capitalize! }.join %>
11+
include Msf::Sessions::MeterpreterOptions::<%= platform.split('_').each { |s| s.casecmp?('osx') ? 'OSX' : s.capitalize! }.join %>
1212
include Msf::Sessions::MettleConfig
1313

1414
def initialize(info = {})

0 commit comments

Comments
 (0)