diff --git a/extra/icmpsh/icmpsh.exe b/extra/icmpsh/icmpsh.exe deleted file mode 100755 index 03c864ab9..000000000 Binary files a/extra/icmpsh/icmpsh.exe and /dev/null differ diff --git a/extra/icmpsh/icmpsh.exe_ b/extra/icmpsh/icmpsh.exe_ new file mode 100644 index 000000000..cd3c62e09 Binary files /dev/null and b/extra/icmpsh/icmpsh.exe_ differ diff --git a/lib/takeover/icmpsh.py b/lib/takeover/icmpsh.py index 90b506b52..366e08b48 100644 --- a/lib/takeover/icmpsh.py +++ b/lib/takeover/icmpsh.py @@ -30,7 +30,7 @@ class ICMPsh: self.rhostStr = None self.localIP = getLocalIP() self.remoteIP = getRemoteIP() - self._icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe")) + self._icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe_")) def _selectRhost(self): message = "what is the back-end DBMS address? [%s] " % self.remoteIP diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index 15c7d007e..244ca1dd5 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -6,7 +6,9 @@ See the file 'doc/COPYING' for copying permission """ import os +import tempfile +from extra.cloak.cloak import decloak from lib.core.agent import agent from lib.core.common import dataToOutFile from lib.core.common import Backend @@ -253,6 +255,15 @@ class Filesystem: def writeFile(self, localFile, remoteFile, fileType=None): self.checkDbmsOs() + if localFile.endswith("_"): + content = decloak(localFile) + _ = os.path.split(localFile[:-1])[-1] + prefix, suffix = os.path.splitext(_) + handle, localFile = tempfile.mkstemp(prefix=prefix, suffix=suffix) + os.close(handle) + with open(localFile, "w+b") as f: + f.write(content) + if conf.direct or isTechniqueAvailable(PAYLOAD.TECHNIQUE.STACKED): if isTechniqueAvailable(PAYLOAD.TECHNIQUE.STACKED): debugMsg = "going to upload the %s file with " % fileType