def command_unsetg(self, *args, **kwargs): key, _, value = args[0].partition(' ') try: del GLOBAL_OPTS[key] except KeyError: utils.print_error("You can't unset global option '{}'.\n" "Available global options: {}".format(key, GLOBAL_OPTS.keys())) else: utils.print_success({key: value})
def shell(self, sock): print_status("Waiting for reverse shell...") client, addr = sock.accept() sock.close() print_status("Connection from {}:{}".format(addr[0], addr[1])) print_success("Enjoy your shell") t = telnetlib.Telnet() t.sock = client t.interact()
def command_set(self, *args, **kwargs): key, _, value = args[0].partition(' ') if key in self.current_module.options: setattr(self.current_module, key, value) if kwargs.get("glob", False): GLOBAL_OPTS[key] = value utils.print_success({key: value}) else: utils.print_error("You can't set option '{}'.\n" "Available options: {}".format(key, self.current_module.options))
def command_check(self, *args, **kwargs): try: result = self.current_module.check() except Exception as error: utils.print_error(error) else: if result is True: utils.print_success("Target is vulnerable") elif result is False: utils.print_error("Target is not vulnerable") else: utils.print_status("Target could not be verified")