mirror of
https://github.com/MISP/misp-galaxy.git
synced 2025-09-10 03:52:39 +00:00
add script to automate malpedia update
This commit is contained in:
parent
1212a75cc4
commit
587dc8560b
3 changed files with 119 additions and 10 deletions
17
tools/del_duplicate_refs.py
Executable file
17
tools/del_duplicate_refs.py
Executable 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
6
tools/fetch_malpedia.sh
Executable 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)
|
Loading…
Add table
Add a link
Reference in a new issue