예제 #1
0
파일: scanner.py 프로젝트: rydzykje/aucote
    def _get_special_ports(self):
        return_value = []
        if cfg['service.scans.physical']:
            interfaces = netifaces.interfaces()

            for interface in interfaces:
                addr = netifaces.ifaddresses(interface)
                if netifaces.AF_INET not in addr:
                    continue

                port = PhysicalPort()
                port.interface = interface
                port.scan = Scan(start=time.time())
                return_value.append(port)

        return return_value
예제 #2
0
    async def call(self, *args, **kwargs):
        if not self.port:
            self.port = PhysicalPort(node=self._node)

        self.context.add_task(CiscoApisPsirtTask(
            context=self.context,
            port=self.port,
            exploits=[self.aucote.exploits.find('ciscoapis', 'psirt')]),
                              manager=TaskManagerType.QUICK)
예제 #3
0
파일: tool.py 프로젝트: rydzykje/aucote
    async def call(self, *args, **kwargs):
        if not self.port:
            self.port = PhysicalPort(node=self._node)

        self.context.add_task(CVESearchServiceTask(
            context=self.context,
            port=self.port,
            exploits=[self.aucote.exploits.find('cve-search', 'cve-search')]),
                              manager=TaskManagerType.QUICK)
예제 #4
0
class SpecialPortTest(TestCase):
    def setUp(self):
        self.physical = PhysicalPort()
        self.broadcast = BroadcastPort()

    def test_copy_physical(self):
        self.assertIsInstance(self.physical.copy(), PhysicalPort)

    def test_copy_broadcast(self):
        self.assertIsInstance(self.broadcast.copy(), BroadcastPort)
예제 #5
0
    def test_prepare_args_physical(self, cfg, cfg_cct):
        cfg_cct._cfg = cfg._cfg = {'tools': {'nmap': {'scripts_dir': ''}}}
        self.scan_task._port = PhysicalPort()
        self.scan_task._port.interface = 'wlan0'

        result = set(self.scan_task.prepare_args())
        expected = {
            '--max-rate', '1337', '--script', '--script-args', 'test_args',
            '-e', 'wlan0'
        }

        self.assertTrue(expected.issubset(result))
        self.assertTrue('+test,+test2' in result or '+test2,+test' in result)
예제 #6
0
    def test_prepare_args_scripts_args(self, cfg, cfg_cct):
        cfg_cct._cfg = cfg._cfg = {
            'tools': {
                'nmap': {
                    'scripts_dir': './test_dir/'
                }
            }
        }
        self.script2.args = 'other_args'
        self.scan_task._port = PhysicalPort()
        self.scan_task._port.interface = 'wlan0'

        result = set(self.scan_task.prepare_args())

        self.assertTrue('test_args,other_args' in result
                        or 'other_args,test_args' in result)
예제 #7
0
 def test_get_node_cpe(self):
     self.task._port = PhysicalPort(node=self.node)
     cpe = self.task.get_cpes()
     self.assertEqual(cpe, [self.node.os.cpe])
예제 #8
0
 def setUp(self):
     self.port = PhysicalPort()
     self.port.interface = 'wlan0'
예제 #9
0
 def setUp(self):
     self.physical = PhysicalPort()
     self.broadcast = BroadcastPort()
예제 #10
0
    def test_is_physical(self):
        port = PhysicalPort()

        self.assertFalse(isinstance(port, BroadcastPort))
        self.assertTrue(isinstance(port, PhysicalPort))