Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions misp_modules/modules/import_mod/email_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ def dict_handler(request: dict):
for url in urls:
if not url:
continue
url_object = URLObject(url, standalone=False)
try:
url_object = URLObject(url, standalone=False)
except ValueError:
continue
file_objects.append(url_object)
email_object.add_reference(url_object.uuid, "includes", "URL in email body")

Expand Down Expand Up @@ -344,9 +347,15 @@ def __init__(self, urls=None):

def handle_starttag(self, tag, attrs):
if tag == "a":
self.urls.append(dict(attrs).get("href"))
value = self.urls.append(dict(attrs).get("href"))
if tag == "img":
self.urls.append(dict(attrs).get("src"))
value = self.urls.append(dict(attrs).get("src"))
else:
return

# avoid references like internal cid:
if value and value.lower().startswith(("http://", "https://")):
self.urls.append(value)


def introspection():
Expand Down
Loading