Ejemplo n.º 1
0
    def run(self, params={}):
        IP = params.get(Input.IP)
        try:
            IP_Validate(IP)
        except Exception as e:
            raise PluginException(
                cause="Invalid IP provided by user.",
                assistance="Please try again by submitting a valid IP address.",
                data=e,
            )

        try:
            type = params.get("type")
            if not type:
                rr_history = self.connection.investigate.rr_history(IP)
            else:
                rr_history = self.connection.investigate.rr_history(IP, type)
        except Exception as e:
            raise PluginException(preset=PluginException.Preset.UNKNOWN,
                                  data=e)

        return {
            "features": [rr_history.get("features")],
            "rrs": rr_history.get("rrs")
        }
Ejemplo n.º 2
0
    def run(self, params={}):
        IP = params.get('IP')
        try:
            IP_Validate(IP)
        except Exception as e:
            self.logger.error("LatestDomains: Run: Wrong IP format")
            raise e

        try:
            latest_domains = self.connection.investigate.latest_domains(IP)
        except Exception as e:
            self.logger.error("LatestDomains: Run: Problem with request")
            raise e
        return {"domains": latest_domains}
Ejemplo n.º 3
0
    def run(self, params={}):
        IP = params.get('IP')
        try:
            IP_Validate(IP)
        except Exception as e:
            raise PluginException(
                cause='Invalid IP provided by user.',
                assistance='Please try again by submitting a valid IP address.'
            )

        try:
            latest_domains = self.connection.investigate.latest_domains(IP)
        except Exception as e:
            raise PluginException(preset=PluginException.Preset.UNKNOWN)
        return {"domains": latest_domains}
Ejemplo n.º 4
0
    def run(self, params={}):
        ip_address = params.get(Input.IP)
        try:
            IP_Validate(ip_address)
        except Exception as e:
            raise PluginException(
                cause="Invalid IP provided by user.",
                assistance="Please try again by submitting a valid IP address.",
                data=e,
            )

        try:
            latest_domains = self.connection.investigate.latest_domains(
                ip_address)
        except Exception as e:
            raise PluginException(preset=PluginException.Preset.UNKNOWN,
                                  data=e)
        return {Output.DOMAINS: latest_domains}
Ejemplo n.º 5
0
    def run(self, params={}):
        IP = params.get('IP')
        try:
            IP_Validate(IP)
        except Exception as e:
            self.logger.error("RrHistoryIp: Run: Wrong IP format")
            raise e

        try:
            type = params.get('type')
            if not type:
                rr_history = self.connection.investigate.rr_history(IP)
            else:
                rr_history = self.connection.investigate.rr_history(IP, type)
        except Exception as e:
            self.logger.error("RrHistoryIp: Run: Problem with request")
            raise e

        return {
            "features": [rr_history.get("features")],
            "rrs": rr_history.get("rrs")
        }