From 9d3ff8b3b742123ee03b62a40481e67a55c2f87c Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Wed, 14 Jun 2023 09:21:11 +0200 Subject: [PATCH] Add excluded domain option --- iwla.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iwla.py b/iwla.py index af3e290..2cd0edf 100755 --- a/iwla.py +++ b/iwla.py @@ -52,6 +52,7 @@ Conf values needed : locales_path compress_output_files excluded_ip + excluded_domain_name Output files : DB_ROOT/meta.db @@ -155,6 +156,9 @@ class IWLA(object): self.excluded_ip = [] for ip in conf.excluded_ip: self.excluded_ip += [re.compile(ip)] + self.excluded_domain_name = [] + for domain_name in conf.excluded_domain_name: + self.excluded_domain_name += [re.compile(domain_name)] self.plugins = [(conf.PRE_HOOK_DIRECTORY , conf.pre_analysis_hooks), (conf.POST_HOOK_DIRECTORY , conf.post_analysis_hooks), (conf.DISPLAY_HOOK_DIRECTORY , conf.display_hooks)] @@ -350,7 +354,6 @@ class IWLA(object): super_hit['last_access'] = self.meta_infos['last_time'] request = hit['extract_request'] - uri = request.get('extract_uri', request['http_uri']) hit['is_page'] = self.isPage(uri) @@ -707,6 +710,11 @@ class IWLA(object): self.logger.debug("Not in domain %s" % (hit)) return False + for domain_name in self.excluded_domain_name: + if domain_name.match(hit['server_name']): + self.logger.debug("Domain name %s excluded" % (hit['server_name'])) + return False + t = self._decodeTime(hit) cur_time = self.meta_infos['last_time']