From 0702dd70b59437449bb5265e5b64adcdaaeb0949 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Wed, 11 Jul 2012 14:08:51 +0100 Subject: [PATCH] verify also that the web backdoor has been successfully uploaded --- lib/takeover/web.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/takeover/web.py b/lib/takeover/web.py index a23ece33e..ba17ab70c 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -45,7 +45,9 @@ class Web: self.webApi = None self.webBaseUrl = None self.webBackdoorUrl = None + self.webBackdoorFilePath = None self.webStagerUrl = None + self.webStagerFilePath = None self.webDirectory = None def webBackdoorRunCmd(self, cmd): @@ -215,11 +217,13 @@ class Web: localPath = directory uriPath = directory[2:] if isWindowsDriveLetterPath(directory) else directory docRoot = docRoot[2:] if isWindowsDriveLetterPath(docRoot) else docRoot + if docRoot in uriPath: uriPath = uriPath.replace(docRoot, "/") uriPath = "/%s" % normalizePath(uriPath) else: webDir = extractRegexResult(r"//[^/]+?/(?P.*)/.", conf.url) + if webDir: uriPath = "/%s" % webDir else: @@ -233,6 +237,7 @@ class Web: self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, uriPath) self.webStagerUrl = "%s/%s" % (self.webBaseUrl, stagerName) + self.webStagerFilePath = ntToPosixSlashes(normalizePath("%s/%s" % (localPath, stagerName))).replace("//", "/").rstrip('/') uplPage, _, _ = Request.getPage(url=self.webStagerUrl, direct=True, raise404=False) @@ -244,6 +249,7 @@ class Web: warnMsg += "on '%s'" % localPath logger.warn(warnMsg) warned.add(localPath) + continue elif "<%" in uplPage or "