|
10 | 10 | from extra.safe2bin.safe2bin import safechardecode |
11 | 11 | from lib.core.common import dataToStdout |
12 | 12 | from lib.core.common import Backend |
| 13 | +from lib.core.common import isNoneValue |
13 | 14 | from lib.core.common import isTechniqueAvailable |
| 15 | +from lib.core.common import pushValue |
14 | 16 | from lib.core.common import readInput |
| 17 | +from lib.core.common import popValue |
15 | 18 | from lib.core.data import conf |
16 | 19 | from lib.core.data import logger |
17 | 20 | from lib.core.enums import DBMS |
18 | 21 | from lib.core.enums import PAYLOAD |
| 22 | +from lib.core.exception import sqlmapGenericException |
19 | 23 | from lib.core.exception import sqlmapUnsupportedFeatureException |
20 | 24 | from lib.core.shell import autoCompletion |
| 25 | +from lib.core.threads import getCurrentThreadData |
21 | 26 | from lib.takeover.udf import UDF |
22 | 27 | from lib.takeover.web import Web |
23 | 28 | from lib.takeover.xp_cmdshell import xp_cmdshell |
@@ -108,6 +113,19 @@ def shell(self): |
108 | 113 | infoMsg += "operating system command execution" |
109 | 114 | logger.info(infoMsg) |
110 | 115 |
|
| 116 | + threadData = getCurrentThreadData() |
| 117 | + pushValue(threadData.disableStdOut) |
| 118 | + threadData.disableStdOut = True |
| 119 | + |
| 120 | + output = self.evalCmd("echo 1") |
| 121 | + if isNoneValue(output): |
| 122 | + errMsg = "it seems that the temporary directory ('%s') used for storing " % self.getRemoteTempPath() |
| 123 | + errMsg += "console output at the back-end OS does not have " |
| 124 | + errMsg += "writing permissions for the DBMS process. You are advised " |
| 125 | + errMsg += "to manually adjust it with option '--tmp-path'" |
| 126 | + raise sqlmapGenericException, errMsg |
| 127 | + |
| 128 | + threadData.disableStdOut = popValue() |
111 | 129 | else: |
112 | 130 | errMsg = "feature not yet implemented for the back-end DBMS" |
113 | 131 | raise sqlmapUnsupportedFeatureException, errMsg |
|
0 commit comments