From 0a21635e7f858919bd2a7f7e1831a95ed513ed0d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 26 Aug 2019 17:33:03 +0200 Subject: [PATCH] Adding a minor thing (history reasons) --- lib/core/settings.py | 2 +- lib/utils/hash.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 314d46b3c..d8f724dd6 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.8.26" +VERSION = "1.3.8.27" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index 8bd7c2aaf..72f2f2e49 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -33,6 +33,7 @@ else: import base64 import binascii import gc +import hashlib import os import re import tempfile @@ -247,6 +248,18 @@ def oracle_old_passwd(password, username, uppercase=True): # prior to version ' return retVal.upper() if uppercase else retVal.lower() +def md4_generic_passwd(password, uppercase=False): + """ + >>> md4_generic_passwd(password='testpass', uppercase=False) + '5b4d300688f19c8fd65b8d6ccf98e0ae' + """ + + password = getBytes(password) + + retVal = hashlib.new("md4", password).hexdigest() + + return retVal.upper() if uppercase else retVal.lower() + def md5_generic_passwd(password, uppercase=False): """ >>> md5_generic_passwd(password='testpass', uppercase=False)