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

Skip to content

Commit e3b3e05

Browse files
committed
minor update
1 parent 0d24a15 commit e3b3e05

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

lib/utils/hash.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,15 @@ def sha1_generic_passwd(password, uppercase=False):
176176
return retVal.upper() if uppercase else retVal.lower()
177177

178178
__functions__ = {
179-
HASH.MYSQL: mysql_passwd, HASH.MYSQL_OLD: mysql_old_passwd, HASH.POSTGRES: postgres_passwd,
180-
HASH.MSSQL: mssql_passwd, HASH.MSSQL_OLD: mssql_old_passwd, HASH.ORACLE: oracle_passwd,
181-
HASH.ORACLE_OLD: oracle_old_passwd, HASH.MD5_GENERIC: md5_generic_passwd, HASH.SHA1_GENERIC: sha1_generic_passwd
179+
HASH.MYSQL: mysql_passwd,
180+
HASH.MYSQL_OLD: mysql_old_passwd,
181+
HASH.POSTGRES: postgres_passwd,
182+
HASH.MSSQL: mssql_passwd,
183+
HASH.MSSQL_OLD: mssql_old_passwd,
184+
HASH.ORACLE: oracle_passwd,
185+
HASH.ORACLE_OLD: oracle_old_passwd,
186+
HASH.MD5_GENERIC: md5_generic_passwd,
187+
HASH.SHA1_GENERIC: sha1_generic_passwd
182188
}
183189

184190
def dictionaryAttack():
@@ -194,10 +200,13 @@ def dictionaryAttack():
194200
hash_ = hash_.split()[0]
195201

196202
for name, regex in getPublicTypeMembers(HASH):
203+
#hashes for Oracle and old MySQL look the same hence these checks
197204
if kb.dbms == DBMS.ORACLE and regex == HASH.MYSQL_OLD:
198205
continue
206+
199207
elif kb.dbms == DBMS.MYSQL and regex == HASH.ORACLE_OLD:
200208
continue
209+
201210
elif re.match(regex, hash_):
202211
rehash = regex
203212
infoMsg = "using hash method: '%s'" % name

0 commit comments

Comments
 (0)