Beispiel #1
0
    def _add_iana(self):

        iana_conf_file = "{0}/components/iana/iana_config.json".format(
            os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
        if os.path.isfile(iana_conf_file):
            iana_config = json.loads(open(iana_conf_file).read())
            dns_iana = IanaTransform(iana_config["IANA"])

            dns_qry_class_index = self._conf["dns_results_fields"][
                "dns_qry_class"]
            dns_qry_type_index = self._conf["dns_results_fields"][
                "dns_qry_type"]
            dns_qry_rcode_index = self._conf["dns_results_fields"][
                "dns_qry_rcode"]
            self._dns_scores = [
                conn + [
                    dns_iana.get_name(conn[dns_qry_class_index],
                                      "dns_qry_class")
                ] +
                [dns_iana.get_name(conn[dns_qry_type_index], "dns_qry_type")] +
                [
                    dns_iana.get_name(conn[dns_qry_rcode_index],
                                      "dns_qry_rcode")
                ] for conn in self._dns_scores
            ]

        else:
            self._dns_scores = [
                conn + ["", "", ""] for conn in self._dns_scores
            ]
Beispiel #2
0
    def _add_iana(self):

        iana_conf_file = "{0}/components/iana/iana_config.json".format(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
        if os.path.isfile(iana_conf_file):
            iana_config  = json.loads(open(iana_conf_file).read())
            proxy_iana = IanaTransform(iana_config["IANA"])
            proxy_rcode_index = self._conf["proxy_score_fields"]["respcode"]
            self._proxy_scores = [ conn + [ proxy_iana.get_name(conn[proxy_rcode_index],"proxy_http_rcode")] for conn in self._proxy_scores ]
        else:
            self._proxy_scores = [ conn + [""] for conn in self._proxy_scores ]
Beispiel #3
0
    def _add_iana(self):
        iana_conf_file = "{0}/components/iana/iana_config.json".format(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
        if os.path.isfile(iana_conf_file):
            iana_config  = json.loads(open(iana_conf_file).read())
            dns_iana = IanaTransform(iana_config["IANA"])

            dns_qry_class_index = self._conf["dns_results_fields"]["dns_qry_class"]
            dns_qry_type_index = self._conf["dns_results_fields"]["dns_qry_type"]
            dns_qry_rcode_index = self._conf["dns_results_fields"]["dns_qry_rcode"]
            self._dns_scores = [ conn + [ dns_iana.get_name(conn[dns_qry_class_index],"dns_qry_class")] + [dns_iana.get_name(conn[dns_qry_type_index],"dns_qry_type")] + [dns_iana.get_name(conn[dns_qry_rcode_index],"dns_qry_rcode")] for conn in self._dns_scores ]
            
        else:            
            self._dns_scores = [ conn + ["","",""] for conn in self._dns_scores ]