Hi Richard,
Pre-Process script:
inputs.whois_query = artifact.value
Post-Process script:
def format_link(item):
if item and (item.startswith("https://") or item.startswith("http://")):
return "<a target='blank' href='{0}'>{0}</a>".format(item)
else:
return item
def expand_list(list_value, separator="<br>"):
if not isinstance(list_value, list):
return format_link(list_value)
else:
try:
items = []
for item in list_value:
if isinstance(item, dict):
items.append("<div style='padding:10px'>{}</div>".format(walk_dict(item)))
else:
items.append(format_link(item))
return separator.join(items)
except:
pass
def walk_dict(sub_dict):
notes = []
for key, value in sub_dict.items():
if key not in ['display_content']:
if isinstance(value, dict):
notes.append(u"<b>{}</b>: <div style='padding:10px'>{}</div>".format(key, walk_dict(value)))
else:
notes.append(u"<b>{}</b>: {}".format(key, expand_list(value)))
return u"<br>".join(notes)
note = u"Whois for artifact: {}<br><br>".format(artifact.value)
if results["success"]:
note = note + walk_dict(results["domain_details"])
else:
note = note + u"This Artifact has no whois information"
incident.addNote(helper.createRichText(note))
Please see attached the workflow.
Thank you.
------------------------------
Adam
------------------------------
Original Message:
Sent: Fri September 25, 2020 09:57 AM
From: Richard Giesige
Subject: fn_whois-1.0.2 error
@Adam,
From this error NoneType' object has no attribute 'items', that means that the object you are calling isn't set to anything (the variable has no value). You will need to verify that you are actually passing it the correct input for the function in the pre-process script.
If you want you can post your workflow and pre-process script for the fn_whois and I can try to help you out.
------------------------------
Richard Giesige
Security Engineer
Oshkosh Corporation
Oshkosh
------------------------------