Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac407ae

Browse files
committed
Implementation for an Issue #295
1 parent 6270e93 commit ac407ae

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

extra/icmpsh/icmpsh.exe

-22.6 KB
Binary file not shown.

extra/icmpsh/icmpsh.exe_

7.04 KB
Binary file not shown.

lib/takeover/icmpsh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _initVars(self):
3030
self.rhostStr = None
3131
self.localIP = getLocalIP()
3232
self.remoteIP = getRemoteIP()
33-
self._icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe"))
33+
self._icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe_"))
3434

3535
def _selectRhost(self):
3636
message = "what is the back-end DBMS address? [%s] " % self.remoteIP

plugins/generic/filesystem.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"""
77

88
import os
9+
import tempfile
910

11+
from extra.cloak.cloak import decloak
1012
from lib.core.agent import agent
1113
from lib.core.common import dataToOutFile
1214
from lib.core.common import Backend
@@ -253,6 +255,15 @@ def readFile(self, remoteFiles):
253255
def writeFile(self, localFile, remoteFile, fileType=None):
254256
self.checkDbmsOs()
255257

258+
if localFile.endswith("_"):
259+
content = decloak(localFile)
260+
_ = os.path.split(localFile[:-1])[-1]
261+
prefix, suffix = os.path.splitext(_)
262+
handle, localFile = tempfile.mkstemp(prefix=prefix, suffix=suffix)
263+
os.close(handle)
264+
with open(localFile, "w+b") as f:
265+
f.write(content)
266+
256267
if conf.direct or isTechniqueAvailable(PAYLOAD.TECHNIQUE.STACKED):
257268
if isTechniqueAvailable(PAYLOAD.TECHNIQUE.STACKED):
258269
debugMsg = "going to upload the %s file with " % fileType

0 commit comments

Comments
 (0)