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

Skip to content

Commit fecd830

Browse files
committed
Minor update
1 parent 32a4f6c commit fecd830

2 files changed

Lines changed: 22 additions & 15 deletions

File tree

lib/core/common.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

12971297
def 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

13191326
def cleanQuery(query):
13201327
"""

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.8.23"
21+
VERSION = "1.3.8.24"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)