def run(self, client_info):
        if Tasks.has_error(client_info):
            logger.debug('client data not valid')
            return

        if not Tasks.is_mobile(client_info):
            logger.debug('client is not on mobile')
            return

        address = Tasks.get_address(client_info)
        if not address:
            logger.debug('client does not have a public IP')
            return

        whatsapp_contact = Tasks.get_whatsapp_contact(client_info)
        if not whatsapp_contact:
            logger.debug('client does not have a whatsapp contact')
            return

        return ping_and_scan(remote_address = address['address'],
                             warmup = self.warmup,
                             npings = self.npings,
                             whatsapp_contact = whatsapp_contact,
                             pattern_duration = self.pattern_duration,
                             pattern_interval = self.pattern_interval,
                             zmap_binary = self.zmap_binary,
                             subnets = self.subnets,
                             nrounds = self.nrounds,
                             cooldown = self.cooldown)
Exemple #2
0
    def run(self, client_info):
        if Tasks.has_error(client_info):
            logger.debug('client data not valid')
            return

        if not Tasks.is_mobile(client_info):
            logger.debug('client is not on mobile')
            return

        address = Tasks.get_address(client_info)
        if not address:
            logger.debug('client does not have a public IP')
            return

        whatsapp_contact = Tasks.get_whatsapp_contact(client_info)
        if not whatsapp_contact:
            logger.debug('client does not have a whatsapp contact')
            return

        subnets = ['%s/%s' % (address['address'], address['mask_len'])]

        generator = Whatsapp_generator.Generator(whatsapp_contact,
                                                 self.pattern_duration,
                                                 self.pattern_interval)
        return identify(zmap_binary = self.zmap_binary,
                        subnets = subnets,
                        nrounds = self.nrounds,
                        cooldown = self.cooldown,
                        pattern_generator = generator)