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

Skip to content

Commit a33ee69

Browse files
committed
Minor patch
1 parent 1f05e85 commit a33ee69

3 files changed

Lines changed: 21 additions & 17 deletions

File tree

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 import six
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.6"
21+
VERSION = "1.3.5.7"
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/core/wordlist.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
from lib.core.common import getSafeExString
1212
from lib.core.exception import SqlmapDataException
1313
from lib.core.exception import SqlmapInstallationException
14+
from thirdparty import six
1415

15-
class Wordlist(object):
16+
class Wordlist(six.Iterator):
1617
"""
1718
Iterator for looping over a large dictionaries
1819
"""
@@ -63,7 +64,7 @@ def closeFP(self):
6364
self.fp.close()
6465
self.fp = None
6566

66-
def next(self):
67+
def __next__(self):
6768
retVal = None
6869
while True:
6970
self.counter += 1

lib/utils/hash.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -703,20 +703,19 @@ def attackDumpedTable():
703703
def hashRecognition(value):
704704
retVal = None
705705

706-
if six.PY2: # currently only supported on Python2
707-
isOracle, isMySQL = Backend.isDbms(DBMS.ORACLE), Backend.isDbms(DBMS.MYSQL)
706+
isOracle, isMySQL = Backend.isDbms(DBMS.ORACLE), Backend.isDbms(DBMS.MYSQL)
708707

709-
if isinstance(value, six.string_types):
710-
for name, regex in getPublicTypeMembers(HASH):
711-
# Hashes for Oracle and old MySQL look the same hence these checks
712-
if isOracle and regex == HASH.MYSQL_OLD or isMySQL and regex == HASH.ORACLE_OLD:
708+
if isinstance(value, six.string_types):
709+
for name, regex in getPublicTypeMembers(HASH):
710+
# Hashes for Oracle and old MySQL look the same hence these checks
711+
if isOracle and regex == HASH.MYSQL_OLD or isMySQL and regex == HASH.ORACLE_OLD:
712+
continue
713+
elif regex == HASH.CRYPT_GENERIC:
714+
if any((value.lower() == value, value.upper() == value)):
713715
continue
714-
elif regex == HASH.CRYPT_GENERIC:
715-
if any((value.lower() == value, value.upper() == value)):
716-
continue
717-
elif re.match(regex, value):
718-
retVal = regex
719-
break
716+
elif re.match(regex, value):
717+
retVal = regex
718+
break
720719

721720
return retVal
722721

@@ -737,7 +736,9 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
737736

738737
count += 1
739738

740-
if not isinstance(word, six.string_types):
739+
if isinstance(word, six.binary_type):
740+
word = getUnicode(word)
741+
elif not isinstance(word, six.string_types):
741742
continue
742743

743744
if suffix:
@@ -812,7 +813,9 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
812813

813814
count += 1
814815

815-
if not isinstance(word, six.string_types):
816+
if isinstance(word, six.binary_type):
817+
word = getUnicode(word)
818+
elif not isinstance(word, six.string_types):
816819
continue
817820

818821
if suffix:

0 commit comments

Comments
 (0)