Skip to content

Commit 83aa1ac

Browse files
committed
Implements sqlmapproject#3895
1 parent 0aa15a7 commit 83aa1ac

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

lib/core/enums.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ class HASH(object):
130130
MSSQL_NEW = r'(?i)\A0x0200[0-9a-f]{8}[0-9a-f]{128}\Z'
131131
ORACLE = r'(?i)\As:[0-9a-f]{60}\Z'
132132
ORACLE_OLD = r'(?i)\A[0-9a-f]{16}\Z'
133-
MD5_GENERIC = r'(?i)\A[0-9a-f]{32}\Z'
134-
SHA1_GENERIC = r'(?i)\A[0-9a-f]{40}\Z'
133+
MD5_GENERIC = r'(?i)\A(0x)?[0-9a-f]{32}\Z'
134+
SHA1_GENERIC = r'(?i)\A(0x)?[0-9a-f]{40}\Z'
135135
SHA224_GENERIC = r'(?i)\A[0-9a-f]{56}\Z'
136-
SHA256_GENERIC = r'(?i)\A[0-9a-f]{64}\Z'
136+
SHA256_GENERIC = r'(?i)\A(0x)?[0-9a-f]{64}\Z'
137137
SHA384_GENERIC = r'(?i)\A[0-9a-f]{96}\Z'
138-
SHA512_GENERIC = r'(?i)\A[0-9a-f]{128}\Z'
138+
SHA512_GENERIC = r'(?i)\A(0x)?[0-9a-f]{128}\Z'
139139
CRYPT_GENERIC = r'\A(?!\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z)(?![0-9]+\Z)[./0-9A-Za-z]{13}\Z'
140140
JOOMLA = r'\A[0-9a-f]{32}:\w{32}\Z'
141141
WORDPRESS = r'\A\$P\$[./0-9a-zA-Z]{31}\Z'

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.25"
21+
VERSION = "1.3.8.26"
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)

lib/utils/hash.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ def attackDumpedTable():
709709
if hash_:
710710
key = hash_ if hash_ not in replacements else replacements[hash_]
711711
lut[key.lower()] = password
712+
lut["0x%s" % key.lower()] = password
712713

713714
debugMsg = "post-processing table dump"
714715
logger.debug(debugMsg)
@@ -943,6 +944,8 @@ def dictionaryAttack(attack_dict):
943944
if hash_regex in (HASH.MD5_BASE64, HASH.SHA1_BASE64, HASH.SHA256_BASE64, HASH.SHA512_BASE64):
944945
item = [(user, encodeHex(decodeBase64(hash_, binary=True))), {}]
945946
elif hash_regex in (HASH.MYSQL, HASH.MYSQL_OLD, HASH.MD5_GENERIC, HASH.SHA1_GENERIC, HASH.SHA224_GENERIC, HASH.SHA256_GENERIC, HASH.SHA384_GENERIC, HASH.SHA512_GENERIC, HASH.APACHE_SHA1):
947+
if hash_.startswith("0x"): # Reference: https://docs.microsoft.com/en-us/sql/t-sql/functions/hashbytes-transact-sql?view=sql-server-2017
948+
hash_ = hash_[2:]
946949
item = [(user, hash_), {}]
947950
elif hash_regex in (HASH.SSHA,):
948951
item = [(user, hash_), {"salt": decodeBase64(hash_, binary=True)[20:]}]

0 commit comments

Comments
 (0)