mihari 7.0.4 → 7.1.0
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/base.rb +9 -1
- data/lib/mihari/cli/application.rb +12 -9
- data/lib/mihari/clients/fofa.rb +4 -1
- data/lib/mihari/commands/alert.rb +37 -2
- data/lib/mihari/commands/artifact.rb +37 -2
- data/lib/mihari/commands/config.rb +1 -1
- data/lib/mihari/commands/rule.rb +37 -2
- data/lib/mihari/commands/tag.rb +37 -2
- data/lib/mihari/concerns/error_unwrappable.rb +3 -2
- data/lib/mihari/concerns/retriable.rb +24 -11
- data/lib/mihari/data_type.rb +3 -3
- data/lib/mihari/emitters/webhook.rb +15 -53
- data/lib/mihari/errors.rb +35 -9
- data/lib/mihari/http.rb +1 -6
- data/lib/mihari/rule.rb +16 -2
- data/lib/mihari/services/renderer.rb +31 -0
- data/lib/mihari/structs/fofa.rb +5 -0
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/endpoints/ip_addresses.rb +1 -1
- data/lib/mihari/web/public/assets/{index-yeHDhqt5.js → index-U5u7qHZZ.js} +47 -47
- data/lib/mihari/web/public/index.html +1 -1
- data/lib/mihari.rb +1 -0
- data/mihari.gemspec +5 -2
- data/test.json.jbuilder +7 -0
- metadata +51 -7
data/lib/mihari/structs/fofa.rb
CHANGED
@@ -8,6 +8,10 @@ module Mihari
|
|
8
8
|
# @return [Boolean]
|
9
9
|
attribute :error, Types::Bool
|
10
10
|
|
11
|
+
# @!attribute [r] errmsg
|
12
|
+
# @return [String, nil]
|
13
|
+
attribute? :errmsg, Types::String.optional
|
14
|
+
|
11
15
|
# @!attribute [r] size
|
12
16
|
# @return [Integer, nil]
|
13
17
|
attribute? :size, Types::Int.optional
|
@@ -35,6 +39,7 @@ module Mihari
|
|
35
39
|
def from_dynamic!(d)
|
36
40
|
new(
|
37
41
|
error: d.fetch("error"),
|
42
|
+
errmsg: d["errmsg"],
|
38
43
|
size: d["size"],
|
39
44
|
page: d["page"],
|
40
45
|
mode: d["mode"],
|
data/lib/mihari/version.rb
CHANGED
@@ -36,7 +36,7 @@ module Mihari
|
|
36
36
|
|
37
37
|
failure = result.failure
|
38
38
|
case failure
|
39
|
-
when Mihari::
|
39
|
+
when Mihari::StatusError
|
40
40
|
error!({ message: "IP:#{ip} not found" }, failure.status_code) if failure.status_code == 404
|
41
41
|
error!({ message: "IP format invalid" }, failure.status_code) if failure.status_code == 422
|
42
42
|
end
|