File tree Expand file tree Collapse file tree 1 file changed +5
-22
lines changed Expand file tree Collapse file tree 1 file changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -160,34 +160,17 @@ def session_compatible?(sess_or_sid)
160
160
return false unless self . module_info [ "SessionTypes" ] . include? ( s . type )
161
161
end
162
162
163
- # Types are okay, now check the platform. This is kind of a ghetto
164
- # workaround for session platforms being ad-hoc and Platform being
165
- # inflexible.
163
+ # Types are okay, now check the platform.
166
164
if self . platform and self . platform . kind_of? ( Msf ::Module ::PlatformList )
167
- [
168
- # Add as necessary
169
- 'win' , 'linux' , 'osx'
170
- ] . each do |name |
171
- if self . platform =~ /#{ name } /
172
- p = Msf ::Module ::PlatformList . transform ( name )
173
- return false unless self . platform . supports? p
174
- end
175
- end
176
- elsif self . platform and self . platform . kind_of? ( Msf ::Module ::Platform )
177
- p_klass = Msf ::Module ::Platform
178
- case self . platform
179
- when 'win'
180
- return false unless self . platform . kind_of? ( p_klass ::Windows )
181
- when 'osx'
182
- return false unless self . platform . kind_of? ( p_klass ::OSX )
183
- when 'linux'
184
- return false unless self . platform . kind_of? ( p_klass ::Linux )
185
- end
165
+ return false unless self . platform . supports? ( Msf ::Module ::PlatformList . transform ( s . base_platform ) )
186
166
end
187
167
188
168
# Check to make sure architectures match
189
169
mod_arch = self . module_info [ 'Arch' ]
170
+ unless mod_arch . nil?
190
171
mod_arch = [ mod_arch ] unless mod_arch . kind_of? ( Array )
172
+ return false unless mod_arch . include? s . base_arch
173
+ end
191
174
192
175
# If we got here, we haven't found anything that definitely
193
176
# disqualifies this session. Assume that means we can use it.
You can’t perform that action at this time.
0 commit comments