Skip to content

Commit 3c6cd7c

Browse files
committed
Make platform check case-insensitive
1 parent 9cdfac4 commit 3c6cd7c

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

lib/metasploit/framework/ssh/platform.rb

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,31 @@ def self.get_platform_info(ssh_socket, timeout: 10)
8484

8585
def self.get_platform_from_info(info)
8686
case info
87-
when /unifi\.version|UniFiSecurityGateway/ #Ubiquiti Unifi. uname -a is left in, so we got to pull before Linux
87+
when /unifi\.version|UniFiSecurityGateway/i #Ubiquiti Unifi. uname -a is left in, so we got to pull before Linux
8888
'unifi'
89-
when /Linux/
89+
when /Linux/i
9090
'linux'
91-
when /Darwin/
91+
when /Darwin/i
9292
'osx'
93-
when /SunOS/
93+
when /SunOS/i
9494
'solaris'
95-
when /BSD/
95+
when /BSD/i
9696
'bsd'
97-
when /HP-UX/
97+
when /HP-UX/i
9898
'hpux'
99-
when /AIX/
99+
when /AIX/i
100100
'aix'
101-
when /cygwin|Win32|Windows|Microsoft/
101+
when /cygwin|Win32|Windows|Microsoft/i
102102
'windows'
103-
when /Unknown command or computer name|Line has invalid autocommand/
103+
when /Unknown command or computer name|Line has invalid autocommand/i
104104
'cisco-ios'
105-
when /unknown keyword/ # ScreenOS
105+
when /unknown keyword/i # ScreenOS
106106
'juniper'
107-
when /JUNOS Base OS/ # JunOS
107+
when /JUNOS Base OS/i # JunOS
108108
'juniper'
109-
when /MikroTik/
109+
when /MikroTik/i
110110
'mikrotik'
111-
when /Arista/
111+
when /Arista/i
112112
'arista'
113113
else
114114
'unknown'
@@ -118,4 +118,3 @@ def self.get_platform_from_info(info)
118118
end
119119
end
120120
end
121-

0 commit comments

Comments
 (0)