From fe63fe26626c5adced946c464c7fd0c03ee5d76f Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 2 Jun 2015 09:43:34 +0000 Subject: [PATCH] Added support for SQL Server 2014, and added version numbers for service packs from the last couple of years. --- nselib/mssql.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nselib/mssql.lua b/nselib/mssql.lua index be454de1f..2fdb43fd9 100644 --- a/nselib/mssql.lua +++ b/nselib/mssql.lua @@ -136,6 +136,7 @@ _ENV = stdnse.module("mssql", stdnse.seeall) -- -- (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 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") @@ -320,7 +321,7 @@ SqlServerVersionInfo = local VERSION_LOOKUP_TABLE = { ["^6%.0"] = "6.0", ["^6%.5"] = "6.5", ["^7%.0"] = "7.0", ["^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 = "" @@ -359,11 +360,13 @@ SqlServerVersionInfo = 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 @@ -378,6 +381,7 @@ SqlServerVersionInfo = elseif self.brandedVersion == "2008" then spLookupTable = SP_LOOKUP_TABLE_2008 elseif self.brandedVersion == "2008 R2" then spLookupTable = SP_LOOKUP_TABLE_2008R2 elseif self.brandedVersion == "2012" then spLookupTable = SP_LOOKUP_TABLE_2012 + elseif self.brandedVersion == "2014" then spLookupTable = SP_LOOKUP_TABLE_2014 end return spLookupTable