Cleaning some (web upload based) garbage

This commit is contained in:
Miroslav Stampar
2012-12-13 13:19:47 +01:00
parent 5150172178
commit df0f08bc6a
6 changed files with 26 additions and 41 deletions

View File

@@ -545,9 +545,7 @@ class Metasploit:
else:
self.shellcodeexecLocal += "/linux/shellcodeexec.x%s" % Backend.getArch()
# TODO: until web.py's __webFileStreamUpload() method does not consider the destFileName
#__basename = "tmpse%s%s" % (self._randStr, ".exe" if Backend.isOs(OS.WINDOWS) else "")
__basename = os.path.basename(self.shellcodeexecLocal)
__basename = "tmpse%s%s" % (self._randStr, ".exe" if Backend.isOs(OS.WINDOWS) else "")
if web:
self.shellcodeexecRemote = "%s/%s" % (self.webDirectory, __basename)
@@ -559,7 +557,7 @@ class Metasploit:
logger.info("uploading shellcodeexec to '%s'" % self.shellcodeexecRemote)
if web:
self.webFileUpload(self.shellcodeexecLocal, self.shellcodeexecRemote, self.webDirectory)
self.webUpload(self.shellcodeexecRemote, self.webDirectory, filepath=self.shellcodeexecLocal)
else:
self.writeFile(self.shellcodeexecLocal, self.shellcodeexecRemote, "binary")