Generate MaxMind format GeoIPASNum.dat from
Python Shell
Failed to load latest commit information. modify readme Jul 16, 2016 init Jul 16, 2016 fix leaking cidr in certain situation Oct 31, 2016 init Jul 16, 2016 init Jul 16, 2016 init Jul 16, 2016

GeoIPASNum Generator

MaxMind's version of ASN database doesn't include overriden description (e.g. or CIDRs that are announced by multiple ASNs (e.g.

This set of scripts will get ASNs from and generate (legacy) MaxMind format GeoIPASNum.dat.

How to use

  1. Run bash ./ to generate all ASNum list and save to asn.txt.
  2. Start your socks5 proxies starting from port 60000 (60000, 60001, ...), modify TCNT in to the proxies you have.
  3. Run python ./ This will generate GeoIPASNumC.csv
  4. Run cat GeoIPASNumC.csv |sort -n|uniq > GeoIPASNum1.csv
  5. Run python ./ This will generate GeoIPASNum2.csv
  6. Run python ./ -w GeoIPASNum.dat mmasn GeoIPASNum2.csv. This will generate GeoIPASNum.dat
  7. Run bash ./, bash ./ and bash ./ to download other resources.


  • is stolen from mteodoro/mmutils.
  • The function to bypass browser test for is deleted to prevent from bad guys XD. You should figure how it works and implement it in ccbypass of
  • 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.



See also

Set up a light weight GeoIP query server using OpenResty