boB Rudis
4 years ago
18 changed files with 364 additions and 4 deletions
@ -0,0 +1,25 @@ |
|||
#' Search for an autonomous system |
|||
#' |
|||
#' @param asn the autonomous system number |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
asn_info <- function(asn, api_key = networksdb_api_key()) { # ipv6 |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/asn-info", |
|||
query = list( |
|||
asn = asn[1], |
|||
), |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
#' Search for the networks announced by an autonomous system |
|||
#' |
|||
#' @param asn the autonomous system number |
|||
#' @param page results pagination |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
asn_nets <- function(asn, page = 1, api_key = networksdb_api_key()) { # ipv6 |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/asn-networks", |
|||
query = list( |
|||
asn = asn[1], |
|||
page = as.integer(page[1]) |
|||
), |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
#' Perform a "mass" reverse DNS lookup to find all the domain names pointing to any IPv4 or IPv6 address in the given network |
|||
#' |
|||
#' @param ip_start,ip_end,cidr Either use `ip_start` and `ip_end` OR `cidr`; |
|||
#' @param page results pagination |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
domains_in_network <- function(ip_start, ip_end, cidr, page = 1, api_key = networksdb_api_key()) { |
|||
|
|||
if (missing(cidr)) { |
|||
|
|||
if (!all(c(!missing(ip_start)), (!missing(ip_end)))) { |
|||
stop("If `cidr` is missing, both `ip_start` and `ip_end` are required.", call.=FALSE) |
|||
} |
|||
|
|||
params <- list( |
|||
ip_start = ip_start[1], |
|||
ip_end = ip_end[1] |
|||
) |
|||
|
|||
} else { |
|||
|
|||
if (!all(c(missing(ip_start)), (missing(ip_end)))) { |
|||
stop("If `cidr` is present, both `ip_start` and `ip_end` should not be used.", call.=FALSE) |
|||
} |
|||
|
|||
params <- list( |
|||
cidr = cidr[1] |
|||
) |
|||
|
|||
} |
|||
|
|||
params$page <- as.integer(page[1]) |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/mass-reverse-dns", |
|||
query = params, |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
#' Perform a reverse DNS lookup to find all the domain names pointing to the given IPv4 or IPv6 address |
|||
#' |
|||
#' @param ip address to lookup |
|||
#' @param page pagination |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
domains_on_ip <- function(ip, page = 1, api_key = networksdb_api_key()) { # ipv6 |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/reverse-dns", |
|||
query = list( |
|||
ip = ip[1], |
|||
page = as.integer(page[1]) |
|||
), |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
#' Perform a forward DNS lookup to find all the IPv4 and IPv6 addresses pointed to by a given domain name |
|||
#' |
|||
#' @param domain domain to lookup |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
ips_for_domain <- function(domain, api_key = networksdb_api_key()) { # ipv6 |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/dns", |
|||
query = list( |
|||
domain = domain[1], |
|||
), |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
#' Request geolocation information for a given IPv4 or IPv6 Address. |
|||
#' |
|||
#' @param ip IPv4 or IPv6 address |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
ip_geo <- function(ip, api_key = networksdb_api_key()) { # ipv6 |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/ip-geo", |
|||
query = list( |
|||
ip = ip[1], |
|||
), |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
#' Search for an IPv4 or IPv6 address |
|||
#' |
|||
#' @param ip IPv4 or IPv6 address |
|||
#' @param api_key see [networksdb_api_key()] |
|||
#' @export |
|||
ip_info <- function(ip, api_key = networksdb_api_key()) { # ipv6 |
|||
|
|||
httr::GET( |
|||
url = "https://networksdb.io/api/ip-info", |
|||
query = list( |
|||
ip = ip[1], |
|||
), |
|||
httr::add_headers(`X-Api-Key` = api_key), |
|||
.NETWORKS_DB_UA |
|||
) -> res |
|||
|
|||
httr::stop_for_status(res) |
|||
|
|||
out <- httr::content(res, as = "text", encoding = "UTF-8") |
|||
|
|||
out <- jsonlite::fromJSON(out) |
|||
|
|||
out |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/as-info.R |
|||
\name{asn_info} |
|||
\alias{asn_info} |
|||
\title{Search for an autonomous system} |
|||
\usage{ |
|||
asn_info(asn, api_key = networksdb_api_key()) |
|||
} |
|||
\arguments{ |
|||
\item{asn}{the autonomous system number} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Search for an autonomous system |
|||
} |
@ -0,0 +1,18 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/asn-networks.R |
|||
\name{asn_nets} |
|||
\alias{asn_nets} |
|||
\title{Search for the networks announced by an autonomous system} |
|||
\usage{ |
|||
asn_nets(asn, page = 1, api_key = networksdb_api_key()) |
|||
} |
|||
\arguments{ |
|||
\item{asn}{the autonomous system number} |
|||
|
|||
\item{page}{results pagination} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Search for the networks announced by an autonomous system |
|||
} |
@ -0,0 +1,24 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/domains-in-network.R |
|||
\name{domains_in_network} |
|||
\alias{domains_in_network} |
|||
\title{Perform a "mass" reverse DNS lookup to find all the domain names pointing to any IPv4 or IPv6 address in the given network} |
|||
\usage{ |
|||
domains_in_network( |
|||
ip_start, |
|||
ip_end, |
|||
cidr, |
|||
page = 1, |
|||
api_key = networksdb_api_key() |
|||
) |
|||
} |
|||
\arguments{ |
|||
\item{ip_start, ip_end, cidr}{Either use \code{ip_start} and \code{ip_end} OR \code{cidr};} |
|||
|
|||
\item{page}{results pagination} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Perform a "mass" reverse DNS lookup to find all the domain names pointing to any IPv4 or IPv6 address in the given network |
|||
} |
@ -0,0 +1,18 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/domains-on-ip.R |
|||
\name{domains_on_ip} |
|||
\alias{domains_on_ip} |
|||
\title{Perform a reverse DNS lookup to find all the domain names pointing to the given IPv4 or IPv6 address} |
|||
\usage{ |
|||
domains_on_ip(ip, page = 1, api_key = networksdb_api_key()) |
|||
} |
|||
\arguments{ |
|||
\item{ip}{address to lookup} |
|||
|
|||
\item{page}{pagination} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Perform a reverse DNS lookup to find all the domain names pointing to the given IPv4 or IPv6 address |
|||
} |
@ -0,0 +1,16 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/ip-geo.R |
|||
\name{ip_geo} |
|||
\alias{ip_geo} |
|||
\title{Request geolocation information for a given IPv4 or IPv6 Address.} |
|||
\usage{ |
|||
ip_geo(ip, api_key = networksdb_api_key()) |
|||
} |
|||
\arguments{ |
|||
\item{ip}{IPv4 or IPv6 address} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Request geolocation information for a given IPv4 or IPv6 Address. |
|||
} |
@ -0,0 +1,16 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/ip-info.R |
|||
\name{ip_info} |
|||
\alias{ip_info} |
|||
\title{Search for an IPv4 or IPv6 address} |
|||
\usage{ |
|||
ip_info(ip, api_key = networksdb_api_key()) |
|||
} |
|||
\arguments{ |
|||
\item{ip}{IPv4 or IPv6 address} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Search for an IPv4 or IPv6 address |
|||
} |
@ -0,0 +1,16 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/ip-for-domain.R |
|||
\name{ips_for_domain} |
|||
\alias{ips_for_domain} |
|||
\title{Perform a forward DNS lookup to find all the IPv4 and IPv6 addresses pointed to by a given domain name} |
|||
\usage{ |
|||
ips_for_domain(domain, api_key = networksdb_api_key()) |
|||
} |
|||
\arguments{ |
|||
\item{domain}{domain to lookup} |
|||
|
|||
\item{api_key}{see \code{\link[=networksdb_api_key]{networksdb_api_key()}}} |
|||
} |
|||
\description{ |
|||
Perform a forward DNS lookup to find all the IPv4 and IPv6 addresses pointed to by a given domain name |
|||
} |
Loading…
Reference in new issue