How to Convert Shodan Data to Excel

This guide will show how to convert a Shodan data file to an Excel spreadsheet using the Shodan CLI.

Requirements

To follow along with this guide you must have the Shodan Python library installed. Most Unix-based operating systems already come with Python installed so all you need to type to install the Shodan library is:

$ pip install -U --user shodan

Step 0: Obtaining the Data File

Shodan data files can be obtained from a variety of locations:

  1. Exporting results from the website
  2. Downloading with the API
  3. Bulk data access (enterprise-only)

For the purpose of this guide we will be working with a sample of Nginx web servers that we will store in a file called nginx-sample.json.gz:

$ shodan download --limit 200 nginx-sample.json.gz product:nginx

Converting to Excel

The files end in json.gz and aren't directly readable by Excel. To convert them into a spreadsheet format we can use the shodan convert command:

$ shodan convert <data file> <file format>

Where data file is the path to the Shodan data file and file format is the desired format that should be converted to. Note that the original file is not modified in the process. The convert command creates a new file and leaves the existing data file untouched.

And now to convert our sample of Nginx results to the Excel xlsx format:

$ shodan convert nginx-sample.json.gz xlsx

After the command finishes we will have a new file called nginx-sample.xlsx which we can now load into Excel!

Convert Shodan Data to Excel

The spreadsheet will have 2 workbooks:

  1. Raw Data: the actual search results data
  2. Summary: contains an overview of the results

Here is a video that shows all the previous steps: