Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- import pygeoip
- gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat')
- def printRecord(tgt):
- rec = gi.record_by_name(tgt)
- city = rec['city']
- region = rec['region_name']
- country = rec['country_name']
- long = rec['longitude']
- lat = rec['latitude']
- print '[*] Target: ' + tgt + 'Geo-located. '
- print '[+] '+str(city)+', '+str(region)+', '+str(country)
- print '[+] Latitude: '+str(lat)+ ', Longitude: '+ str(long)
- tgt = '50.19.217.109'
- printRecord(tgt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement