Learn R Programming

censys (version 0.1.0)

censys_search: Perform queries against Censys data

Description

The search endpoint allows searches against the current Censys data in the IPv4, Top Million Websites, and Certificates indexes using the same search syntax as the primary site. The endpoint returns a paginated result set of hosts (or websites or certificates) that match the search.

Usage

censys_search(index = c("ipv4", "websites", "certificates"), query, page = 1, fields = NULL)

Arguments

index
The search index to be queried. Must be one of either ipv4, websites, or certificates.
query
The query to be executed. For example, 80.http.get.headers.server: nginx.
page
The page of the result set to be returned. The number of pages in the result set is available under metadata in any request. By default, the API will return the first page of results. "1" indexed.
fields
(optional) character vector of fields you would like returned in the result set in "dot notation", e.g. location.country_code.

Value

list of information about the endpoint

Details

You must have both CENSYS_API_ID and CENSYS_API_SECRET present in the R environment for the functions in this package to work. It is highly suggested that you place those in ~/.Renviron at least for interactive work.

References

Censys search syntax: https://www.censys.io/ipv4/help; API doc: https://www.censys.io/api/v1/docs/search

Examples

Run this code
## Not run: 
# censys_search("ipv4", "80.http.get.headers.server: Apache", 2,
#               c("ip", "location.country", "autonomous_system.asn"))
# ## End(Not run)

Run the code above in your browser using DataLab