'Execute the current plugin'

def do_execute(self, input):

    session = None
    self.io.newline()
    inputList = input.strip().split()
    if (len(inputList) > 0):
        consolemode = inputList[0].lower()
        consolemode = util.convert_consolemode(consolemode)
    else:
        consolemode = 0
    plugin = self.get_active_plugin()
    self.io.print_warning(('Preparing    to    Execute    %s' % plugin.name))
    if (plugin.validate(self.session.get_dirs(), globalvars=self.fb.fbglobalvars) and plugin.isValid()):
        plugin_desc = plugin.getSessionDescription()
        redirid = self.fb.redirection.pre_exec(plugin)
        try:
            if redirid:
                self.fb.redirection.print_session(redirid)
                self.io.print_warning('Verify    Redirection    Tunnels    Exist')
                self.io.prompt_confirm_redir()
            self.exe_print_params(plugin, redirid)
            self.io.prompt_continue()
            self.io.print_msg('Executing    Plugin')
            if self.fb.log:
                self.fb.log[plugin.name] = self.fb.log.launch_from_command('execute', plugin.getName(), plugin.getConfigVersion()).start()
            session = self.session.add_item(plugin.getName(), plugin_desc)
            (newwindow, logfile) = plugin.execute(session, consolemode, self.fb.is_interactive(), self.fb.is_scripted(), globalvars=self.fb.fbglobalvars, runMode='FB')
        except Exception as e:
            self.io.print_error('Error    running    plugin:    {0}'.format(e))
            newwindow = False
            session = None
        finally:
            self.fb.redirection.post_exec(plugin, redirid)
            if (self.fb.log and (plugin.name in self.fb.log)):
                try:
                    try:
                        session
                    except:
                        pass
                    else:
                        if ('Project' in self.fb.fbglobalvars):
                            self.fb.log[plugin.name].set(project_name=self.fb.fbglobalvars['Project'])
                        self.fb.log[plugin.name].queue(**dict(([(k, v) for (k, v) in session.history.params.values()] + [(v[0], v[1]) for v in session.contract.params.values()])))
                        if session.is_failed():
                            parent = self.fb.log[plugin.name].failed_exploit()
                        else:
                            parent = self.fb.log[plugin.name].successful_exploit()
                        self.fb.log[plugin.name].file_from_path(logfile, parent)
                except:
                    if self.fb.log:
                        self.fb.log.notify_of_error(('Recording    use    of    ' + str(plugin.name)))
        if newwindow:
            self.io.print_warning('Plugin    Spawned    in    New    Console    -    Running    Detached')
        elif (session and (not session.is_failed())):
            self.io.print_success(('%s    Succeeded' % plugin.name))
            if plugin.createsRendezvous():
                self.io.newline()
                self.io.print_warning('Connection    to    Target    Established')
                self.io.print_warning('Waiting    For    Next    Stage')
        else:
            raise exception.CmdErr, ('%s    Failed' % plugin.name)
    else:
        raise exception.CmdErr, 'Execution    Aborted'
    self.io.newline()
