GeoIPgen is a country to IP addresses generator.
Download geoipgen-0.4.tar.gz
Latest Version 0.4, 7th March 2009
License BSD
Author Andrew Horton aka urbanadventurer
⚠️ GeoIPgen version 0.4 is not currently working. The project requires an update since the GeoLite Legacy MaxMind database that GeoIPGen relies on was discontinued by MaxMind on January 2, 2019. If you installed GeoIPgen before this time you can continue to use GeoIPgen and will be unaffected except that you will be unable to update the database.
Introduction
GeoIPgen is a country-to-IPs generator. It’s a geographic IP generator for IPv4 networks that uses the MaxMind GeoLite Country database.
This is useful for enabling the accurate targeting of Internet scanning to the allocated IP v4 address space of one or more countries.
Geoipgen is the first published software that uses a geographic ip database in reverse to translate from country-to-IPs instead of the usual use of IP-to-country to produce the complete set of IP addresses for a country. Previously software has generated IP address ranges so that entire countries can be blocked by a firewall and the technique used by geoipgen has been discussed before by the GNUcitizen researchers.
Video Tutorial
Vivek Ramachandran from Security Tube has made an excellent video tutorial for geoipgen titled Geo Targeting Cyber Attacks using IP Addresses.
Usage
Installation
See the INSTALL file
How to reverse resolve a country
This can aid in testing the accuracy of the MaxMind location data by finding IP address blocks potentially attributed to the wrong country.
For example, an IP address block could be attributed to New Zealand by Maxmind’s database but when each IP is resolved is found to have many hostnames ending in .sk indicates the ip block belongs to Slovakia and MaxMind has misattributed the location data.
For fast DNS resolution, use an asynchronous resolver like adns.
How to install GNU adns
Download and follow instructions from http://www.chiark.greenend.org.uk/~ian/adns/
or use apt-get on Debian or Ubuntu Linux.
Pipe IPs to adnsresfilter and only output resolved IPs
Credits
Geoipgen is authored by Andrew Horton (urbanadventurer) andrew [at] morningstarsecurity.com.
Thanks to MaxMind for making their GeoLite Country database freely available.