MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getRemoteTempPath

Method getRemoteTempPath

plugins/generic/misc.py:38–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

36 pass
37
38 def getRemoteTempPath(self):
39 if not conf.tmpPath and Backend.isDbms(DBMS.MSSQL):
40 debugMsg = "identifying Microsoft SQL Server error log directory "
41 debugMsg += "that sqlmap will use to store temporary files with "
42 debugMsg += "commands' output"
43 logger.debug(debugMsg)
44
45 _ = unArrayizeValue(inject.getValue("SELECT SERVERPROPERTY('ErrorLogFileName')", safeCharEncode=False))
46
47 if _:
48 conf.tmpPath = ntpath.dirname(_)
49
50 if not conf.tmpPath:
51 if Backend.isOs(OS.WINDOWS):
52 if conf.direct:
53 conf.tmpPath = "%TEMP%"
54 else:
55 self.checkDbmsOs(detailed=True)
56
57 if Backend.getOsVersion() in ("2000", "NT"):
58 conf.tmpPath = "C:/WINNT/Temp"
59 elif Backend.isOs("XP"):
60 conf.tmpPath = "C:/Documents and Settings/All Users/Application Data/Temp"
61 else:
62 conf.tmpPath = "C:/Windows/Temp"
63 else:
64 conf.tmpPath = "/tmp"
65
66 if re.search(r"\A[\w]:[\/\\]+", conf.tmpPath, re.I):
67 Backend.setOs(OS.WINDOWS)
68
69 conf.tmpPath = normalizePath(conf.tmpPath)
70 conf.tmpPath = ntToPosixSlashes(conf.tmpPath)
71
72 singleTimeDebugMessage("going to use '%s' as temporary files directory" % conf.tmpPath)
73
74 hashDBWrite(HASHDB_KEYS.CONF_TMP_PATH, conf.tmpPath)
75
76 return conf.tmpPath
77
78 def getVersionFromBanner(self):
79 if "dbmsVersion" in kb.bannerFp:

Callers 8

_xpCmdshellTestMethod · 0.80
osCmdMethod · 0.80
osShellMethod · 0.80
osPwnMethod · 0.80
osBofMethod · 0.80
_regInitMethod · 0.80
stackedWriteFileMethod · 0.80
stackedReadFileMethod · 0.80

Calls 12

unArrayizeValueFunction · 0.90
normalizePathFunction · 0.90
ntToPosixSlashesFunction · 0.90
singleTimeDebugMessageFunction · 0.90
hashDBWriteFunction · 0.90
isDbmsMethod · 0.80
debugMethod · 0.80
isOsMethod · 0.80
getOsVersionMethod · 0.80
setOsMethod · 0.80
checkDbmsOsMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected