From f9489c3352e636f4e74b7cfd34ebd2b9374d338c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 4 Jul 2019 11:07:25 +0200 Subject: [PATCH] Minor patch (fixes #3795) --- lib/core/common.py | 2 +- lib/core/dump.py | 1 + lib/core/settings.py | 2 +- plugins/generic/takeover.py | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 608e2d1f3..da4d0c8a0 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3762,7 +3762,7 @@ def createGithubIssue(errMsg, excMsg): logger.info(infoMsg) try: - with open(paths.GITHUB_HISTORY, "a+b") as f: + with openFile(paths.GITHUB_HISTORY, "a+b") as f: f.write("%s\n" % key) except: pass diff --git a/lib/core/dump.py b/lib/core/dump.py index 3fd31b1fb..d49970a5f 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -620,6 +620,7 @@ class Dump(object): with open(filepath, "wb") as f: _ = safechardecode(value, True) f.write(_) + except magic.MagicException as ex: logger.debug(getSafeExString(ex)) diff --git a/lib/core/settings.py b/lib/core/settings.py index 8472d97c6..f3ca6232c 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.7.4" +VERSION = "1.3.7.5" 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/plugins/generic/takeover.py b/plugins/generic/takeover.py index 6a235efb6..8cc6f5170 100644 --- a/plugins/generic/takeover.py +++ b/plugins/generic/takeover.py @@ -10,6 +10,7 @@ import os from lib.core.common import Backend from lib.core.common import getSafeExString from lib.core.common import isStackingAvailable +from lib.core.common import openFile from lib.core.common import readInput from lib.core.common import runningAsAdmin from lib.core.data import conf @@ -137,7 +138,7 @@ class Takeover(Abstraction, Metasploit, ICMPsh, Registry): if os.path.exists(filename): try: - with open(filename, "wb") as f: + with openFile(filename, "wb") as f: f.write("1") except IOError as ex: errMsg = "there has been a file opening/writing error "