mihari 5.2.2 → 5.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/binaryedge.rb +0 -1
- data/lib/mihari/analyzers/censys.rb +7 -2
- data/lib/mihari/analyzers/circl.rb +1 -1
- data/lib/mihari/analyzers/passivetotal.rb +1 -1
- data/lib/mihari/analyzers/rule.rb +63 -72
- data/lib/mihari/analyzers/virustotal_intelligence.rb +1 -2
- data/lib/mihari/clients/base.rb +1 -1
- data/lib/mihari/commands/database.rb +12 -11
- data/lib/mihari/commands/rule.rb +47 -45
- data/lib/mihari/commands/search.rb +66 -47
- data/lib/mihari/commands/version.rb +8 -6
- data/lib/mihari/commands/web.rb +26 -23
- data/lib/mihari/emitters/base.rb +14 -1
- data/lib/mihari/emitters/database.rb +3 -10
- data/lib/mihari/emitters/misp.rb +16 -5
- data/lib/mihari/emitters/slack.rb +13 -15
- data/lib/mihari/emitters/the_hive.rb +17 -19
- data/lib/mihari/emitters/webhook.rb +23 -23
- data/lib/mihari/enrichers/whois.rb +1 -0
- data/lib/mihari/feed/parser.rb +1 -0
- data/lib/mihari/feed/reader.rb +29 -14
- data/lib/mihari/mixins/configurable.rb +13 -4
- data/lib/mihari/structs/censys.rb +96 -82
- data/lib/mihari/structs/config.rb +23 -21
- data/lib/mihari/structs/google_public_dns.rb +27 -23
- data/lib/mihari/structs/greynoise.rb +44 -38
- data/lib/mihari/structs/onyphe.rb +34 -30
- data/lib/mihari/structs/shodan.rb +77 -69
- data/lib/mihari/structs/urlscan.rb +42 -36
- data/lib/mihari/structs/virustotal_intelligence.rb +57 -49
- data/lib/mihari/type_checker.rb +10 -8
- data/lib/mihari/version.rb +1 -1
- data/mihari.gemspec +3 -3
- metadata +8 -8
@@ -13,16 +13,18 @@ module Mihari
|
|
13
13
|
attributes[:url]
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
class << self
|
17
|
+
#
|
18
|
+
# @param [Hash] d
|
19
|
+
#
|
20
|
+
# @return [ContextAttributes]
|
21
|
+
#
|
22
|
+
def from_dynamic!(d)
|
23
|
+
d = Types::Hash[d]
|
24
|
+
new(
|
25
|
+
url: d["url"]
|
26
|
+
)
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
@@ -83,25 +85,27 @@ module Mihari
|
|
83
85
|
Artifact.new(data: value, metadata: metadata)
|
84
86
|
end
|
85
87
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
88
|
+
class << self
|
89
|
+
#
|
90
|
+
# @param [Hash] d
|
91
|
+
#
|
92
|
+
# @return [Datum]
|
93
|
+
#
|
94
|
+
def from_dynamic!(d)
|
95
|
+
d = Types::Hash[d]
|
96
|
+
|
97
|
+
context_attributes = nil
|
98
|
+
if d.key?("context_attributes")
|
99
|
+
context_attributes = ContextAttributes.from_dynamic!(d.fetch("context_attributes"))
|
100
|
+
end
|
101
|
+
|
102
|
+
new(
|
103
|
+
type: d.fetch("type"),
|
104
|
+
id: d.fetch("id"),
|
105
|
+
context_attributes: context_attributes,
|
106
|
+
metadata: d
|
107
|
+
)
|
97
108
|
end
|
98
|
-
|
99
|
-
new(
|
100
|
-
type: d.fetch("type"),
|
101
|
-
id: d.fetch("id"),
|
102
|
-
context_attributes: context_attributes,
|
103
|
-
metadata: d
|
104
|
-
)
|
105
109
|
end
|
106
110
|
end
|
107
111
|
|
@@ -115,16 +119,18 @@ module Mihari
|
|
115
119
|
attributes[:cursor]
|
116
120
|
end
|
117
121
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
122
|
+
class << self
|
123
|
+
#
|
124
|
+
# @param [Hash] d
|
125
|
+
#
|
126
|
+
# @return [Meta]
|
127
|
+
#
|
128
|
+
def from_dynamic!(d)
|
129
|
+
d = Types::Hash[d]
|
130
|
+
new(
|
131
|
+
cursor: d["cursor"]
|
132
|
+
)
|
133
|
+
end
|
128
134
|
end
|
129
135
|
end
|
130
136
|
|
@@ -153,17 +159,19 @@ module Mihari
|
|
153
159
|
data.map(&:to_artifact)
|
154
160
|
end
|
155
161
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
162
|
+
class << self
|
163
|
+
#
|
164
|
+
# @param [Hash] d
|
165
|
+
#
|
166
|
+
# @return [Response]
|
167
|
+
#
|
168
|
+
def from_dynamic!(d)
|
169
|
+
d = Types::Hash[d]
|
170
|
+
new(
|
171
|
+
meta: Meta.from_dynamic!(d.fetch("meta")),
|
172
|
+
data: d.fetch("data").map { |x| Datum.from_dynamic!(x) }
|
173
|
+
)
|
174
|
+
end
|
167
175
|
end
|
168
176
|
end
|
169
177
|
end
|
data/lib/mihari/type_checker.rb
CHANGED
@@ -67,14 +67,16 @@ module Mihari
|
|
67
67
|
type
|
68
68
|
end
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
70
|
+
class << self
|
71
|
+
# @return [String, nil]
|
72
|
+
def type(data)
|
73
|
+
new(data).type
|
74
|
+
end
|
75
|
+
|
76
|
+
# @return [String, nil]
|
77
|
+
def detailed_type(data)
|
78
|
+
new(data).detailed_type
|
79
|
+
end
|
78
80
|
end
|
79
81
|
|
80
82
|
private
|
data/lib/mihari/version.rb
CHANGED
data/mihari.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
|
35
35
|
spec.add_development_dependency "bundler", "~> 2.4"
|
36
36
|
spec.add_development_dependency "coveralls_reborn", "~> 0.27"
|
37
|
-
spec.add_development_dependency "fakefs", "~> 2.
|
37
|
+
spec.add_development_dependency "fakefs", "~> 2.5"
|
38
38
|
spec.add_development_dependency "fuubar", "~> 2.5"
|
39
39
|
spec.add_development_dependency "mysql2", "~> 0.5"
|
40
40
|
spec.add_development_dependency "pg", "~> 1.5"
|
@@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
|
|
56
56
|
spec.add_development_dependency "steep", "~> 1.4"
|
57
57
|
end
|
58
58
|
|
59
|
-
spec.add_dependency "activerecord", "7.0.
|
59
|
+
spec.add_dependency "activerecord", "7.0.5"
|
60
60
|
spec.add_dependency "addressable", "2.8.4"
|
61
61
|
spec.add_dependency "awrence", "2.0.1"
|
62
62
|
spec.add_dependency "dotenv", "2.8.1"
|
@@ -70,7 +70,7 @@ Gem::Specification.new do |spec|
|
|
70
70
|
spec.add_dependency "email_address", "0.2.4"
|
71
71
|
spec.add_dependency "grape", "1.7.0"
|
72
72
|
spec.add_dependency "grape-entity", "1.0.0"
|
73
|
-
spec.add_dependency "grape-swagger", "1.6.
|
73
|
+
spec.add_dependency "grape-swagger", "1.6.1"
|
74
74
|
spec.add_dependency "grape-swagger-entity", "0.5.1"
|
75
75
|
spec.add_dependency "insensitive_hash", "0.3.3"
|
76
76
|
spec.add_dependency "jr-cli", "0.6.0"
|
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: 5.2.
|
4
|
+
version: 5.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: 2023-05-
|
11
|
+
date: 2023-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
47
|
+
version: '2.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2.
|
54
|
+
version: '2.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: fuubar
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,14 +296,14 @@ dependencies:
|
|
296
296
|
requirements:
|
297
297
|
- - '='
|
298
298
|
- !ruby/object:Gem::Version
|
299
|
-
version: 7.0.
|
299
|
+
version: 7.0.5
|
300
300
|
type: :runtime
|
301
301
|
prerelease: false
|
302
302
|
version_requirements: !ruby/object:Gem::Requirement
|
303
303
|
requirements:
|
304
304
|
- - '='
|
305
305
|
- !ruby/object:Gem::Version
|
306
|
-
version: 7.0.
|
306
|
+
version: 7.0.5
|
307
307
|
- !ruby/object:Gem::Dependency
|
308
308
|
name: addressable
|
309
309
|
requirement: !ruby/object:Gem::Requirement
|
@@ -492,14 +492,14 @@ dependencies:
|
|
492
492
|
requirements:
|
493
493
|
- - '='
|
494
494
|
- !ruby/object:Gem::Version
|
495
|
-
version: 1.6.
|
495
|
+
version: 1.6.1
|
496
496
|
type: :runtime
|
497
497
|
prerelease: false
|
498
498
|
version_requirements: !ruby/object:Gem::Requirement
|
499
499
|
requirements:
|
500
500
|
- - '='
|
501
501
|
- !ruby/object:Gem::Version
|
502
|
-
version: 1.6.
|
502
|
+
version: 1.6.1
|
503
503
|
- !ruby/object:Gem::Dependency
|
504
504
|
name: grape-swagger-entity
|
505
505
|
requirement: !ruby/object:Gem::Requirement
|