From a4f238f33d6932ca2c6c1acd7e675517fda868d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 26 Nov 2021 12:42:40 -0500 Subject: [PATCH] new: Defang URLs in email notifications Fix #291 --- lookyloo/lookyloo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 88714073..c8fddb64 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -16,6 +16,7 @@ from typing import (Any, Dict, Iterable, List, MutableMapping, Optional, Set, from uuid import uuid4 from zipfile import ZipFile +from defang import defang from har2tree import CrawledTree, HostNode, URLNode from PIL import Image # type: ignore from pymisp import MISPAttribute, MISPEvent, MISPObject @@ -387,10 +388,10 @@ class Lookyloo(): initial_url = '' cache = self.capture_cache(capture_uuid) if cache: - initial_url = cache.url + initial_url = defang(cache.url, colon=True, all_dots=True) if cache.redirects: redirects = "Redirects:\n" - redirects += '\n'.join(cache.redirects) + redirects += defang('\n'.join(cache.redirects), colon=True, all_dots=True) else: redirects = "No redirects."