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)
def do_upload(self, arguments): """upload a resource to the andsploit Server""" arguments.server = util.parse_server(arguments.server) if arguments.ssl != None and arguments.ssl == []: arguments.ssl = Provider().get_keypair("andsploit-server") uploader.upload(arguments, arguments.resource, open(arguments.file).read(), magic=arguments.magic)
def do_delete(self, arguments): """delete a resource from the andsploit Server""" arguments.server = util.parse_server(arguments.server) if arguments.ssl != None and arguments.ssl == []: arguments.ssl = Provider().get_keypair("andsploit-server") uploader.delete(arguments, arguments.resource)
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()