Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e853ca

Browse files
committed
Minor bug fix so now when the back-end DBMS operating system is Windows 2000, it sets the temporary folder automatically to C:\WINNT\Temp - the user does not need to provide it anymore with --tmp-path C:\\WINNT\\Temp
1 parent 0043336 commit 5e853ca

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

plugins/dbms/mssqlserver/fingerprint.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ def checkDbmsOs(self, detailed=False):
150150

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

156-
if inject.checkBooleanExpression(query):
157+
if result is not None and result.isdigit():
157158
Backend.setOsVersion(version)
158159
infoMsg += " %s" % Backend.getOsVersion()
159160
break
@@ -175,10 +176,11 @@ def checkDbmsOs(self, detailed=False):
175176
sps = versions[Backend.getOsVersion()][1]
176177

177178
for sp in sps:
178-
query = "(SELECT LEN(%s) FROM %s WHERE %s " % (self.tblField, self.fileTblName, self.tblField)
179-
query += "LIKE '%Service Pack " + getUnicode(sp) + "%')>0"
179+
query = "SELECT LEN(%s) FROM %s WHERE %s " % (self.tblField, self.fileTblName, self.tblField)
180+
query += "LIKE '%Service Pack " + getUnicode(sp) + "%'"
181+
result = inject.goStacked(query)
180182

181-
if inject.checkBooleanExpression(query):
183+
if result is not None and result.isdigit():
182184
Backend.setOsServicePack(sp)
183185
break
184186

plugins/generic/misc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def __init__(self):
3939
def getRemoteTempPath(self):
4040
if not conf.tmpPath:
4141
if Backend.isOs(OS.WINDOWS):
42+
self.checkDbmsOs(detailed=True)
43+
4244
if Backend.getOsVersion() == "2000":
4345
conf.tmpPath = "C:/WINNT/Temp"
4446
else:

0 commit comments

Comments
 (0)