Skip to content

Commit

Permalink
Fix for an Issue #691
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed May 15, 2014
1 parent fc3c321 commit c51e219
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions plugins/dbms/mssqlserver/fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,16 @@ def checkDbmsOs(self, detailed=False):
versions = { "2003": ("5.2", (2, 1)),
# TODO: verify this
#"2003": ("6.0", (2, 1)),
"2008": ("7.0", (1,)),
"2008": ("7.0", (2, 1,)),
"2000": ("5.0", (4, 3, 2, 1)),
"7": ("6.1", (1, 0)),
"XP": ("5.1", (2, 1)),
"XP": ("5.1", (3, 2, 1)),
"NT": ("4.0", (6, 5, 4, 3, 2, 1)) }

# Get back-end DBMS underlying operating system version
for version, data in versions.items():
query = "(SELECT LEN(%s) FROM %s WHERE %s " % (self.tblField, self.fileTblName, self.tblField)
query += "LIKE '%Windows NT " + data[0] + "%')>0"
query = "EXISTS(SELECT %s FROM %s WHERE %s " % (self.tblField, self.fileTblName, self.tblField)
query += "LIKE '%Windows NT " + data[0] + "%')"
result = inject.checkBooleanExpression(query)

if result:
Expand All @@ -169,13 +169,12 @@ def checkDbmsOs(self, detailed=False):

# Get back-end DBMS underlying operating system service pack
sps = versions[Backend.getOsVersion()][1]

for sp in sps:
query = "SELECT LEN(%s) FROM %s WHERE %s " % (self.tblField, self.fileTblName, self.tblField)
query += "LIKE '%Service Pack " + getUnicode(sp) + "%'"
result = inject.goStacked(query)
query = "EXISTS(SELECT %s FROM %s WHERE %s " % (self.tblField, self.fileTblName, self.tblField)
query += "LIKE '%Service Pack " + getUnicode(sp) + "%')"
result = inject.checkBooleanExpression(query)

if result is not None and len(result) > 0 and result[0].isdigit():
if result:
Backend.setOsServicePack(sp)
break

Expand Down

0 comments on commit c51e219

Please sign in to comment.