Esempio n. 1
0
    def set_name(self, name):
        self._name = name

        if self.get_vulndb_id() is None:
            # This means that the plugin developer did NOT set the vuln_id via
            # kwargs, so we're going to try to get that id via VULNS
            self.set_vulndb_id(VULNS.get(name, None))

        #
        #   This section is only here for helping me debug / unittest the
        #   names used in the framework. See test_vulns.py for more info.
        #
        if not is_running_tests():
            return

        from w3af.core.data.kb.tests.test_info import MockInfo
        from w3af.core.data.kb.tests.test_vuln import MockVuln

        if isinstance(self, (MockVuln, MockInfo)):
            return

        if not is_valid_name(name):
            missing = os.path.join(ARTIFACTS_DIR, 'missing-vulndb.txt')
            missing = file(missing, 'a')
            missing.write('%s\n' % name)
            missing.close()
Esempio n. 2
0
    def set_name(self, name):
        self._name = name

        if self.get_vulndb_id() is None:
            # This means that the plugin developer did NOT set the vuln_id via
            # kwargs, so we're going to try to get that id via VULNS
            self.set_vulndb_id(VULNS.get(name, None))

        #
        #   This section is only here for helping me debug / unittest the
        #   names used in the framework. See test_vulns.py for more info.
        #
        if not is_running_tests():
            return

        from w3af.core.data.kb.tests.test_info import MockInfo
        from w3af.core.data.kb.tests.test_vuln import MockVuln

        if isinstance(self, (MockVuln, MockInfo)):
            return

        if not is_valid_name(name):
            missing = os.path.join(ARTIFACTS_DIR, 'missing-vulndb.txt')
            missing = file(missing, 'a')
            missing.write('%s\n' % name)
            missing.close()