Land #10773, session.platform TypeError fix

This also adds an "unknown" platform class.
GSoC/Meterpreter_Web_Console
William Vu 2018-10-08 14:38:11 -05:00
commit 6c74820843
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
3 changed files with 18 additions and 4 deletions

View File

@ -165,12 +165,14 @@ module Metasploit
'aix'
when /Win32|Windows/
'windows'
when /Unknown command or computer name/
when /Unknown command or computer name|Line has invalid autocommand/
'cisco-ios'
when /unknown keyword/ # ScreenOS
'juniper'
when /JUNOS Base OS/ #JunOS
'juniper'
else
'unknown'
end
end

View File

@ -892,8 +892,8 @@ class ReadableText
sess_checkin = "<none>"
sess_registration = "No"
if session.respond_to?(:platform)
sess_type << " " + session.platform
if session.respond_to?(:platform) && session.platform
sess_type << " #{session.platform}"
end
if session.respond_to?(:last_checkin) && session.last_checkin

View File

@ -190,11 +190,23 @@ class Msf::Module::Platform
#
##
#
# Unknown
#
# This is a special case for when we're completely unsure of the
# platform, such as a crash or default case in code. Only
# utilize this as a catch-all.
#
class Unknown < Msf::Module::Platform
Rank = 0 # safeguard with 0 since the platform is completely unknown
Alias = "unknown"
end
#
# Windows
#
class Windows < Msf::Module::Platform
Rank = 100
Rank = 100
# Windows 95
class W95 < Windows
Rank = 100