D2sec.py 文件源码

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

项目:VIA4CVE 作者: cve-search 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号