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
.bashrcor.zshrcfile.
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 β
βββββββββββ΄ββββββββββββββββ΄ββββββββββ