Minor patch related to the #2487

This commit is contained in:
Miroslav Stampar 2017-04-18 16:49:58 +02:00
parent 2d05174545
commit 0340ecd38a
3 changed files with 19 additions and 4 deletions

View File

@ -3187,6 +3187,21 @@ def decodeIntToUnicode(value):
return retVal return retVal
def md5File(filename):
"""
Calculates MD5 digest of a file
Reference: http://stackoverflow.com/a/3431838
"""
checkFile(filename)
digest = hashlib.md5()
with open(filename, "rb") as f:
for chunk in iter(lambda: f.read(4096), ""):
digest.update(chunk)
return digest.hexdigest()
def checkIntegrity(): def checkIntegrity():
""" """
Checks integrity of code files during the unhandled exceptions Checks integrity of code files during the unhandled exceptions
@ -3203,7 +3218,7 @@ def checkIntegrity():
if not os.path.isfile(path): if not os.path.isfile(path):
logger.error("missing file detected '%s'" % path) logger.error("missing file detected '%s'" % path)
retVal = False retVal = False
elif hashlib.md5(open(path, 'rb').read()).hexdigest() != checksum: elif md5File(path) != checksum:
logger.error("wrong checksum of file '%s' detected" % path) logger.error("wrong checksum of file '%s' detected" % path)
retVal = False retVal = False
return retVal return retVal

View File

@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS from lib.core.enums import OS
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.1.4.33" VERSION = "1.1.4.34"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} 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) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -27,7 +27,7 @@ fc89abe14a48b8232feba692bde992be lib/controller/controller.py
310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py 310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py
d3b4e1139bf117fe4cf6451d43d8253c lib/core/agent.py d3b4e1139bf117fe4cf6451d43d8253c lib/core/agent.py
6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py 6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py
6d4efa61cbef2ff62ed457bc5c4708c3 lib/core/common.py 1ec36b759f46d8ccb1f4e1434d86b115 lib/core/common.py
5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py 5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py
a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py
7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.py 7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.py
@ -46,7 +46,7 @@ ede9841e7cbbe841f41588f149e85789 lib/core/option.py
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py 785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py 40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
a6219d0ee81bc23614150f81ccb6d8a0 lib/core/settings.py 95062a1d8876adc28b63bb987f6c0c57 lib/core/settings.py
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py 2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
92e35ddfdf0e9676dd51565bcf4fa5cf lib/core/target.py 92e35ddfdf0e9676dd51565bcf4fa5cf lib/core/target.py