'Searches the kb for vulnerabilities that this plugin can exploit, this
is overloaded from AttackPlugin because I need to test for xss vulns
also. This is a "complex" plugin.
:param vuln_to_exploit: The id of the vulnerability to exploit.
:return: True if plugin knows how to exploit a found vuln.'

def can_exploit(self, vuln_to_exploit=None):

    if ((not self._listen_address) and (not self._use_XSS_vuln)):
        msg = 'You    need    to    specify    a    local    IP    address    where    w3af    can    bind    an    HTTP    server    that    can    be    reached    by    the    vulnerable    Web    application.'
        om.out.error(msg)
        return False
    rfi_vulns = kb.kb.get('rfi', 'rfi')
    if (vuln_to_exploit is not None):
        rfi_vulns = [v for v in rfi_vulns if (v.get_id() == vuln_to_exploit)]
    if (not rfi_vulns):
        return False
    usable_xss = False
    if self._use_XSS_vuln:
        usable_xss = self._verify_xss_vuln()
    if ((not self._listen_address) and (not usable_xss)):
        msg = 'You    need    to    specify    a    local    IP    address    where    w3af    can    bind    an    HTTP    server    that    can    be    reached    by    the    vulnerable    Web    application.'
        om.out.error(msg)
        return False
    if (self._listen_address and self._listen_port):
        webroot_path = os.path.join(get_home_dir(), 'webroot')
        try:
            webserver.start_webserver(self._listen_address, self._listen_port, webroot_path)
        except socket.error as se:
            msg = 'Failed    to    start    the    local    web    server    to    exploit    the    RFI    vulnerability,    the    exception    was:    "%s".'
            om.out.error((msg % se))
            return False
    return True
