An exercise in order to learn more about Go, the Shodan API and it's CVEDB, using the flag
package to create a simple CLI application, and have fun. 😸
git clone https://github.com/jim3/Shodan-API-Golang-Client.git
cd Shodan-API-Golang-Client
go run . -iplookup "8.8.8.8" # Host information
go run . -search "product:Apache" # Shodan search example
- A Shodan account and API key.
- Go installed on your machine. https://golang.org/dl
- Set your Shodan API key as an environment variable inside of your
.bashrc
or.zshrc
file.
export SHODAN_API_KEY="MY_API_KEY"
-iplookup
: Returns all services found on a given host IP.-search
: A query string to search the database of banners in Shodan.
go run . -iplookup "8.8.8.8"
┌─────────┬───────────────┬─────────┐
│ IP │ CITY │ PORTS │
├─────────┼───────────────┼─────────┤
│ 8.8.8.8 │ Mountain View │ 443, 53 │
└─────────┴───────────────┴─────────┘