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

Skip to content

Commit f55ad46

Browse files
committed
Use %TEMP% environment variable as temporary directory (--tmp-path overwrites this btw) folder with direct connection (-d). Via SQL injection, env variables do not work apparently
1 parent 08bf8c2 commit f55ad46

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

plugins/generic/misc.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ def __init__(self):
3939
def getRemoteTempPath(self):
4040
if not conf.tmpPath:
4141
if Backend.isOs(OS.WINDOWS):
42-
self.checkDbmsOs(detailed=True)
43-
44-
if Backend.getOsVersion() in ("2000", "NT"):
45-
conf.tmpPath = "C:/WINNT/Temp"
46-
elif Backend.getOsVersion() in ("2003", "XP"):
47-
conf.tmpPath = "C:/Documents and Settings/All Users/Application Data/TEMP"
42+
if conf.direct:
43+
conf.tmpPath = "%TEMP%"
4844
else:
49-
conf.tmpPath = "C:/Users/All Users/Application Data/TEMP"
45+
self.checkDbmsOs(detailed=True)
46+
47+
if Backend.getOsVersion() in ("2000", "NT"):
48+
conf.tmpPath = "C:/WINNT/Temp"
49+
elif Backend.getOsVersion() in ("2003", "XP"):
50+
conf.tmpPath = "C:/Documents and Settings/All Users/Application Data/TEMP"
51+
else:
52+
conf.tmpPath = "C:/Users/All Users/Application Data/TEMP"
5053
else:
5154
conf.tmpPath = "/tmp"
5255

0 commit comments

Comments
 (0)