shodanz 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shodanz/apis/rest.rb +1 -1
- data/lib/shodanz/apis/utils.rb +10 -5
- data/lib/shodanz/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce5bf7504f3db8b8457bc02bde8637ab2a2cf0ec7a39f69eba84655f11cdd59
|
4
|
+
data.tar.gz: 5afc67f0229d50dfbd0fa0b491595e3c104e068ffdcd994c54b3f11c08ec75a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e5db70e545fc72c0c3f31345cfdcaef3557440fc315a2bc04e5eb48a34cd548b7ad9b728d6f7024293b851fd2053ec7cf33d76ecb09f885e240ab65beb3a6a7
|
7
|
+
data.tar.gz: 82be13e3b3cc62d3f406b10fff566d6e7596065d041c93efb8542a52d202267ed75673a200c6883bb5686779c978bcb89bd372b1aea19cc80d18de3a17402a1f
|
data/lib/shodanz/apis/rest.rb
CHANGED
@@ -108,7 +108,7 @@ module Shodanz
|
|
108
108
|
#
|
109
109
|
# IP, IPs or netblocks (in CIDR notation) that should get crawled.
|
110
110
|
def scan(*ips)
|
111
|
-
post('shodan/scan', ips: ips.join(','))
|
111
|
+
post('shodan/scan', body: {ips: ips.join(',')})
|
112
112
|
end
|
113
113
|
|
114
114
|
# Use this method to request Shodan to crawl the Internet for a specific port.
|
data/lib/shodanz/apis/utils.rb
CHANGED
@@ -107,20 +107,25 @@ module Shodanz
|
|
107
107
|
resp&.close
|
108
108
|
end
|
109
109
|
|
110
|
-
def poster(path,
|
110
|
+
def poster(path, params: nil, body: nil)
|
111
111
|
# param keys should all be strings
|
112
112
|
params = params.transform_keys(&:to_s)
|
113
113
|
# and the key param is constant
|
114
114
|
params["key"] = @key
|
115
115
|
# encode as a URL string
|
116
116
|
params = URI.encode_www_form(params)
|
117
|
-
# optional JSON body string
|
118
|
-
json_body = body.nil? ? nil : JSON.dump(body)
|
119
117
|
# build URL path
|
120
|
-
path = "/#{path}?#{params}"
|
118
|
+
path = "/#{path}?#{params}"
|
119
|
+
|
120
|
+
headers = nil
|
121
|
+
|
122
|
+
if body
|
123
|
+
body = URI.encode_www_form(body)
|
124
|
+
headers = [['Content-Type', 'application/x-www-form-urlencoded']]
|
125
|
+
end
|
121
126
|
|
122
127
|
# make POST request to server
|
123
|
-
resp = @client.post(path,
|
128
|
+
resp = @client.post(path, headers, body)
|
124
129
|
|
125
130
|
if resp.success?
|
126
131
|
json = JSON.parse(resp.body.join)
|
data/lib/shodanz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shodanz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kent 'picatz' Gruber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|