MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / parsePasswordHash

Function parsePasswordHash

lib/core/common.py:1442–1469  ·  view source on GitHub ↗

In case of Microsoft SQL Server password hash value is expanded to its components >>> pushValue(kb.forcedDbms) >>> kb.forcedDbms = DBMS.MSSQL >>> "salt: 4086ceb6" in parsePasswordHash("0x01004086ceb60c90646a8ab9889fe3ed8e5c150b5460ece8425a") True >>> kb.forcedDbms = popValu

(password)

Source from the content-addressed store, hash-verified

1440 return retVal
1441
1442def parsePasswordHash(password):
1443 """
1444 In case of Microsoft SQL Server password hash value is expanded to its components
1445
1446 >>> pushValue(kb.forcedDbms)
1447 >>> kb.forcedDbms = DBMS.MSSQL
1448 >>> "salt: 4086ceb6" in parsePasswordHash("0x01004086ceb60c90646a8ab9889fe3ed8e5c150b5460ece8425a")
1449 True
1450 >>> kb.forcedDbms = popValue()
1451 """
1452
1453 blank = ' ' * 8
1454
1455 if isNoneValue(password) or password == ' ':
1456 retVal = NULL
1457 else:
1458 retVal = password
1459
1460 if Backend.isDbms(DBMS.MSSQL) and retVal != NULL and isHexEncodedString(password):
1461 retVal = "%s\n" % password
1462 retVal += "%sheader: %s\n" % (blank, password[:6])
1463 retVal += "%ssalt: %s\n" % (blank, password[6:14])
1464 retVal += "%smixedcase: %s\n" % (blank, password[14:54])
1465
1466 if password[54:]:
1467 retVal += "%suppercase: %s" % (blank, password[54:])
1468
1469 return retVal
1470
1471def cleanQuery(query):
1472 """

Callers 1

getPasswordHashesMethod · 0.90

Calls 3

isNoneValueFunction · 0.85
isHexEncodedStringFunction · 0.85
isDbmsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…