mirror of https://github.com/MISP/mail_to_misp
better url/hostname/ip handling
parent
a59863ced9
commit
26d3384de4
|
@ -235,6 +235,10 @@ for entry in urllist:
|
|||
f.decode(entry)
|
||||
domainname = f.get_domain().decode('utf-8', 'ignore')
|
||||
hostname = f.get_host().decode('utf-8', 'ignore')
|
||||
try:
|
||||
schema = f.get_scheme().decode('utf-8', 'ignore')
|
||||
except:
|
||||
schema = False
|
||||
if debug:
|
||||
syslog.syslog(domainname)
|
||||
if domainname not in excludelist:
|
||||
|
@ -248,7 +252,8 @@ for entry in urllist:
|
|||
if debug:
|
||||
syslog.syslog(str(entry))
|
||||
if hostname:
|
||||
if is_valid_ipv4_address(entry):
|
||||
if schema:
|
||||
if is_valid_ipv4_address(hostname):
|
||||
misp.add_url(new_event, entry, category='Network activity', to_ids=False)
|
||||
else:
|
||||
misp.add_url(new_event, entry, category='Network activity', to_ids=ids_flag)
|
||||
|
|
Loading…
Reference in New Issue