def __init__(self, **attributes):
if attributes.get('json', False):
attributes = attributes['json']
self.dataType = attributes.get('dataType', None)
self.message = attributes.get('message', None)
self.tlp = attributes.get('tlp', 2)
self.tags = attributes.get('tags', [])
self.ioc = attributes.get('ioc', False)
data = attributes.get('data', [])
if self.dataType == 'file':
self.data = [{'attachment': (os.path.basename(data[0]), open(data[0], 'rb'), magic.Magic(mime=True).from_file(data[0]))}]
else:
self.data = data
评论列表
文章目录