Skip to content

chintaiann/IPTracker

Repository files navigation

IPTracker

Setup

Download directory and find it in terminal. Run docker-compose up --build

Once everything is up, visit localhost:8080/auth
Login with your Keycloak username and password ( default is admin,admin )
Create a new realm called springdemo and under import, select keycloak_export.json
Create at least one user give him the role of 'user'.

Next, we have to import data into ElasticSearch. Locate the IP2Location/Greynoise file in your directory and run. The file names have to be exactly the same.
docker cp IPv4_Elastic.csv data_setup:/setup/
docker cp Greynoise_IPv4.json data_setup:/setup/
docker cp IPv6_Elastic.csv data_setup:/setup/
docker cp Greynoise_IPv6.json data_setup:/setup/

API Endpoints

Single Query

  • URL </singleQuery/{protocol}/{ip}>

  • Method GET

  • URL Params
    Required
    protocol=[IPv4 | IPv6]
    ip=[IPv4 address]

  • Success Response { "response": { "ip": "4.2.80.1", "ip_from": 67260416, "ip_to": 67260671, "country_code": "US", "country_name": "United States of America", "region_name": "Massachusetts", "city_name": "Boston", "latitude": 42.35843, "longitude": -71.05977, "zip_code": 2108, "time_zone": "-05:00", "isp": "Level 3 Communications Inc.", "domain": "level3.com", "net_speed": "DSL", "idd_code": 1, "area_code": "617", "weather_station_code": "USMA0046", "weather_station_name": "Boston", "mcc": "-", "mnc": "-", "mobile_brand": "-", "elevation": 14, "usage_type": "ISP" } }

Test Cases HTTP Status Message
Invalid IP Format 404 IP is not of valid format.
Not found in Database 404 Sorry, IP was not found in database.

Bulk Queries

  • URL </bulkQuery/{protocol}>

  • Method POST

  • URL Params
    Required
    protocol=[IPv4 | IPv6]

  • Data Params

  • Form Data
    ipList
    e.g `ipList=4.2.80.1,4.2.80.3,1.1.1.1

  • Success Response { "response": [ { "ip": "4.2.80.1", "ip_from": 67260416, "ip_to": 67260671, "country_code": "US", "country_name": "United States of America", "region_name": "Massachusetts", "city_name": "Boston", "latitude": 42.35843, "longitude": -71.05977, "zip_code": 2108, "time_zone": "-05:00", "isp": "Level 3 Communications Inc.", "domain": "level3.com", "net_speed": "DSL", "idd_code": 1, "area_code": "617", "weather_station_code": "USMA0046", "weather_station_name": "Boston", "mcc": "-", "mnc": "-", "mobile_brand": "-", "elevation": 14, "usage_type": "ISP" }, { "ip": "4.2.80.3", "ip_from": 67260416, "ip_to": 67260671, "country_code": "US", "country_name": "United States of America", "region_name": "Massachusetts", "city_name": "Boston", "latitude": 42.35843, "longitude": -71.05977, "zip_code": 2108, "time_zone": "-05:00", "isp": "Level 3 Communications Inc.", "domain": "level3.com", "net_speed": "DSL", "idd_code": 1, "area_code": "617", "weather_station_code": "USMA0046", "weather_station_name": "Boston", "mcc": "-", "mnc": "-", "mobile_brand": "-", "elevation": 14, "usage_type": "ISP" }, { "ip": "1.1.1.1", "ip_from": 0, "ip_to": 0, "country_code": null, "country_name": null, "region_name": null, "city_name": null, "latitude": 0.0, "longitude": 0.0, "zip_code": 0, "time_zone": null, "isp": null, "domain": null, "net_speed": null, "idd_code": 0, "area_code": null, "weather_station_code": null, "weather_station_name": null, "mcc": null, "mnc": null, "mobile_brand": null, "elevation": 0, "usage_type": null } ] }

Test Cases HTTP Status Message
Invalid IP Format ( at least one ) 404 IP is not of valid format.
Not found in Database ( at least one ) 200 Response = null for that IP

Reverse Lookup

  • URL </reverseLookUp/{protocol}>

  • Method POST

  • URL Params
    Required
    protocol=[IPv4 | IPv6]

  • Data Params

  • Form Data
    country_name
    isp
    usage_type

Note: All fields must be included. If empty, put "". Isp can be a substring of full ISP name.
e.g country_name='United States of America' isp="" usage_type=""

  • Success Response { "response": [ "67261440 to 67261695", "67260682 to 67260704", "67261753 to 67261754", "67261759 to 67261764", "67261769 to 67261770",] }

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors