Giter Club home page Giter Club logo

ripe's Introduction

Ripe Database Parser

This script parses the ARIN/APNIC/LACNIC/AfriNIC/RIPE databases into a local PostgreSQL database.

Installation of needed packages (Example on Ubuntu 16.04):

apt install postgresql python3 python3-netaddr python3-psycopg2 python3-sqlalchemy

- or -

apt install postgresql python3 python-pip
pip install -r requirements.txt

Create PostgreSQL database (Use "ripe" as password):

sudo -u postgres createuser --pwprompt --createdb ripe
sudo -u postgres createdb --owner=ripe ripe

Prior to starting this script you need to download the database dumps from the following URLs and place it in this directory:

wget ftp://ftp.afrinic.net/pub/dbase/afrinic.db.gz

wget ftp://ftp.apnic.net/pub/apnic/whois/apnic.db.inetnum.gz
wget ftp://ftp.apnic.net/pub/apnic/whois/apnic.db.inet6num.gz

wget ftp://ftp.arin.net/pub/rr/arin.db

wget ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest

wget ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz
wget ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz

- or simply -

./download_dumps.sh

After importing you can lookup an IP address like:

SELECT block.inetnum, block.country, block.description FROM block WHERE block.inetnum >> '2001:db8::1' ORDER BY block.inetnum DESC LIMIT 1;

- or simply -

./query_ripe_db.sh 192.0.2.1

TO-DO:

  • ARIN DB seems to be not very complete
  • LACNIC DB is missing owner-info

ripe's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.