2020-04-01 12:00:55 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import requests
|
|
|
|
import json
|
|
|
|
import datetime
|
|
|
|
|
|
|
|
url = 'https://raw.githubusercontent.com/krassi/covid19-related/master/whitelist-domains.txt'
|
|
|
|
r = requests.get(url)
|
|
|
|
whitelist = r.text
|
2020-04-03 13:37:17 +02:00
|
|
|
whitelist = list(set(whitelist.split()))
|
2020-04-01 12:00:55 +02:00
|
|
|
|
|
|
|
warninglist = {
|
|
|
|
'name': 'Covid-19 Krassi\'s Whitelist',
|
|
|
|
'description': 'Krassimir\'s Covid-19 whitelist of known good Covid-19 related websites.',
|
|
|
|
'type': 'hostname',
|
|
|
|
'matching_attributes': ['domain', 'hostname', 'url'],
|
|
|
|
'version': int(datetime.date.today().strftime('%Y%m%d')),
|
2020-04-03 13:37:17 +02:00
|
|
|
'list': sorted(whitelist)
|
2020-04-01 12:00:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
with open('../lists/covid-19-krassi-whitelist/list.json', 'w+') as data_file:
|
2020-04-03 13:37:17 +02:00
|
|
|
json.dump(warninglist, data_file, indent=2, sort_keys=True)
|
2020-04-01 12:00:55 +02:00
|
|
|
|
|
|
|
url = 'https://raw.githubusercontent.com/Cyber-Threat-Coalition/goodlist/master/hostnames.txt'
|
|
|
|
r = requests.get(url)
|
|
|
|
whitelist = r.text
|
2020-04-03 13:37:17 +02:00
|
|
|
whitelist = list(set(whitelist.split()))
|
2020-04-01 12:00:55 +02:00
|
|
|
|
|
|
|
warninglist = {
|
|
|
|
'name': 'Covid-19 Cyber Threat Coalition\'s Whitelist',
|
|
|
|
'description': 'The Cyber Threat Coalition\'s whitelist of COVID-19 related websites.',
|
|
|
|
'type': 'hostname',
|
|
|
|
'matching_attributes': ['domain', 'hostname', 'url'],
|
|
|
|
'version': int(datetime.date.today().strftime('%Y%m%d')),
|
2020-04-03 13:37:17 +02:00
|
|
|
'list': sorted(whitelist)
|
2020-04-01 12:00:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
with open('../lists/covid-19-cyber-threat-coalition-whitelist/list.json', 'w+') as data_file:
|
2020-04-03 13:37:17 +02:00
|
|
|
json.dump(warninglist, data_file, indent=2, sort_keys=True)
|
2020-04-01 12:00:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|