@@ -1285,36 +1285,43 @@ def banner():
12851285 """
12861286
12871287 if not any (_ in sys .argv for _ in ("--version" , "--api" )) and not conf .get ("disableBanner" ):
1288- _ = BANNER
1288+ result = BANNER
12891289
12901290 if not IS_TTY or "--disable-coloring" in sys .argv :
1291- _ = clearColors (_ )
1291+ result = clearColors (result )
12921292 elif IS_WIN :
12931293 coloramainit ()
12941294
1295- dataToStdout (_ , forceOutput = True )
1295+ dataToStdout (result , forceOutput = True )
12961296
12971297def parsePasswordHash (password ):
12981298 """
12991299 In case of Microsoft SQL Server password hash value is expanded to its components
1300+
1301+ >>> pushValue(kb.forcedDbms)
1302+ >>> kb.forcedDbms = DBMS.MSSQL
1303+ >>> "salt: 4086ceb6" in parsePasswordHash("0x01004086ceb60c90646a8ab9889fe3ed8e5c150b5460ece8425a")
1304+ True
1305+ >>> kb.forcedDbms = popValue()
13001306 """
13011307
13021308 blank = " " * 8
13031309
1304- if not password or password == " " :
1305- password = NULL
1310+ if isNoneValue (password ) or password == " " :
1311+ retVal = NULL
1312+ else :
1313+ retVal = password
13061314
1307- if Backend .isDbms (DBMS .MSSQL ) and password != NULL and isHexEncodedString (password ):
1308- hexPassword = password
1309- password = "%s\n " % hexPassword
1310- password += "%sheader: %s\n " % (blank , hexPassword [:6 ])
1311- password += "%ssalt: %s\n " % (blank , hexPassword [6 :14 ])
1312- password += "%smixedcase: %s\n " % (blank , hexPassword [14 :54 ])
1315+ if Backend .isDbms (DBMS .MSSQL ) and retVal != NULL and isHexEncodedString (password ):
1316+ retVal = "%s\n " % password
1317+ retVal += "%sheader: %s\n " % (blank , password [:6 ])
1318+ retVal += "%ssalt: %s\n " % (blank , password [6 :14 ])
1319+ retVal += "%smixedcase: %s\n " % (blank , password [14 :54 ])
13131320
1314- if not Backend . isVersionWithin (( "2005" , "2008" )) :
1315- password += "%suppercase: %s" % (blank , hexPassword [54 :])
1321+ if password [ 54 :] :
1322+ retVal += "%suppercase: %s" % (blank , password [54 :])
13161323
1317- return password
1324+ return retVal
13181325
13191326def cleanQuery (query ):
13201327 """
0 commit comments