models.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:TheHive4py 作者: CERT-BDF 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号