Merge pull request #728 from marjatech/main

update Malpedia incl automation
This commit is contained in:
Alexandre Dulaunoy 2022-07-04 22:07:15 +02:00 committed by GitHub
commit 4638dbde86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8184 additions and 1381 deletions

File diff suppressed because it is too large Load diff

17
tools/del_duplicate_refs.py Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python3
# coding=utf-8
"""
Tool to remove duplicates in cluster references
"""
import sys
import json
with open(sys.argv[1], 'r') as f:
data = json.load(f)
for c in data['values']:
c['meta']['refs'] = list(dict.fromkeys(c['meta']['refs']))
with open(sys.argv[1], 'w') as f:
json.dump(data, f)

6
tools/fetch_malpedia.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
cd "${0%/*}"
wget -O malpedia.json https://malpedia.caad.fkie.fraunhofer.de/api/get/misp
mv malpedia.json ../clusters/malpedia.json
./del_duplicate_refs.py ../clusters/malpedia.json
(cd ..; ./jq_all_the_things.sh)