All Projects → D4-project → IPASN-History

D4-project / IPASN-History

Licence: AGPL-3.0 license
IP ASN History to find ASN announcing an IP and the closest prefix announcing it at a specific date

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to IPASN-History

Ipwhois
Retrieve and parse whois data for IPv4 and IPv6 addresses
Stars: ✭ 432 (+468.42%)
Mutual labels:  ip-address
Ip2region
Ip2region is a offline IP location library with accuracy rate of 99.9% and 0.0x millseconds searching performance. DB file is ONLY a few megabytes with all IP address stored. binding for Java,PHP,C,Python,Nodejs,Golang,C#,lua. Binary,B-tree,Memory searching algorithm
Stars: ✭ 9,836 (+12842.11%)
Mutual labels:  ip-address
Ipaddress
Java library for handling IP addresses and subnets, both IPv4 and IPv6
Stars: ✭ 197 (+159.21%)
Mutual labels:  ip-address
Ip Database
🇨🇳免费IP地址数据库(纯真IP,QQwry,输出格式为国家、省、市、县、运营商),中文数据库,方便实用。
Stars: ✭ 736 (+868.42%)
Mutual labels:  ip-address
Mmm Networkscanner
A module for MagicMirror which determines the status of devices on the network based on their MAC or IP address
Stars: ✭ 85 (+11.84%)
Mutual labels:  ip-address
Ip Num
A TypeScript/JavaScript library for working with ASN, IPv4, and IPv6 numbers. It provides representations of these internet protocol numbers with the ability to perform various IP related operations like parsing, validating etc. on them
Stars: ✭ 113 (+48.68%)
Mutual labels:  ip-address
Maxminddb Golang
MaxMind DB Reader for Go
Stars: ✭ 319 (+319.74%)
Mutual labels:  ip-address
private-ip
Check if IP address is private.
Stars: ✭ 26 (-65.79%)
Mutual labels:  ip-address
Cidram
CIDRAM: Classless Inter-Domain Routing Access Manager.
Stars: ✭ 86 (+13.16%)
Mutual labels:  ip-address
Python
Official Python Library for IPinfo API (IP geolocation and other types of IP data)
Stars: ✭ 164 (+115.79%)
Mutual labels:  ip-address
Ipmonitor
IP Monitor is a simple application which monitors your public IP address for changes and lets you set different kinds of notifications such as email, audio, pop up or executing a command
Stars: ✭ 28 (-63.16%)
Mutual labels:  ip-address
Iplocation
Get ip location information.
Stars: ✭ 70 (-7.89%)
Mutual labels:  ip-address
Fcipaddressgeocoder
iOS Geocoder for geocode device IP Address location using GeoIP service(s) and a block-based syntax. 💻🌍
Stars: ✭ 114 (+50%)
Mutual labels:  ip-address
Cuteit
IP obfuscator made to make a malicious ip a bit cuter
Stars: ✭ 475 (+525%)
Mutual labels:  ip-address
IPpy
🚀 Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.
Stars: ✭ 54 (-28.95%)
Mutual labels:  ip-address
Nsot
Network Source of Truth is an open source IPAM and network inventory database
Stars: ✭ 337 (+343.42%)
Mutual labels:  ip-address
Phpipam
phpipam development repository
Stars: ✭ 1,578 (+1976.32%)
Mutual labels:  ip-address
tardis-python
Python client for tardis.dev - historical tick-level cryptocurrency market data replay API.
Stars: ✭ 88 (+15.79%)
Mutual labels:  historical-data
cs-wordpress-bouncer
CrowdSec is an open-source cyber security tool. This plugin blocks detected attackers or display them a captcha to check they are not bots.
Stars: ✭ 25 (-67.11%)
Mutual labels:  ip-address
Ip2location Go
Use IP2Location geolocation database to lookup the geolocation information with IP2Location Go Package. It can be used to determine country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type that any IP address or hostname originates from.
Stars: ✭ 142 (+86.84%)
Mutual labels:  ip-address

IP ASN History

IP ASN History is an open source project to figure out the ASN announcing an IP and the closest prefix announcing it at a specific date.

The default currently loads announces from CAIDA also RIPE dumps in MRT format.

IP ASN History is a complete open source project to run your own server locally.

If you don't want to run your own server, there is a public API operated by CIRCL.

Python client

See the PyIPASNHistory repository

API

The REST API has two entry points:

  • /meta (GET): returns meta informations about the information currently stored in the database

     {
       "sources": [
         "caida"
       ],
       "expected_interval": {
         "first": "2018-05-12",
         "last": "2018-11-08"
       },
       "cached_dates": {
         "caida": {
           "v4": {
     	"cached": [
     	  "2018-04-26T12:00:00",
     	  "2018-04-27T12:00:00",
     		  //...
     	  "2018-11-05T12:00:00",
     	  "2018-11-06T12:00:00"
     	],
     	"missing": [
     	  "2018-11-07"
     	],
     	"percent": 99.44444444444444
           },
           "v6": {
     	"cached": [
     	  "2018-04-26T12:00:00",
     	  "2018-04-27T12:00:00",
     		  //...
     	  "2018-11-06T12:00:00",
     	  "2018-11-07T12:00:00"
     	],
     	"missing": [],
     	"percent": 100.0
           }
         }
       }
     }

Note: the percentage will help 3rd party component to decide if they should query the service now or wait. It is expected to miss a few days and probably not important.

  • / (POST/GET): Runs a query. (if you want to resolve more than 1000 IPs, use mass_cache and mass_query)

    Parameters:

    • ip: (required) IP to lookup
    • source: (optional) Source to query (defaults to 'caida') - currently, only caida is supported
    • address_family: (optional) v4 or v6 (defaults to v4)
    • date: (optional) Exact date to lookup (defaults to most recent available)
    • first: (optional) First date in the interval
    • last: (optional) Last date in the interval
    • precision_delta: (optional) Max delta allowed between the date queried and the one we have in the database. Expects a dictionary to pass to timedelta. Example: {days=1, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0}

    Response:

     {
       "meta": {
         "source": "caida",
         "ip_version": "v4",
         "ip": "146.185.222.49"
       },
       "error": "Optional, only if there was an error",
       "info": "Optional, informational message if needed",
       "response": {
         "2018-11-01T12:00:00": {
           "asn": "44050",
           "prefix": "146.185.222.0/24"
         },
         "2018-11-02T16:00:00": {
           "asn": "44050",
           "prefix": "146.185.222.0/24"
         },
         "2018-11-03T12:00:00": {
           "asn": "44050",
           "prefix": "146.185.222.0/24"
         },
         "2018-11-04T12:00:00": {
           "asn": "44050",
           "prefix": "146.185.222.0/24"
         },
         "2018-11-05T12:00:00": {
           "asn": "44050",
           "prefix": "146.185.222.0/24"
         },
         "2018-11-06T12:00:00": {
           "asn": "44050",
           "prefix": "146.185.222.0/24"
         }
       }
     }

    Curl examples:

    It works fine for single requests, if you have batches of IPs to lookup, use the python API and mass_cache mass_query.

    curl https://bgpranking-ng.circl.lu/ipasn_history/?ip=8.8.8.8
    curl "https://bgpranking-ng.circl.lu/ipasn_history/?ip=2001:db8:a0b:12f0::1&address_family=v6"

    Note: The date returned may differ from the one queried: the system will figure out the closest available date to the one queried.

  • /mass_cache (POST): Caches a lot of queries at once, don't wait for the lookup.

    Parameters: A list of dictionaries with the same parameters as the default query.

    Response: A list of queries that IPASN History wasn't able to process.

    Note: Use this path when you have lots of query to run and (>1000) in order to resolve all of them at once.

  • /mass_query (POST): Caches a lot of queries at once. Either wait for the lookup to be done, or pick the data from cache.

    Parameters: A list of dictionaries with the same parameters as the default query.

    Response: A list of responses as the default query.

    Note: Use this path when you have lots of query to run and (>1000) in order to resolve all of them at once.

  • /asn_meta (POST): Returns meta informations about an ASN

    Parameters: A list of dictionaries with the same parameters as the default query.

    Response

    {
      "meta": {
      "address_family": "v4",
      "asn": "137342",
      "source": "caida"
      },
      "response": {
        "2019-01-01T12:00:00": {
          "137342": {
            "ipcount": "512",
            "prefixes": [
              "180.214.250.0/24",
              "103.113.3.0/24"
            ]
          }
        }
      }
    }

Installation

IMPORTANT: Use poetry

NOTE: Yes, it requires python3.8+. No, it will never support anything older.

Install redis

git clone https://github.com/antirez/redis.git
cd redis
git checkout 6.2
make
make test
cd ..

Note: If it fails, have a look at the documentation.

Install kvrocks

git clone https://github.com/KvrocksLabs/kvrocks.git
cd kvrocks
make -j4
cd ..

Note: If it fails, have a look at the documentation.

Install & run IP ASN History

git clone https://github.com/D4-project/IPASN-History.git
cd IPASN-History
poetry install
echo IPASNHISTORY_HOME="'`pwd`'" > .env
poetry shell
start

Shutdown IP ASN History

stop

(Optional) Build & install bgpdumpy, required to process dumps from RIPE

sudo apt install ca-certificates gcc make autoconf libbz2-dev zlib1g-dev libffi-dev
poetry install -E ripe
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].