Giter Club home page Giter Club logo

go-shodan's People

Contributors

ns3777k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-shodan's Issues

GetServicesForHost fails querying a IPv6 address

Issue details and expected behavior

Error: json: cannot unmarshal string into Go struct field HostData.ip of type int64 calling client.GetServicesForHost("2600:1802:12::1", nil)

It appears that shodan is returning a string in the ip field when the IP is a IPV6 address


{
"city": null,
"region_code": null,
"os": null,
"tags": [],
"ip": "2600:1802:12::1",
"isp": null,
"area_code": null,
"dma_code": null,
"last_update": "2018-01-23T10:18:14.526523",
...
...
...
...

Environment

  1. What go version are you using? go version go1.9.3 darwin/amd64
  2. Are you using the latest go-shodan version? yes
  3. What OS are you using? OSX

Minimal reproducible demo

client.GetServicesForHost("2600:1802:12::1", nil)

HostData bug

I've ran into an issue when searching for argentina where the results contain a number in the version field and Go wants a string.

options := shodan.HostQueryOptions{
		Query: query,
	}

results, err := client.GetHostsForQuery(&options)

With query = argentina results in

json: cannot unmarshal number into Go struct field HostData.version of type string

Not really sure if this is a bug with the library or with Shodan though.

Thanks!

i swear we read the same book

im cureious about this and sorry if its a waste of time but is this built off of the Black Hat GO book, they have a section that looks exactly like this accept you made it 1000000000000000 times better XDDD

IPlong should be a Int64 instead on Int

Issue details and expected behavior

When we build a 32 bits app the max size of int is 2147483647
So address after 127.255.255.255 make an error.

A simple patch could be :

diff --git a/shodan/host.go b/shodan/host.go
index 8c4d023..5f0914b 100644
--- a/shodan/host.go
+++ b/shodan/host.go
@@ -64,7 +64,7 @@ type HostData struct {
        Hostnames    []string               `json:"hostnames"`
        Version      HostVersion            `json:"version"`
        Title        string                 `json:"title"`
-       IPLong       int                    `json:"ip"`
+       IPLong       int64                  `json:"ip"`
        IP           string                 `json:"ip_str"`
        OS           string                 `json:"os"`
        Organization string                 `json:"org"`
@@ -89,7 +89,7 @@ type HostData struct {
 type Host struct {
        OS              string      `json:"os"`
        Ports           []int       `json:"ports"`
-       IPLong          int         `json:"ip"`
+       IPLong          int64       `json:"ip"`
        IP              string      `json:"ip_str"`
        ISP             string      `json:"isp"`
        Hostnames       []string    `json:"hostnames"`

  1. What go version are you using?

go version go1.9.2

  1. Are you using the latest go-shodan version?
import github.com/ns3777k/go-shodan/shodan
  1. What OS are you using?

Minimal reproducible demo

$ git clone https://github.com/yvesago/shodan-cli.git
$ GOARCH=386 go build

$ export SHODAN=xxxxxxYourAPIkeyxxxxxxxxxxxx

$ ./shodan-cli -i 192.169.138.132
Error: json: cannot unmarshal number 3232336516 into Go struct field Host.ip of type int

Response headers

Hi,

First of all thanks for this lib.

I'm currently using your lib to retrieve network alerts through GetBannersByAlerts. Everything works fine but the response headers are not included and they could be relevant to me if they are available:

The headers contain metadata about the alert to help you understand which alert was responsible for generating the notification. Specifically, the following headers are available in the POST request:

  • SHODAN-ALERT-ID: unique ID for the alert
  • SHODAN-ALERT-NAME: name for the alert
  • SHODAN-ALERT-TRIGGER: trigger that caused the notification to get sent
  • SHODAN-SIGNATURE-SHA1: SHA1 signature encoded using your API key to validate the notification's origin

These response headers are about the webhook monitor and I wonder if the same are passed for the network alert streaming endpoint.

If so, can you include them?

Thanks!

Add scan status

At the moment there is a Scan method but not a ScanStatus method

is just a GET to /shodan/scan/{$scanID}

example of answer:

{
 'id': 'R2XRT5HH6X67PFAB',
 'count': 1,
 'status': 'PROCESSING'
}

Hostdata Struct Modification to support SSL Info

Issue details and expected behavior

Currently, unless I'm missing something, the results returned for a GetHostsForQuery call don't return any SSL banners, even though the SSL info is now a top-level property as per https://blog.shodan.io/ssl-update/

Could the HostData struct be modified to support this?

Environment

  1. What go version are you using? 1.10
  2. Are you using the latest go-shodan version? yes
  3. What OS are you using? OSX 10.13.4

Minimal reproducible demo

// you code here

Implement /dns/domain/{domain} api

Need to implement /dns/domain/{domain} api. There's also an undocumented key - subdomains which is an array of string of all subdomain keys.

404 error: {"error": "No information available for that domain."}

Manage Organization API

Manage Organization API was added a while ago, so would be cool to have this implemented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.