Performing IP address geolocation
Identifying the location of an IP address may help system administrators or threat intelligence analysts identify the origin of a network connection. Nmap ships with several NSE scripts that help us perform geolocation of a remote IP address: ip-geolocation-maxmind
, ip-geolocation-ipinfodb
, ip-geolocation-geoplugin
, ip-geolocation-map-bing
, ip-geolocation-map-google
, and ip-geolocation-map-kml
.
This recipe will show you how to set up and use the geolocation scripts included with NSE.
Getting ready
From the scripts mentioned previously, only ip-geolocation-geoplugin
does not require an API key. The ip-geolocation-maxmind
script depends on a database that is not included in Nmap by default. Sign up and download Maxmind's GeoLite City database from http://dev.maxmind.com/geoip/legacy/geolite/ and place it in your local Nmap data
folder (/nselib/data/
). Note that the database format has changed, and it is no longer a plaintext .dat
file....