diff --git a/lib/contrib/multipartpost.py b/lib/contrib/multipartpost.py index 60e5ade3b..806ba1c81 100644 --- a/lib/contrib/multipartpost.py +++ b/lib/contrib/multipartpost.py @@ -54,7 +54,7 @@ class MultipartPostHandler(urllib2.BaseHandler): try: for(key, value) in data.items(): - if type(value) == file: + if type(value) == file or hasattr(value, 'file'): v_files.append((key, value)) else: v_vars.append((key, value)) diff --git a/lib/takeover/web.py b/lib/takeover/web.py index 58e1c6c54..3e7024a61 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -24,7 +24,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os import re -from tempfile import TemporaryFile +from tempfile import NamedTemporaryFile from lib.core.agent import agent from lib.core.common import fileToStr @@ -157,7 +157,8 @@ class Web: logger.warn("invalid value, it must be 1 or 3") backdoorName = "backdoor.%s" % self.webApi - backdoorStream = TemporaryFile() + backdoorStream = NamedTemporaryFile() + backdoorStream.name = backdoorName backdoorStream.write(decloak(os.path.join(paths.SQLMAP_SHELL_PATH, backdoorName + '_'))) backdoorStream.seek(0)