Exemplo n.º 1
0
    def _setup(cls):
        Configuration.setup(cls)
        IPSResponse.setup(cls, Log)

        cls.set_proxy_callback(
            func=Inspect.portscan
        )  # this will get called after parsing is complete.
Exemplo n.º 2
0
    def _setup(cls):
        Configuration.setup(cls)
        IPSResponse.setup(cls, Log)

        cls.set_proxy_callback(
            func=Inspect.portscan
        )  # this will get called after parsing is complete.

        Log.notice(f'{cls.__name__} initialization complete.')
Exemplo n.º 3
0
    def _portscan_reject(self, pre_detection_logging, packet, initial_block):
        if (not initial_block):
            self._IPSResponse.prepare_and_send(packet)

        else:
            IPSResponse = self._IPSResponse
            if (packet.protocol is PROTO.TCP):
                for port, seq_num in pre_detection_logging.items():
                    IPSResponse.prepare_and_send(
                        copy(packet).tcp_override(port, seq_num))

            elif (packet.protocol is PROTO.UDP):
                for port, icmp_payload in pre_detection_logging.items():
                    IPSResponse.prepare_and_send(
                        copy(packet).udp_override(icmp_payload))