Before we dive into specific things that you can do with the CLI here are a few general tips:
All commands accept the -h
flag to see the help information.
Running a command without arguments will also show you the help information. For example, try running the command shodan
You can confirm that you're on the latest version of the CLI by running shodan version
and making sure it matches the version listed on PyPi. Before emailing Shodan support please make sure that you are using the latest version of the CLI.
If your search query contains quotes then you need to wrap the query in an additional set of quotes when using the CLI. For example, a search query such as city:"San Diego"
would become 'city:"San Diego"'
. Otherwise city:"San Diego"
would get sent as a search query of city:San Diego
to the Shodan API which will get you very different results.
Banners contain a lot of data and most of it is stored in nested properties. Nested properties can be accessed in the CLI by separating them with a .
character. For example, the title of a website is stored in the http.title
property that looks like this in the banner data:
{
'http': {
'title': 'Index of /'
}
}
To grab that information in the CLI you would ask for the http.title property.