본문 바로가기
2014.08.06 16:42

install geoiplookup on Mac

조회 수 2604 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print

http://blog.bolkin.net/2014/01/ip-geolocation-from-command-line-on-osx.html


IP geolocation from command line on OSX

Internet contains zillion of sites bloated with banners, which basically give you the same data: given the IP address, provide some info on where this IP is coming from.

Same basic information can be accessed from command line, here is how you configure it, assuming your OSX machine has brew/port, and can compile C source code.

This will install geoiplookup utility:
git clone https://github.com/maxmind/geoip-api-c.git
cd geoip-api-c/
autoreconf -ivf
./configure
make
sudo make install

Now we need the actual GeoIP databases that utility will use. You can buy more accurate data, but we'll use the free, less accurate for now:

cd /tmp/
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
curl -O http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz
curl -O http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
curl -O http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz

find . -name "Geo*.gz" | xargs -I {} gunzip {}
mv GeoLiteCityv6.dat GeoIPCityv6.dat
mv GeoLiteCity.dat GeoIPCity.dat

sudo mv Geo*.dat /usr/local/share/GeoIP/

Sample run:
geoiplookup 8.8.8.8

GeoIP Country Edition: US, United States
GeoIP City Edition, Rev 1: US, N/A, N/A, N/A, N/A, 38.000000, -97.000000, 0, 0
GeoIP ASNum Edition: AS15169 Google Inc.


Title
List of Articles
번호 제목 글쓴이 날짜 조회 수
20 How to Decrypt SSL and TLS Traffic using Wireshark (test with sample file) file Hojung 2015.01.23 2269
19 자바스크립트 난독화 기법 / 분석 방법론 (정리예정) Hojung 2015.01.05 1297
18 Base64 encode/decode with OpenSSL Hojung 2015.01.04 1205
17 Convert ascii to hex and vice versa (hexdump, od, xxd, echo -e) Hojung 2015.01.04 922
16 Simple ruby script to de-obfuscate with XOR string Hojung 2015.01.01 585
15 Installing yara on CentOS and test with Ruby script Hojung 2014.12.31 1761
14 Installing Yara for ruby on Mac Hojung 2014.12.31 624
13 How to find the original email sender (check X-Originating-IP or Received headers) Hojung 2014.12.29 717
12 Links for FireEye Deployment Check Hojung 2014.12.11 2293
11 Get timezone info from system logs which is /var/log/messages Hojung 2014.12.07 636
10 Analysing NTPd logs file Hojung 2014.12.07 1285
9 Sguil with tcpreplay (Security Onion) file Hojung 2014.12.01 2084
8 Wireshark settings for traffic analysis file Hojung 2014.11.29 954
7 Security Onion with Snort and Snorby (pulledpork and snort with offline pcap included) file Hojung 2014.11.24 3269
6 Snort on Ubuntu 14 (Barnyard2, PulledPork, BASE, Snort with pcap) file Hojung 2014.11.22 2947
5 How to install Snorby in Kali (snort) file Hojung 2014.11.21 7321
» install geoiplookup on Mac Hojung 2014.08.06 2604
3 DDoS 공격대응 가이드 Hojung 2014.07.29 3695
2 DDoS 분석도구 설치 및 분석 (tcpdstat, ngrep, httpry) Hojung 2014.07.25 3165
1 Perl script to push samples to Virustotal Hojung 2014.02.20 1128
Board Pagination ‹ Prev 1 Next ›
/ 1

Designed by sketchbooks.co.kr / sketchbook5 board skin

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5