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