2019-03-24 11:17:59 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2021-06-12 12:13:23 +02:00
|
|
|
from generator import process_stream, get_version, write_to_file, consolidate_networks
|
2019-03-24 11:17:59 +01:00
|
|
|
|
|
|
|
|
2020-07-21 13:42:50 +02:00
|
|
|
def process(url, dst):
|
|
|
|
warninglist = {
|
|
|
|
'name': 'Specialized list of {} addresses belonging to common VPN providers and datacenters'.format(dst.split('-')[1].replace('ip', 'IP')),
|
|
|
|
'version': get_version(),
|
|
|
|
'description': 'Specialized list of {} addresses belonging to common VPN providers and datacenters'.format(dst.split('-')[1].replace('ip', 'IP')),
|
2021-06-12 12:13:23 +02:00
|
|
|
'list': consolidate_networks(process_stream(url)),
|
2020-07-21 13:42:50 +02:00
|
|
|
'type': 'cidr',
|
|
|
|
'matching_attributes': ["ip-src", "ip-dst", "domain|ip"]
|
|
|
|
}
|
2019-03-24 11:17:59 +01:00
|
|
|
|
2020-07-21 13:42:50 +02:00
|
|
|
write_to_file(warninglist, dst)
|
2019-03-24 11:17:59 +01:00
|
|
|
|
|
|
|
|
2020-07-21 13:42:50 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
vpn_base_url = 'https://raw.githubusercontent.com/ejrv/VPNs/master/'
|
|
|
|
uri_list = ['vpn-ipv4', 'vpn-ipv6']
|
2019-03-24 11:17:59 +01:00
|
|
|
|
2020-07-21 13:42:50 +02:00
|
|
|
for uri in uri_list:
|
|
|
|
url = vpn_base_url + uri + '.txt'
|
|
|
|
uri.split('-')[1].replace('ip', 'IP')
|
|
|
|
process(url, uri)
|