Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hrbrmstr/shodan

:new_moon: R package to work with the Shodan API
https://github.com/hrbrmstr/shodan

r r-cyber rstats shodan shodan-api

Last synced: 2 months ago
JSON representation

:new_moon: R package to work with the Shodan API

Awesome Lists containing this project

README

        

---
output: rmarkdown::github_document
editor_options:
chunk_output_type: console
---
![](shodan.png)

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

shodan is an R package interface to the [Shodan API](https://developer.shodan.io/api/requirements).

NOTE that the [Shodan Streaming API](https://developer.shodan.io/api/stream) function are _not_ implemented.

Also, most of the functions return `list` data structures given the nested structure of the Shodan query results. Functions like `shodan_ports()` will sanely return simple vectors and others like `shodan_protocols()` will return plain `data.frames`. I am _very_ open to collaboration to ensure the return types are as useful to callers. File an issue or e-mail/tweet me if interested.

The package expects `SHODAN_API_KEY` to be in the environment and the easiest way to do that is to stick it in your `.Renviron` file.

The following functions are implemented:

- `account_profile`: Account Profile
- `api_info`: API Plan Information
- `honeyscore` : Honeyport or not?
- `host_count`: Search Shodan without Results
- `host_info`: Host Information
- `my_ip`: My IP Address
- `query_tags`: List the most popular tags
- `resolve`: DNS Lookup
- `reverse`: Reverse DNS Lookup
- `shodan_api_key`: Get or set SHODAN_API_KEY value
- `shodan_exploit_search`: Search for Exploits
- `shodan_exploit_search_count`: Search for Exploits without Results
- `shodan_ports`: List all ports that Shodan is crawling on the Internet.
- `shodan_protocols`: List all protocols that can be used when performing on-demand Internet scans via Shodan.
- `shodan_query_list`: List the saved search queries
- `shodan_query_search`: Search the directory of saved search queries.
- `shodan_scan`: Request Shodan to crawl an IP/ netblock
- `shodan_scan_internet`: Crawl the Internet for a specific port and protocol using Shodan
- `shodan_search`: Search Shodan
- `shodan_search_tokens`: Break the search query into tokens
- `shodan_services`: List all services that Shodan crawls

## Installation

```{r eval=FALSE}
devtools::install_github("hrbrmstr/shodan")
```

```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}
options(width=120)
```

## Usage

```{r fo_sho, cache=TRUE, message=FALSE, warning=FALSE}
library(shodan)
library(tibble) # for printing

# current verison
packageVersion("shodan")

shodan_ports()

shodan_protocols()

resolve("google.com")

reverse("172.217.3.110")

query_tags()$matches

shodan_query_list()$matches
```

### Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md).
By participating in this project you agree to abide by its terms.