Add some scripts to easily update some IPs lists (#1449)
While the lists ina6ff0dd0and2f5f445fare somehow provided by the companies themselves (or by some interested parties), these new lists are directly extracted from BGP information, via AS prefixes. *Usually*, these new lists are far more stable than the previous ones. TODO: * add some other ASNs (see `src/lib/ndpi_content_match.c.inc`) * IPv6, as usual :-(
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import socket
|
||||
import struct
|
||||
import netaddr
|
||||
|
||||
if len (sys.argv) == 3:
|
||||
proto = sys.argv[2]
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: mergeipaddrlist.py <file>")
|
||||
sys.exit (1)
|
||||
|
||||
ipFile = open(sys.argv[1])
|
||||
ipAddresses = list(ipFile.readlines())
|
||||
ipAddresses = sorted(ipAddresses)
|
||||
cidrs = netaddr.cidr_merge(ipAddresses)
|
||||
for cidr in cidrs:
|
||||
print(cidr)
|
||||
Reference in New Issue
Block a user