fofa 0.3.7 → 0.3.8
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/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/bin/fofacli +26 -6
- data/lib/fofa.rb +2 -0
- data/lib/fofa/version.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51b78658d768160754f6f32ebd1eb38f9c9a1f90
|
4
|
+
data.tar.gz: 3b9634e71a8b0d1911e3febef7956ab384ccf6a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edc85325d980675819fb60ae281d4286eaf39576c787fb96a8fc5f43093a14a9c1f6c2a2caa788f60d9da45252f7f1653e972b552e0aa626cf78ebb83ac13dee
|
7
|
+
data.tar.gz: 06e0b7ab86fcaa6bd7608d5039cc983baeda3bc7075bbc804deefe3fcf28400d20185ae23160b343a56b453d04be5f6cc6256ab0ac2705b57f0ef47acdf4a6a4
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/bin/fofacli
CHANGED
@@ -8,12 +8,13 @@ require "colorize"
|
|
8
8
|
options = {
|
9
9
|
email: ENV['FOFA_EMAIL'],
|
10
10
|
apikey: ENV['FOFA_KEY'],
|
11
|
-
page:
|
11
|
+
page: nil,
|
12
12
|
verbose: false,
|
13
13
|
file: nil,
|
14
14
|
mode: :search,
|
15
15
|
split_size: 100,
|
16
|
-
|
16
|
+
size_per_page: 100,
|
17
|
+
limit: 1000,
|
17
18
|
fields: 'host'
|
18
19
|
}
|
19
20
|
|
@@ -45,10 +46,14 @@ ARGV.options do |opts|
|
|
45
46
|
|
46
47
|
opts.on('-s', '--limit=SIZE', Integer, "Limit size to fetch, default to #{options[:limit]}") do |val|
|
47
48
|
options[:limit] = val.to_i
|
48
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
opts.on('-s', '--limit=SIZE', Integer, "Limit size to fetch, default to #{options[:limit]}") do |val|
|
52
|
+
options[:limit] = val.to_i
|
53
|
+
end
|
49
54
|
|
50
|
-
opts.on(
|
51
|
-
options[:
|
55
|
+
opts.on(nil, '--size_per_page=SIZE', Integer, "API fetch size per page, default to #{options[:size_per_page]}") do |val|
|
56
|
+
options[:size_per_page] = val.to_i
|
52
57
|
end
|
53
58
|
|
54
59
|
opts.on('-d', '--fields=FIELDS', String, "Fields to return, split with ',', default to #{options[:fields]}") do |val|
|
@@ -99,7 +104,22 @@ when :search
|
|
99
104
|
end
|
100
105
|
query = ARGV.join(' ')
|
101
106
|
puts "Query: '#{query}'"
|
102
|
-
|
107
|
+
if options[:page] #search one page
|
108
|
+
puts Fofa::API.new(options[:email], options[:apikey], {debug:options[:verbose]})
|
109
|
+
.search(query, {
|
110
|
+
page:options[:page],
|
111
|
+
size:options[:limit],
|
112
|
+
fields:options[:fields]
|
113
|
+
})
|
114
|
+
else
|
115
|
+
puts Fofa::API.new(options[:email], options[:apikey], {debug:options[:verbose]})
|
116
|
+
.search_all(query, {
|
117
|
+
size:options[:limit],
|
118
|
+
page_size:options[:size_per_page],
|
119
|
+
fields:options[:fields]
|
120
|
+
})
|
121
|
+
end
|
122
|
+
|
103
123
|
when :import_service
|
104
124
|
unless options[:file]
|
105
125
|
puts "File not specified.".red
|
data/lib/fofa.rb
CHANGED
data/lib/fofa/version.rb
CHANGED
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.8
|
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-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|