Implementation for an Issue #295

This commit is contained in:
Miroslav Stampar 2013-01-07 15:55:40 +01:00
parent 6270e9337b
commit ac407ae4a1
4 changed files with 12 additions and 1 deletions

Binary file not shown.

BIN
extra/icmpsh/icmpsh.exe_ Normal file

Binary file not shown.

View File

@ -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

View File

@ -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