This guide will show how to convert a Shodan data file to an Excel spreadsheet using the Shodan CLI.
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
Shodan data files can be obtained from a variety of locations:
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
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!
The spreadsheet will have 2 workbooks:
Here is a video that shows all the previous steps: