@@ -187,7 +187,7 @@ def checkDbms(self):
187187 return False
188188
189189 # Determine if it is MySQL >= 5.0.0
190- if inject .getValue ("SELECT %s FROM information_schema.TABLES LIMIT 0, 1" % randInt , charsetType = 2 ) == randInt :
190+ if inject .getValue ("SELECT %s FROM information_schema.TABLES LIMIT 0, 1" % randInt , charsetType = 2 , suppressOutput = True ) == randInt :
191191 kb .data .has_information_schema = True
192192 kb .dbmsVersion = [">= 5.0.0" ]
193193
@@ -199,28 +199,28 @@ def checkDbms(self):
199199 return True
200200
201201 # Check if it is MySQL >= 5.5.0
202- if inject .getValue ("SELECT MID(TO_SECONDS(950501), 1, 1)" , unpack = False , charsetType = 2 ) == "6" :
202+ if inject .getValue ("SELECT MID(TO_SECONDS(950501), 1, 1)" , unpack = False , charsetType = 2 , suppressOutput = True ) == "6" :
203203 kb .dbmsVersion = [">= 5.5.0" ]
204204
205205 # Check if it is MySQL >= 5.1.2 and < 5.5.0
206206 elif inject .getValue ("SELECT MID(@@table_open_cache, 1, 1)" , unpack = False ):
207- if inject .getValue ("SELECT %s FROM information_schema.GLOBAL_STATUS LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 ) == randInt :
207+ if inject .getValue ("SELECT %s FROM information_schema.GLOBAL_STATUS LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 , suppressOutput = True ) == randInt :
208208 kb .dbmsVersion = [">= 5.1.12" , "< 5.5.0" ]
209- elif inject .getValue ("SELECT %s FROM information_schema.PROCESSLIST LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 ) == randInt :
209+ elif inject .getValue ("SELECT %s FROM information_schema.PROCESSLIST LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 , suppressOutput = True ) == randInt :
210210 kb .dbmsVersion = [">= 5.1.7" , "< 5.1.12" ]
211- elif inject .getValue ("SELECT %s FROM information_schema.PARTITIONS LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 ) == randInt :
211+ elif inject .getValue ("SELECT %s FROM information_schema.PARTITIONS LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 , suppressOutput = True ) == randInt :
212212 kb .dbmsVersion = ["= 5.1.6" ]
213- elif inject .getValue ("SELECT %s FROM information_schema.PLUGINS LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 ) == randInt :
213+ elif inject .getValue ("SELECT %s FROM information_schema.PLUGINS LIMIT 0, 1" % randInt , unpack = False , charsetType = 2 , suppressOutput = True ) == randInt :
214214 kb .dbmsVersion = [">= 5.1.5" , "< 5.1.6" ]
215215 else :
216216 kb .dbmsVersion = [">= 5.1.2" , "< 5.1.5" ]
217217
218218 # Check if it is MySQL >= 5.0.0 and < 5.1.2
219- elif inject .getValue ("SELECT MID(@@hostname, 1, 1)" , unpack = False ):
219+ elif inject .getValue ("SELECT MID(@@hostname, 1, 1)" , unpack = False , suppressOutput = True ):
220220 kb .dbmsVersion = [">= 5.0.38" , "< 5.1.2" ]
221- elif inject .getValue ("SELECT 1 FROM DUAL" , charsetType = 1 ) == "1" :
221+ elif inject .getValue ("SELECT 1 FROM DUAL" , charsetType = 1 , suppressOutput = True ) == "1" :
222222 kb .dbmsVersion = [">= 5.0.11" , "< 5.0.38" ]
223- elif inject .getValue ("SELECT DATABASE() LIKE SCHEMA()" ):
223+ elif inject .getValue ("SELECT DATABASE() LIKE SCHEMA()" , suppressOutput = True ):
224224 kb .dbmsVersion = [">= 5.0.2" , "< 5.0.11" ]
225225 else :
226226 kb .dbmsVersion = [">= 5.0.0" , "<= 5.0.1" ]
@@ -237,24 +237,24 @@ def checkDbms(self):
237237 return True
238238
239239 # Check which version of MySQL < 5.0.0 it is
240- coercibility = inject .getValue ("SELECT COERCIBILITY(USER())" )
240+ coercibility = inject .getValue ("SELECT COERCIBILITY(USER())" , suppressOutput = True )
241241
242242 if coercibility == "3" :
243243 kb .dbmsVersion = [">= 4.1.11" , "< 5.0.0" ]
244244 elif coercibility == "2" :
245245 kb .dbmsVersion = [">= 4.1.1" , "< 4.1.11" ]
246- elif inject .getValue ("SELECT CURRENT_USER()" ):
246+ elif inject .getValue ("SELECT CURRENT_USER()" , suppressOutput = True ):
247247 kb .dbmsVersion = [">= 4.0.6" , "< 4.1.1" ]
248248
249- if inject .getValue ("SELECT CHARSET(CURRENT_USER())" ) == "utf8" :
249+ if inject .getValue ("SELECT CHARSET(CURRENT_USER())" , suppressOutput = True ) == "utf8" :
250250 kb .dbmsVersion = ["= 4.1.0" ]
251251 else :
252252 kb .dbmsVersion = [">= 4.0.6" , "< 4.1.0" ]
253- elif inject .getValue ("SELECT FOUND_ROWS()" , charsetType = 1 ) == "0" :
253+ elif inject .getValue ("SELECT FOUND_ROWS()" , charsetType = 1 , suppressOutput = True ) == "0" :
254254 kb .dbmsVersion = [">= 4.0.0" , "< 4.0.6" ]
255- elif inject .getValue ("SELECT CONNECTION_ID()" ):
255+ elif inject .getValue ("SELECT CONNECTION_ID()" , suppressOutput = True ):
256256 kb .dbmsVersion = [">= 3.23.14" , "< 4.0.0" ]
257- elif re .search ("@[\w\.\-\_]+" , inject .getValue ("SELECT USER()" )):
257+ elif re .search ("@[\w\.\-\_]+" , inject .getValue ("SELECT USER()" , suppressOutput = True )):
258258 kb .dbmsVersion = [">= 3.22.11" , "< 3.23.14" ]
259259 else :
260260 kb .dbmsVersion = ["< 3.22.11" ]
@@ -273,7 +273,7 @@ def checkDbmsOs(self, detailed=False):
273273 infoMsg = "fingerprinting the back-end DBMS operating system"
274274 logger .info (infoMsg )
275275
276- datadirSubstr = inject .getValue ("SELECT MID(@@datadir, 1, 1)" , unpack = False )
276+ datadirSubstr = inject .getValue ("SELECT MID(@@datadir, 1, 1)" , unpack = False , suppressOutput = True )
277277
278278 if datadirSubstr == "/" :
279279 kb .os = "Linux"
0 commit comments