ns3777k / go-shodan Goto Github PK
View Code? Open in Web Editor NEWShodan API client
License: MIT License
Shodan API client
License: MIT License
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",
...
...
...
...
go
version are you using? go version go1.9.3 darwin/amd64
go-shodan
version? yesclient.GetServicesForHost("2600:1802:12::1", nil)
Shodan starts providing free API for making geo dns queries and pings - https://geonet.shodan.io/ . Need to implement this ๐
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!
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
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"`
go
version are you using?go version go1.9.2
go-shodan
version?import github.com/ns3777k/go-shodan/shodan
$ 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
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!
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'
}
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?
go
version are you using? 1.10go-shodan
version? yes// you code here
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."}
Implement alert trigger api
Manage Organization API was added a while ago, so would be cool to have this implemented.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.