MaxMind's version of ASN database doesn't include overriden description (e.g. 27.100.36.0/24
) or CIDRs that are announced by multiple ASNs (e.g. 63.223.97.0/24
).
This set of scripts will get ASNs from bgp.he.net and generate (legacy) MaxMind format GeoIPASNum.dat.
- Run
bash ./new.sh
to generate all ASNum list and save toasn.txt
. - Start your socks5 proxies starting from port 60000 (60000, 60001, ...), modify TCNT in
asn_generator.py
to the proxies you have. - Run
python ./asn_generator.py
. This will generateGeoIPASNumC.csv
andGeoIPASNumCv6.csv
- Run
cat GeoIPASNumC.csv |sort -n|uniq > GeoIPASNum1.csv
- Run
cp GeoIPASNum1.csv GeoIPASNum1v6.csv && cat GeoIPASNumCv6.csv |sort -n|uniq >> GeoIPASNum1v6.csv
- Run
python ./asn_sort.py
. This will generateGeoIPASNum2.csv
- Run
python ./asn_sort.py ipv6
. This will generateGeoIPASNum2v6.csv
- Run
python ./csv2dat.py -w GeoIPASNum2.dat mmasn GeoIPASNum2.csv
. This will generateGeoIPASNum2.dat
- Run
python ./csv2dat.py -w GeoIPASNum2v6.dat mmasn6 GeoIPASNum2v6.csv
. This will generateGeoIPASNum2v6.dat
- Run
bash ./svg.sh
,bash ./svg6.sh
andbash ./flags.sh
to download other resources.
GeoIPASNum2.dat
is a IPv4 only version,GeoIPASNum2v6.dat
supports both IPv4 and IPv6.csv2dat.py
is stolen from mteodoro/mmutils.- The function to bypass browser test for bgp.he.net is deleted to prevent from bad guys XD. You should figure how it works and implement it in
ccbypass
ofasn_generator.py
. asn_sort.py
will combine ASN descriptions if they have same CIDR. If there's containing relation, it will substrate smaller block from bigger block.- Files are cached in
html
folder and will expire in 5 days.