1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 05:31:31 +00:00

Added support for SQL Server 2014, and added version numbers for service packs from the last couple of years.

This commit is contained in:
robert
2015-06-02 09:43:34 +00:00
parent 324dc67541
commit fe63fe2662

View File

@@ -136,6 +136,7 @@ _ENV = stdnse.module("mssql", stdnse.seeall)
-- --
-- (Tom Sellers) -- (Tom Sellers)
-- Updated 10/01/2012 - v0.7 - added support for 2012 and later service packs for 2005, 2008 and 2008 R2 (Rob Nicholls) -- Updated 10/01/2012 - v0.7 - added support for 2012 and later service packs for 2005, 2008 and 2008 R2 (Rob Nicholls)
-- Updated 02/06/2015 - v0.8 - added support for 2014 and later service packs for older versions (Rob Nicholls)
local HAVE_SSL, openssl = pcall(require, "openssl") local HAVE_SSL, openssl = pcall(require, "openssl")
@@ -320,7 +321,7 @@ SqlServerVersionInfo =
local VERSION_LOOKUP_TABLE = { local VERSION_LOOKUP_TABLE = {
["^6%.0"] = "6.0", ["^6%.5"] = "6.5", ["^7%.0"] = "7.0", ["^6%.0"] = "6.0", ["^6%.5"] = "6.5", ["^7%.0"] = "7.0",
["^8%.0"] = "2000", ["^9%.0"] = "2005", ["^10%.0"] = "2008", ["^8%.0"] = "2000", ["^9%.0"] = "2005", ["^10%.0"] = "2008",
["^10%.50"] = "2008 R2", ["^11%.0"] = "2012", ["^10%.50"] = "2008 R2", ["^11%.0"] = "2012", ["^12%.0"] = "2014",
} }
local product = "" local product = ""
@@ -359,11 +360,13 @@ SqlServerVersionInfo =
local SP_LOOKUP_TABLE_2005 = { {1399, "RTM"}, {2047, "SP1"}, {3042, "SP2"}, {4035, "SP3"}, {5000, "SP4"}, } local SP_LOOKUP_TABLE_2005 = { {1399, "RTM"}, {2047, "SP1"}, {3042, "SP2"}, {4035, "SP3"}, {5000, "SP4"}, }
local SP_LOOKUP_TABLE_2008 = { {1600, "RTM"}, {2531, "SP1"}, {4000, "SP2"}, {5500, "SP3"}, } local SP_LOOKUP_TABLE_2008 = { {1600, "RTM"}, {2531, "SP1"}, {4000, "SP2"}, {5500, "SP3"}, {6000, "SP4"}, }
local SP_LOOKUP_TABLE_2008R2 = { {1600, "RTM"}, {2500, "SP1"}, {4000, "SP2"}, } local SP_LOOKUP_TABLE_2008R2 = { {1600, "RTM"}, {2500, "SP1"}, {4000, "SP2"}, {6000, "SP3"}, }
local SP_LOOKUP_TABLE_2012 = { {2100, "RTM"}, } local SP_LOOKUP_TABLE_2012 = { {2100, "RTM"}, {3000, "SP1"}, {5058, "SP2"}, }
local SP_LOOKUP_TABLE_2014 = { {2000, "RTM"}, {4050, "SP1"}, }
if ( not self.brandedVersion ) then if ( not self.brandedVersion ) then
@@ -378,6 +381,7 @@ SqlServerVersionInfo =
elseif self.brandedVersion == "2008" then spLookupTable = SP_LOOKUP_TABLE_2008 elseif self.brandedVersion == "2008" then spLookupTable = SP_LOOKUP_TABLE_2008
elseif self.brandedVersion == "2008 R2" then spLookupTable = SP_LOOKUP_TABLE_2008R2 elseif self.brandedVersion == "2008 R2" then spLookupTable = SP_LOOKUP_TABLE_2008R2
elseif self.brandedVersion == "2012" then spLookupTable = SP_LOOKUP_TABLE_2012 elseif self.brandedVersion == "2012" then spLookupTable = SP_LOOKUP_TABLE_2012
elseif self.brandedVersion == "2014" then spLookupTable = SP_LOOKUP_TABLE_2014
end end
return spLookupTable return spLookupTable