From 795777b7c5ba8ec7bd1abdba334b41b9d00e536b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 28 Nov 2015 22:44:42 +0100 Subject: [PATCH] Minor patch --- lib/takeover/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/takeover/web.py b/lib/takeover/web.py index 2aefba410..9da5bcbcb 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -257,9 +257,9 @@ class Web: self.webStagerFilePath = posixpath.join(ntToPosixSlashes(directory), stagerName) handle, filename = tempfile.mkstemp() - os.fdopen(handle).close() # close low level handle (causing problems later) + os.close(handle) - with open(filename, "w+") as f: + with open(filename, "w+b") as f: _ = decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "stager.%s_" % self.webApi)) _ = _.replace("WRITABLE_DIR", utf8encode(directory.replace('/', '\\\\') if Backend.isOs(OS.WINDOWS) else directory)) f.write(_)