minor update

This commit is contained in:
Miroslav Stampar 2010-02-16 13:24:09 +00:00
parent c4951fd631
commit 0ed5ba5559

View File

@ -86,6 +86,8 @@ class Web:
return retVal return retVal
def __webFileStreamUpload(self, stream, destFileName, directory): def __webFileStreamUpload(self, stream, destFileName, directory):
stream.seek(0) #rewind
if self.webApi in ("php", "asp"): if self.webApi in ("php", "asp"):
multipartParams = { multipartParams = {
"upload": "1", "upload": "1",
@ -95,9 +97,6 @@ class Web:
page = Request.getPage(url=self.webUploaderUrl, multipart=multipartParams, raise404=False) page = Request.getPage(url=self.webUploaderUrl, multipart=multipartParams, raise404=False)
if stream:
stream.seek(0)
if "File uploaded" not in page: if "File uploaded" not in page:
warnMsg = "unable to upload the backdoor through " warnMsg = "unable to upload the backdoor through "
warnMsg += "the uploader agent on '%s'" % directory warnMsg += "the uploader agent on '%s'" % directory
@ -118,6 +117,7 @@ class Web:
query = agent.postfixQuery(query) query = agent.postfixQuery(query)
payload = agent.payload(newValue=query) payload = agent.payload(newValue=query)
page = Request.queryPage(payload) page = Request.queryPage(payload)
return page
def webInit(self): def webInit(self):
""" """
@ -169,7 +169,6 @@ class Web:
backdoorName = "backdoor.%s" % self.webApi backdoorName = "backdoor.%s" % self.webApi
backdoorStream = decloakToNamedTemporaryFile(os.path.join(paths.SQLMAP_SHELL_PATH, backdoorName + '_'), backdoorName) backdoorStream = decloakToNamedTemporaryFile(os.path.join(paths.SQLMAP_SHELL_PATH, backdoorName + '_'), backdoorName)
backdoorContent = backdoorStream.read() backdoorContent = backdoorStream.read()
backdoorStream.seek(0)
uploaderName = "uploader.%s" % self.webApi uploaderName = "uploader.%s" % self.webApi
uploaderContent = decloak(os.path.join(paths.SQLMAP_SHELL_PATH, uploaderName + '_')) uploaderContent = decloak(os.path.join(paths.SQLMAP_SHELL_PATH, uploaderName + '_'))