示例#1
0
 def execute(self, arguments):
     arguments.no_gui = True # there is no point in deploying a full GUI agent at this point...
     
     arguments.format = self.payload_format
     
     if len(self.payloads) > 0:
         if arguments.payload == None:
             sys.stderr.write("this exploit requires a payload\n")
             return
         if not arguments.payload in self.payloads:
             sys.stderr.write("unsupported payload: " + arguments.payload + "\n")
             return
     else:
         if arguments.payload != None:
             sys.stderr.write("skipping payload, this exploit does not require one\n")
             
             arguments.payload = None
     
     arguments.server = util.parse_server(arguments.server)
     if hasattr(self, "mode"):
         arguments.mode = self.mode
     if arguments.push_server != None:
         arguments.push_server = util.parse_server(arguments.push_server)
     # generate the payload
     if arguments.payload != None:
         self.payload = self.__loader.get(arguments.payload)(None, self.__loader, self).execute(arguments)
         # if the payload is for weasel, upload weasel to the server 
         if "weasel" in arguments.payload:
             if not self.upload_weasel(arguments):
                 return
     # generate the exploit
     self.generate(arguments)
示例#2
0
    def execute(self, arguments):
        arguments.no_gui = True  # there is no point in deploying a full GUI agent at this point...

        arguments.format = self.payload_format

        if len(self.payloads) > 0:
            if arguments.payload == None:
                sys.stderr.write("this exploit requires a payload\n")
                return
            if not arguments.payload in self.payloads:
                sys.stderr.write("unsupported payload: " + arguments.payload +
                                 "\n")
                return
        else:
            if arguments.payload != None:
                sys.stderr.write(
                    "skipping payload, this exploit does not require one\n")

                arguments.payload = None

        arguments.server = util.parse_server(arguments.server)
        if hasattr(self, "mode"):
            arguments.mode = self.mode
        if arguments.push_server != None:
            arguments.push_server = util.parse_server(arguments.push_server)
        # generate the payload
        if arguments.payload != None:
            self.payload = self.__loader.get(arguments.payload)(
                None, self.__loader, self).execute(arguments)
            # if the payload is for weasel, upload weasel to the server
            if "weasel" in arguments.payload:
                if not self.upload_weasel(arguments):
                    return
        # generate the exploit
        self.generate(arguments)
示例#3
0
 def do_upload(self, arguments):
     """upload a resource to the drozer Server"""
     
     arguments.server = util.parse_server(arguments.server)
     if arguments.ssl != None and arguments.ssl == []:
         arguments.ssl = Provider().get_keypair("drozer-server")
     
     uploader.upload(arguments, arguments.resource, open(arguments.file).read(), magic=arguments.magic)
示例#4
0
 def do_delete(self, arguments):
     """delete a resource from the drozer Server"""
     
     arguments.server = util.parse_server(arguments.server)
     if arguments.ssl != None and arguments.ssl == []:
         arguments.ssl = Provider().get_keypair("drozer-server")
     
     uploader.delete(arguments, arguments.resource)
示例#5
0
    def do_delete(self, arguments):
        """delete a resource from the drozer Server"""

        arguments.server = util.parse_server(arguments.server)
        if arguments.ssl != None and arguments.ssl == []:
            arguments.ssl = Provider().get_keypair("drozer-server")

        if uploader.delete(arguments, arguments.resource):
            sys.stdout.write("Success\n")
        else:
            sys.stdout.write("Failed\n")
示例#6
0
 def do_upload(self, arguments):
     """upload a resource to the drozer Server"""
     
     arguments.server = util.parse_server(arguments.server)
     if arguments.ssl != None and arguments.ssl == []:
         arguments.ssl = Provider().get_keypair("drozer-server")
     
     if uploader.upload(arguments, arguments.resource, open(arguments.file).read(), magic=arguments.magic):
         sys.stdout.write("Success\n")
     else:
         sys.stdout.write("Failed\n")
示例#7
0
 def do_delete(self, arguments):
     """delete a resource from the drozer Server"""
     
     arguments.server = util.parse_server(arguments.server)
     if arguments.ssl != None and arguments.ssl == []:
         arguments.ssl = Provider().get_keypair("drozer-server")
     
     if uploader.delete(arguments, arguments.resource):
         sys.stdout.write("Success\n")
     else:
         sys.stdout.write("Failed\n")
示例#8
0
    def do_upload(self, arguments):
        """upload a resource to the drozer Server"""

        arguments.server = util.parse_server(arguments.server)
        if arguments.ssl != None and arguments.ssl == []:
            arguments.ssl = Provider().get_keypair("drozer-server")

        if uploader.upload(arguments,
                           arguments.resource,
                           open(arguments.file).read(),
                           magic=arguments.magic):
            sys.stdout.write("Success\n")
        else:
            sys.stdout.write("Failed\n")
示例#9
0
 def execute(self, arguments):
     """
     Implementation of the Module execute() method. Requests that the shell
     code is generated, before formatting it and printing to stdout.
     """
     
     self.__shell_code = []
     
     if not isinstance(arguments.server, tuple):
         arguments.server = util.parse_server(arguments.server)
     
     self.format = arguments.format
     self.generate(arguments)
     
     if self.format == "R":
         return self.asRaw()
     elif self.format == "U":
         return self.asUnicode()
     elif self.format == "X":
         return self.asHex()
示例#10
0
    def execute(self, arguments):
        """
        Implementation of the Module execute() method. Requests that the shell
        code is generated, before formatting it and printing to stdout.
        """

        self.__shell_code = []

        if not isinstance(arguments.server, tuple):
            arguments.server = util.parse_server(arguments.server)

        self.format = arguments.format
        self.generate(arguments)

        if self.format == "R":
            return self.asRaw()
        elif self.format == "U":
            return self.asUnicode()
        elif self.format == "X":
            return self.asHex()