Update report_host() to match os_* field changes
This is part of a bigger change to normalize what os_name, os_flavor, and os_sp actually mean. To summarize the changes happening in Mdm: 1) The vendor name is being removed from os_name * "Microsoft Windows" -> "Windows 7" 2) The os_flavor field is being used for the edition of the os_name product * "7" -> "Enterprise" 3) The os_sp field specifies a version if known and nothing if not * "SP0" -> "", "Service Pack 2" -> "SP2", etcbug/bundler_fix
parent
dbb192532e
commit
4611d0a8d0
|
@ -301,8 +301,8 @@ class DBManager
|
||||||
#
|
#
|
||||||
# The opts parameter can contain:
|
# The opts parameter can contain:
|
||||||
# +:state+:: -- one of the Msf::HostState constants
|
# +:state+:: -- one of the Msf::HostState constants
|
||||||
# +:os_name+:: -- one of the Msf::OperatingSystems constants
|
# +:os_name+:: -- something like "Windows", "Linux", or "Mac OS X"
|
||||||
# +:os_flavor+:: -- something like "XP" or "Gentoo"
|
# +:os_flavor+:: -- something like "Enterprise", "Pro", or "Home"
|
||||||
# +:os_sp+:: -- something like "SP2"
|
# +:os_sp+:: -- something like "SP2"
|
||||||
# +:os_lang+:: -- something like "English", "French", or "en-US"
|
# +:os_lang+:: -- something like "English", "French", or "en-US"
|
||||||
# +:arch+:: -- one of the ARCH_* constants
|
# +:arch+:: -- one of the ARCH_* constants
|
||||||
|
@ -449,14 +449,13 @@ class DBManager
|
||||||
end
|
end
|
||||||
|
|
||||||
if info['OS'] =~ /^Windows\s*([^\(]+)\(([^\)]+)\)/i
|
if info['OS'] =~ /^Windows\s*([^\(]+)\(([^\)]+)\)/i
|
||||||
res[:os_name] = "Microsoft Windows"
|
res[:os_name] = "Windows #{$1}"
|
||||||
res[:os_flavor] = $1.strip
|
|
||||||
build = $2.strip
|
build = $2.strip
|
||||||
|
|
||||||
if build =~ /Service Pack (\d+)/
|
if build =~ /Service Pack (\d+)/
|
||||||
res[:os_sp] = "SP" + $1
|
res[:os_sp] = "SP" + $1
|
||||||
else
|
else
|
||||||
res[:os_sp] = "SP0"
|
res[:os_sp] = ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue