This commit is contained in:
Miroslav Stampar 2010-02-03 14:49:28 +00:00
parent 950dba5139
commit c74b920f54
2 changed files with 11 additions and 2 deletions

View File

@ -880,6 +880,14 @@ def sanitizeAsciiString(string):
def decloakToNamedTemporaryFile(filepath, name=None): def decloakToNamedTemporaryFile(filepath, name=None):
retVal = NamedTemporaryFile() retVal = NamedTemporaryFile()
def __del__():
try:
if hasattr(retVal, 'old_name'):
retVal.name = old_name
retVal.close()
except OSError:
pass
retVal.__del__ = __del__
retVal.write(decloak(filepath)) retVal.write(decloak(filepath))
retVal.seek(0) retVal.seek(0)
if name: if name:

View File

@ -162,6 +162,9 @@ class Web:
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 + '_'))
import pdb
pdb.set_trace()
for directory in directories: for directory in directories:
# Upload the uploader agent # Upload the uploader agent
outFile = os.path.normpath("%s/%s" % (directory, uploaderName)) outFile = os.path.normpath("%s/%s" % (directory, uploaderName))
@ -200,5 +203,3 @@ class Web:
logger.info(infoMsg) logger.info(infoMsg)
break break
backdoorStream.name = backdoorStream.old_name