fofa 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fofa.rb +3 -1
- data/lib/fofa/version.rb +7 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3702c8e5ab5d5135d9fbb5a704d664a5e1204ae3
|
4
|
+
data.tar.gz: 84e1115974c19064259ee09203955b018721098c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d311b9c353802d07313c945b7a1d89e06dac4cc794d2a34b486b42ae9f90a69c3eb66bb6df79ade84c13c71ae1efbdac711ff09118daefb9d1ec8ebd8f27890
|
7
|
+
data.tar.gz: 05dafa6ddca51d34bc9a9723e83762b4a2e7aaca0bd31f012220d8ec5171394f7b12dc93f18bc8a683cde3061d8bba64ef337dd99453a4d9c563f58957963a60
|
data/Gemfile.lock
CHANGED
data/lib/fofa.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "fofa/version"
|
2
2
|
require 'net/http'
|
3
3
|
require 'json'
|
4
|
+
require 'base64'
|
4
5
|
|
5
6
|
module Fofa
|
6
7
|
class API
|
@@ -29,7 +30,7 @@ module Fofa
|
|
29
30
|
options = {page:1, size:100, fields:'host'}.merge(options)
|
30
31
|
|
31
32
|
url = "#{@api_server}/api/v1/search/all?key=#{@apikey}&email=#{@email}&page=#{options[:page]}&size=#{options[:size]}&fields=#{options[:fields]}"
|
32
|
-
url += "&
|
33
|
+
url += "&qbase64=#{Base64.encode64(query)}" unless options[:post]
|
33
34
|
puts url if @options[:debug]
|
34
35
|
uri = URI.parse(url)
|
35
36
|
http = Net::HTTP.new(uri.host, uri.port)
|
@@ -47,6 +48,7 @@ module Fofa
|
|
47
48
|
resp = http.request(req)
|
48
49
|
JSON.parse(resp.body)
|
49
50
|
rescue => e
|
51
|
+
$stderr.puts "[WARNING]: #{e.to_s}"
|
50
52
|
{"error"=>"Error: #{e.to_s}"}
|
51
53
|
end
|
52
54
|
|
data/lib/fofa/version.rb
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 0.3.15
|
2
|
+
# fixed query encode bug of '&&'
|
3
|
+
#
|
4
|
+
# 0.3.14
|
5
|
+
# fixed bug of search_all yield when size reached
|
6
|
+
#
|
1
7
|
# 0.3.13
|
2
8
|
# search_all yield with all size
|
3
9
|
#
|
@@ -19,5 +25,5 @@
|
|
19
25
|
# 0.3.6
|
20
26
|
# add fields
|
21
27
|
module Fofa
|
22
|
-
VERSION = "0.3.
|
28
|
+
VERSION = "0.3.15"
|
23
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fofa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fofa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.6.
|
125
|
+
rubygems_version: 2.6.12
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: A Ruby library to interact with the FOFA API. https://fofa.so
|