chg: Add comments in MISP export

pull/167/head
Raphaël Vinot 2021-02-02 12:46:48 +01:00
parent fca3290ef0
commit a68400dac7
1 changed files with 5 additions and 1 deletions

View File

@ -928,14 +928,18 @@ class Lookyloo():
lookyloo_link.distribution = 0
initial_url = URLObject(cache.url)
initial_url.comment = 'Submitted URL'
self.__misp_add_ips_to_URLObject(initial_url, ct.root_hartree.hostname_tree)
redirects: List[URLObject] = []
for url in cache.redirects:
for nb, url in enumerate(cache.redirects):
if url == cache.url:
continue
obj = URLObject(url)
obj.comment = f'Redirect {nb}'
self.__misp_add_ips_to_URLObject(obj, ct.root_hartree.hostname_tree)
redirects.append(obj)
obj.comment = f'Last redirect ({nb})'
if redirects:
prec_object = initial_url