Using Shodan from the Command-Line

Shodan Blog

Have you ever needed to write a quick script to download data from Shodan? Or setup a cronjob to check what Shodan found on your network recently? How about getting a list of IPs out of the Shodan API? For the times where you’d like to have easy script-friendly access to Shodan there’s now a new command-line tool appropriately called shodan.

Shodan CLI Usage


The shodan command-line interface (CLI) is packaged with the official Python library for Shodan, which means if you’re running the latest version of the library you already have access to the CLI. To install the new tool in Linux simply execute:

Or if you’re running an older version of the Shodan Python library and want to upgrade:

Once the tool is installed, you have to initialize the environment with your API key using shodan init:


At the moment, the shodan CLI supports 6 commands. Note…

View original post 430 more words