Commit b722fb4f authored by 神楽坂玲奈's avatar 神楽坂玲奈

chnroutes

parent 522c1dd7
#!/usr/bin/env bash
if [ -d "chnroutes2" ]; then
(cd chnroutes2 && git pull)
else
git clone https://github.com/misakaio/chnroutes2.git
fi
ln -sf chnroutes2/chnroutes.txt chnroutes.txt
#pip3 install -r requirements.txt
python3 reverse.py
#!/usr/bin/env python3
from netaddr import *
universe = IPSet(['0.0.0.0/0'])
special = IPSet([line.strip() for line in open('special.txt')])
chnroutes = IPSet([line.strip() for line in open('chnroutes.txt') if not line.startswith('#')])
result = universe - special - chnroutes
for network in result.iter_cidrs():
print(network)
0.0.0.0/8
10.0.0.0/8
100.64.0.0/10
127.0.0.0/8
169.254.0.0/16
172.16.0.0/12
192.0.0.0/24
192.0.2.0/24
192.88.99.0/24
192.168.0.0/16
198.18.0.0/15
198.51.100.0/24
203.0.113.0/24
224.0.0.0/4
240.0.0.0/4
255.255.255.255
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment