mihari 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mihari/analyzers/censys.rb +3 -1
- data/lib/mihari/analyzers/onyphe.rb +3 -1
- data/lib/mihari/analyzers/shodan.rb +3 -1
- data/lib/mihari/cli.rb +9 -3
- data/lib/mihari/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: 7f889278f38a0195476bada5552aed27fc7b4525d18d09ea72d2c866cd88bce0
|
4
|
+
data.tar.gz: 0de84d6148ae7cfeb16cd624a87fb4a52c6ea1c1129f791a7bf65ac39b74ef84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ba40effb75947195ac0d52f5e7564977839f884c1e22fca155416a9f0a67d503c1aca8cbc5156cb620ebfa9c0ca53f06b454d0e3d03b929827c3569e23559a3
|
7
|
+
data.tar.gz: a5d99d000c47909f224696cf026091763ea064dc835596ae0f3f196bddd5c15513d98ce6dc8788ad0e6a3aa6516f7299058c6f725f228224564b4fb07645b586
|
@@ -9,11 +9,12 @@ module Mihari
|
|
9
9
|
attr_reader :title
|
10
10
|
attr_reader :description
|
11
11
|
attr_reader :query
|
12
|
+
attr_reader :tags
|
12
13
|
|
13
14
|
CENSYS_ID_KEY = "CENSYS_ID"
|
14
15
|
CENSYS_SECRET_KEY = "CENSYS_SECRET"
|
15
16
|
|
16
|
-
def initialize(query)
|
17
|
+
def initialize(query, tags: [])
|
17
18
|
super()
|
18
19
|
|
19
20
|
raise ArgumentError, "#{CENSYS_ID_KEY} and #{CENSYS_SECRET_KEY} are required" unless valid?
|
@@ -22,6 +23,7 @@ module Mihari
|
|
22
23
|
@query = query
|
23
24
|
@title = "Censys lookup"
|
24
25
|
@description = "Query: #{query}"
|
26
|
+
@tags = tags
|
25
27
|
end
|
26
28
|
|
27
29
|
def artifacts
|
@@ -9,14 +9,16 @@ module Mihari
|
|
9
9
|
attr_reader :title
|
10
10
|
attr_reader :description
|
11
11
|
attr_reader :query
|
12
|
+
attr_reader :tags
|
12
13
|
|
13
|
-
def initialize(query)
|
14
|
+
def initialize(query, tags: [])
|
14
15
|
super()
|
15
16
|
|
16
17
|
@api = ::Onyphe::API.new
|
17
18
|
@query = query
|
18
19
|
@title = "Onyphe lookup"
|
19
20
|
@description = "Query: #{query}"
|
21
|
+
@tags = tags
|
20
22
|
end
|
21
23
|
|
22
24
|
def artifacts
|
@@ -9,14 +9,16 @@ module Mihari
|
|
9
9
|
attr_reader :title
|
10
10
|
attr_reader :description
|
11
11
|
attr_reader :query
|
12
|
+
attr_reader :tags
|
12
13
|
|
13
|
-
def initialize(query)
|
14
|
+
def initialize(query, tags: [])
|
14
15
|
super()
|
15
16
|
|
16
17
|
@api = ::Shodan::API.new
|
17
18
|
@query = query
|
18
19
|
@title = "Shodan lookup"
|
19
20
|
@description = "Query: #{query}"
|
21
|
+
@tags = tags
|
20
22
|
end
|
21
23
|
|
22
24
|
def artifacts
|
data/lib/mihari/cli.rb
CHANGED
@@ -6,25 +6,31 @@ require "json"
|
|
6
6
|
module Mihari
|
7
7
|
class CLI < Thor
|
8
8
|
desc "censys [QUERY]", "Censys IPv4 lookup by a given query"
|
9
|
+
method_option :tags, type: :array, default: [], desc: "tags"
|
9
10
|
def censys(query)
|
11
|
+
tags = options.dig("tags") || []
|
10
12
|
with_error_handling do
|
11
|
-
censys = Analyzers::Censys.new(query)
|
13
|
+
censys = Analyzers::Censys.new(query, tags: tags)
|
12
14
|
censys.run
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
16
18
|
desc "shodan [QUERY]", "Shodan host lookup by a given query"
|
19
|
+
method_option :tags, type: :array, desc: "tags"
|
17
20
|
def shodan(query)
|
21
|
+
tags = options.dig("tags") || []
|
18
22
|
with_error_handling do
|
19
|
-
shodan = Analyzers::Shodan.new(query)
|
23
|
+
shodan = Analyzers::Shodan.new(query, tags: tags)
|
20
24
|
shodan.run
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
desc "onyphe [QUERY]", "Onyphe datascan lookup by a given query"
|
29
|
+
method_option :tags, type: :array, default: [], desc: "tags"
|
25
30
|
def onyphe(query)
|
31
|
+
tags = options.dig("tags") || []
|
26
32
|
with_error_handling do
|
27
|
-
onyphe = Analyzers::Onyphe.new(query)
|
33
|
+
onyphe = Analyzers::Onyphe.new(query, tags: tags)
|
28
34
|
onyphe.run
|
29
35
|
end
|
30
36
|
end
|
data/lib/mihari/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mihari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|