示例#1
0
    def test_Plugin_Calls_createAndAddHost(self, monkeypatch):
        self.plugin = NessusPlugin()
        factory.register(Host)
        factory.register(Service)
        factory.register(Vuln)
        factory.register(VulnWeb)
        factory.register(Note)
        factory.register(Credential)

        pending_actions = Queue()
        self.plugin.set_actions_queue(pending_actions)
        monkeypatch.setattr(ModelBase, 'getID', lambda _: 1)
        self.plugin.processReport(self.cd + '/nessus_xml')
        actions = defaultdict(list)
        while not pending_actions.empty():
            action = self.plugin._pending_actions.get(block=True)
            actions[action[0]].append(action[1])

        assert actions[2000][0].name == "12.233.108.201"
        assert actions.keys() == [2000, 2017, 2038, 20008]
        assert len(actions[20008]) == 1
        assert len(actions[2038]) == 1

        assert actions[2038][0].name == "Nessus SYN scanner"

        assert actions[20008][0].ports == [443]
        assert actions[20008][0].name == 'https?'
        assert actions[20008][0].protocol == 'tcp'
示例#2
0
 def setUp(self):
     self.plugin = NessusPlugin()
     factory.register(Host)
     factory.register(Interface)
     factory.register(Service)
     factory.register(ModelObjectVuln)
     factory.register(ModelObjectVulnWeb)
     factory.register(ModelObjectNote)
     factory.register(ModelObjectCred)
示例#3
0
文件: nessus.py 项目: hanshaze/cbf
 def setUp(self):
     self.plugin = NessusPlugin()
     factory.register(Host)
     factory.register(Interface)
     factory.register(Service)
     factory.register(Vuln)
     factory.register(VulnWeb)
     factory.register(Note)
     factory.register(Credential)