shodan

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BaseUrl = "https://api.shodan.io"
View Source
const ExceptionStatement string = "Missing search term and/or API key"

Variables

This section is empty.

Functions

func ArgCheck

func ArgCheck()

func TestGoogle

func TestGoogle()

Types

type APIInfo

type APIInfo struct {
	QueryCredits int    `json:"query_credits"`
	ScanCredits  int    `json:"scan_credits"`
	Telnet       bool   `json:"telnet"`
	Plan         string `json:"plan"`
	HTTPS        bool   `json:"https"`
	Unlocked     bool   `json:"unlocked"`
}

type Client

type Client struct {
	ApiKey string
}

func New

func New(apiKey string) *Client

func (*Client) APIInfo

func (s *Client) APIInfo() (*APIInfo, error)

func (*Client) Credits

func (s *Client) Credits()

func (*Client) HostIpPortSearch

func (s *Client) HostIpPortSearch()

func (*Client) HostSearch

func (s *Client) HostSearch(q string) (*HostSearch, error)

func (*Client) KeyCheck

func (s *Client) KeyCheck()

func (*Client) SetFlagShodanKey

func (a *Client) SetFlagShodanKey(fs *flag.FlagSet)

type Host

type Host struct {
	OS        string       `json:"os"`
	TimeStamp string       `json:"timestamp"`
	ISP       string       `json:"isp"`
	ASN       string       `json:"asn"`
	Hostnames []string     `json:"hostnames"`
	Location  HostLocation `json:"location"`
	IP        int64        `json:"ip"`
	Domains   []string     `json:"domains"`
	Org       string       `json:"org"`
	Data      string       `json:"data"`
	Port      int          `json:"port"`
	IPString  string       `json:"ip_str"`
}

type HostLocation

type HostLocation struct {
	City         string  `json:"city"`
	RegionCode   string  `json:"region_code"`
	AreaCode     int     `json:"area_code"`
	Longitude    float32 `json:"longitude"`
	CountryCode3 string  `json:"country_code3"`
	CountryName  string  `json:"country_name"`
	PostalCode   string  `json:"postal_code"`
	DMACode      int     `json:"dma_code"`
	CountryCode  string  `json:"country_code"`
	Latitude     float32 `json:"latitude"`
}

type HostSearch

type HostSearch struct {
	Matches []Host `json:"matches"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL