def __init__(self):
self.name = SOURCE_NAME
parser = make_parser()
handler = D2secHandler()
_file, r = conf.getFeedData(SOURCE_NAME, SOURCE_FILE)
parser.setContentHandler(handler)
parser.parse(BytesIO(_file))
self.cves = defaultdict(list)
self.exploits = defaultdict(dict)
for exploit in handler.exploits:
_exploit = copy.copy(exploit) # clean exploit to add to the list
_exploit.pop('refs')
for ref in exploit.get('refs', []):
if ref['type'] == 'cve': self.cves[ref['key']].append(_exploit)
else:
if ref['key'] not in self.exploits[ref['type']]:
self.exploits[ref['type']][ref['key']] = []
self.exploits[ref['type']][ref['key']].append(_exploit)
评论列表
文章目录