Skip to content

jim3/go-shodan-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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. 😸

Installation & Usage

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

Pre-requisites

  • 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"

Flags

  • -iplookup : Returns all services found on a given host IP.
  • -search : A query string to search the database of banners in Shodan.

Example output using tablewriter

 go run . -iplookup "8.8.8.8"      
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   IP    β”‚     CITY      β”‚  PORTS  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 8.8.8.8 β”‚ Mountain View β”‚ 443, 53 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

About

CLI app that calls the Shodan API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages