Land #10773, session.platform TypeError fix
This also adds an "unknown" platform class.GSoC/Meterpreter_Web_Console
commit
6c74820843
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue