mihari 4.11.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/README.md +13 -3
- data/Steepfile +0 -1
- data/build_frontend.sh +0 -3
- data/docker/Dockerfile +11 -12
- data/images/Tines-Full_Logo-Tines_Black.png +0 -0
- data/lib/mihari/analyzers/base.rb +12 -28
- data/lib/mihari/analyzers/rule.rb +23 -36
- data/lib/mihari/cli/main.rb +6 -11
- data/lib/mihari/commands/initializer.rb +47 -0
- data/lib/mihari/commands/{search.rb → searcher.rb} +9 -20
- data/lib/mihari/commands/validator.rb +2 -2
- data/lib/mihari/commands/web.rb +4 -2
- data/lib/mihari/constants.rb +3 -3
- data/lib/mihari/database.rb +52 -87
- data/lib/mihari/emitters/database.rb +16 -7
- data/lib/mihari/emitters/misp.rb +13 -5
- data/lib/mihari/emitters/slack.rb +15 -8
- data/lib/mihari/emitters/the_hive.rb +42 -21
- data/lib/mihari/emitters/webhook.rb +99 -31
- data/lib/mihari/entities/alert.rb +7 -5
- data/lib/mihari/entities/artifact.rb +20 -8
- data/lib/mihari/entities/config.rb +2 -6
- data/lib/mihari/entities/rule.rb +8 -0
- data/lib/mihari/http.rb +13 -13
- data/lib/mihari/mixins/{disallowed_data_value.rb → falsepositive.rb} +8 -8
- data/lib/mihari/models/alert.rb +2 -15
- data/lib/mihari/models/artifact.rb +28 -17
- data/lib/mihari/models/rule.rb +7 -13
- data/lib/mihari/schemas/emitter.rb +6 -8
- data/lib/mihari/schemas/rule.rb +11 -13
- data/lib/mihari/structs/config.rb +41 -0
- data/lib/mihari/structs/filters.rb +2 -2
- data/lib/mihari/structs/rule.rb +96 -83
- data/lib/mihari/templates/rule.yml.erb +5 -23
- data/lib/mihari/types.rb +1 -1
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/api.rb +0 -2
- data/lib/mihari/web/app.rb +10 -4
- data/lib/mihari/web/endpoints/alerts.rb +11 -3
- data/lib/mihari/web/endpoints/configs.rb +1 -6
- data/lib/mihari/web/endpoints/rules.rb +27 -15
- data/lib/mihari/web/public/assets/{fa-brands-400.c7ae37d3.ttf → fa-brands-400-2ef6fdde.ttf} +0 -0
- data/lib/mihari/web/public/assets/fa-brands-400-f4617423.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-regular-400-12dea17b.ttf +0 -0
- data/lib/mihari/web/public/assets/fa-regular-400-7ba24c41.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-solid-900-67a880b4.ttf +0 -0
- data/lib/mihari/web/public/assets/fa-solid-900-e2c5cf54.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-v4compatibility-7c377405.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-v4compatibility-8d9500e8.ttf +0 -0
- data/lib/mihari/web/public/assets/{index.e1e67d84.css → index-625e95fe.css} +3 -3
- data/lib/mihari/web/public/assets/index-63900d73.js +50 -0
- data/lib/mihari/web/public/index.html +3 -3
- data/lib/mihari/web/public/redoc-static.html +26 -27
- data/lib/mihari.rb +11 -21
- data/mihari.gemspec +14 -14
- metadata +46 -131
- data/lib/mihari/cli/init.rb +0 -11
- data/lib/mihari/cli/validator.rb +0 -11
- data/lib/mihari/commands/init.rb +0 -51
- data/lib/mihari/emitters/http.rb +0 -127
- data/lib/mihari/entities/source.rb +0 -9
- data/lib/mihari/status.rb +0 -55
- data/lib/mihari/web/endpoints/sources.rb +0 -19
- data/lib/mihari/web/public/assets/fa-brands-400.3fe890d0.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-regular-400.fdc1f753.ttf +0 -0
- data/lib/mihari/web/public/assets/fa-regular-400.fe69d948.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-solid-900.6d53c706.ttf +0 -0
- data/lib/mihari/web/public/assets/fa-solid-900.d27bc752.woff2 +0 -0
- data/lib/mihari/web/public/assets/fa-v4compatibility.4d73f280.ttf +0 -0
- data/lib/mihari/web/public/assets/fa-v4compatibility.7d1c2ce5.woff2 +0 -0
- data/lib/mihari/web/public/assets/index.d3a61a69.js +0 -68
- data/sig/lib/mihari/analyzers/base.rbs +0 -90
- data/sig/lib/mihari/analyzers/binaryedge.rbs +0 -26
- data/sig/lib/mihari/analyzers/censys.rbs +0 -41
- data/sig/lib/mihari/analyzers/circl.rbs +0 -31
- data/sig/lib/mihari/analyzers/crtsh.rbs +0 -17
- data/sig/lib/mihari/analyzers/dnpedia.rbs +0 -15
- data/sig/lib/mihari/analyzers/dnstwister.rbs +0 -25
- data/sig/lib/mihari/analyzers/feed.rbs +0 -20
- data/sig/lib/mihari/analyzers/onyphe.rbs +0 -34
- data/sig/lib/mihari/analyzers/otx.rbs +0 -33
- data/sig/lib/mihari/analyzers/passivetotal.rbs +0 -35
- data/sig/lib/mihari/analyzers/pulsedive.rbs +0 -27
- data/sig/lib/mihari/analyzers/rule.rbs +0 -68
- data/sig/lib/mihari/analyzers/securitytrails.rbs +0 -33
- data/sig/lib/mihari/analyzers/shodan.rbs +0 -36
- data/sig/lib/mihari/analyzers/urlscan.rbs +0 -31
- data/sig/lib/mihari/analyzers/virustotal.rbs +0 -31
- data/sig/lib/mihari/analyzers/virustotal_intelligence.rbs +0 -33
- data/sig/lib/mihari/analyzers/zoomeye.rbs +0 -35
- data/sig/lib/mihari/cli/base.rbs +0 -9
- data/sig/lib/mihari/cli/init.rbs +0 -7
- data/sig/lib/mihari/cli/main.rbs +0 -9
- data/sig/lib/mihari/cli/validator.rbs +0 -7
- data/sig/lib/mihari/commands/init.rbs +0 -9
- data/sig/lib/mihari/commands/json.rbs +0 -7
- data/sig/lib/mihari/commands/search.rbs +0 -35
- data/sig/lib/mihari/commands/validator.rbs +0 -9
- data/sig/lib/mihari/commands/web.rbs +0 -7
- data/sig/lib/mihari/constants.rbs +0 -5
- data/sig/lib/mihari/database.rbs +0 -25
- data/sig/lib/mihari/emitters/base.rbs +0 -18
- data/sig/lib/mihari/emitters/database.rbs +0 -9
- data/sig/lib/mihari/emitters/http.rbs +0 -35
- data/sig/lib/mihari/emitters/misp.rbs +0 -34
- data/sig/lib/mihari/emitters/slack.rbs +0 -73
- data/sig/lib/mihari/emitters/stdout.rbs +0 -9
- data/sig/lib/mihari/emitters/the_hive.rbs +0 -32
- data/sig/lib/mihari/emitters/webhook.rbs +0 -20
- data/sig/lib/mihari/enrichers/base.rbs +0 -12
- data/sig/lib/mihari/enrichers/google_public_dns.rbs +0 -18
- data/sig/lib/mihari/enrichers/ipinfo.rbs +0 -16
- data/sig/lib/mihari/errors.rbs +0 -10
- data/sig/lib/mihari/feed/parser.rbs +0 -11
- data/sig/lib/mihari/feed/reader.rbs +0 -56
- data/sig/lib/mihari/http.rbs +0 -64
- data/sig/lib/mihari/mixins/autonomous_system.rbs +0 -14
- data/sig/lib/mihari/mixins/configurable.rbs +0 -30
- data/sig/lib/mihari/mixins/configuration.rbs +0 -45
- data/sig/lib/mihari/mixins/disallowed_data_value.rbs +0 -23
- data/sig/lib/mihari/mixins/error_notification.rbs +0 -12
- data/sig/lib/mihari/mixins/hash.rbs +0 -14
- data/sig/lib/mihari/mixins/refang.rbs +0 -14
- data/sig/lib/mihari/mixins/retriable.rbs +0 -15
- data/sig/lib/mihari/models/alert.rbs +0 -18
- data/sig/lib/mihari/models/artifact.rbs +0 -69
- data/sig/lib/mihari/models/autonomous_system.rbs +0 -14
- data/sig/lib/mihari/models/cpe.rbs +0 -7
- data/sig/lib/mihari/models/dns.rbs +0 -19
- data/sig/lib/mihari/models/geolocation.rbs +0 -15
- data/sig/lib/mihari/models/port.rbs +0 -7
- data/sig/lib/mihari/models/reverse_dns.rbs +0 -14
- data/sig/lib/mihari/models/rule.rbs +0 -17
- data/sig/lib/mihari/models/tag.rbs +0 -5
- data/sig/lib/mihari/models/tagging.rbs +0 -4
- data/sig/lib/mihari/models/whois.rbs +0 -66
- data/sig/lib/mihari/status.rbs +0 -25
- data/sig/lib/mihari/structs/censys.rbs +0 -58
- data/sig/lib/mihari/structs/filters.rbs +0 -40
- data/sig/lib/mihari/structs/google_public_dns.rbs +0 -21
- data/sig/lib/mihari/structs/greynoise.rbs +0 -30
- data/sig/lib/mihari/structs/ipinfo.rbs +0 -17
- data/sig/lib/mihari/structs/onyphe.rbs +0 -25
- data/sig/lib/mihari/structs/rule.rbs +0 -57
- data/sig/lib/mihari/structs/shodan.rbs +0 -30
- data/sig/lib/mihari/structs/urlscan.rbs +0 -28
- data/sig/lib/mihari/structs/virustotal_intelligence.rbs +0 -33
- data/sig/lib/mihari/type_checker.rbs +0 -48
- data/sig/lib/mihari/types.rbs +0 -23
- data/sig/lib/mihari/version.rbs +0 -3
- data/sig/lib/mihari/web/app.rbs +0 -5
- data/sig/lib/mihari.rbs +0 -54
@@ -1,90 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Base
|
4
|
-
# extend Dry::Initializer
|
5
|
-
|
6
|
-
include Mixins::AutonomousSystem
|
7
|
-
include Mixins::Configurable
|
8
|
-
include Mixins::Retriable
|
9
|
-
|
10
|
-
attr_accessor ignore_old_artifacts: bool
|
11
|
-
|
12
|
-
attr_accessor ignore_threshold: Integer
|
13
|
-
|
14
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
15
|
-
|
16
|
-
# @return [Array<String>, Array<Mihari::Artifact>]
|
17
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
18
|
-
|
19
|
-
# @return [String]
|
20
|
-
def title: () -> String
|
21
|
-
|
22
|
-
# @return [String]
|
23
|
-
def description: () -> String
|
24
|
-
|
25
|
-
# @return [String]
|
26
|
-
def source: () -> String
|
27
|
-
|
28
|
-
# @return [Array<String>]
|
29
|
-
def tags: () -> ::Array[String]
|
30
|
-
|
31
|
-
#
|
32
|
-
# Set artifacts & run emitters in parallel
|
33
|
-
#
|
34
|
-
# @return [nil]
|
35
|
-
#
|
36
|
-
def run: () -> void
|
37
|
-
|
38
|
-
#
|
39
|
-
# Run emitter
|
40
|
-
#
|
41
|
-
# @param [Mihari::Emitters::Base] emitter
|
42
|
-
#
|
43
|
-
# @return [nil]
|
44
|
-
#
|
45
|
-
def run_emitter: (untyped emitter) -> void
|
46
|
-
|
47
|
-
def self.inherited: (untyped child) -> untyped
|
48
|
-
|
49
|
-
#
|
50
|
-
# Normalize artifacts
|
51
|
-
# - Uniquefy artifacts by native #uniq
|
52
|
-
# - Convert data (string) into an artifact
|
53
|
-
# - Reject an invalid artifact
|
54
|
-
#
|
55
|
-
# @return [Array<Mihari::Artifact>]
|
56
|
-
#
|
57
|
-
def normalized_artifacts: () -> Array[Mihari::Artifact]
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
#
|
62
|
-
# Uniquefy artifacts
|
63
|
-
#
|
64
|
-
# @return [Array<Mihari::Artifact>]
|
65
|
-
#
|
66
|
-
def unique_artifacts: () -> Array[Mihari::Artifact]
|
67
|
-
|
68
|
-
#
|
69
|
-
# Enriched artifacts
|
70
|
-
#
|
71
|
-
# @return [Array<Mihari::Artifact>]
|
72
|
-
#
|
73
|
-
def enriched_artifacts: () -> Array[Mihari::Artifact]
|
74
|
-
|
75
|
-
#
|
76
|
-
# Set enriched artifacts
|
77
|
-
#
|
78
|
-
# @return [nil]
|
79
|
-
#
|
80
|
-
def set_enriched_artifacts: () -> void
|
81
|
-
|
82
|
-
#
|
83
|
-
# Select valid emitters
|
84
|
-
#
|
85
|
-
# @return [Array<Mihari::Emitters::Base>]
|
86
|
-
#
|
87
|
-
def valid_emitters: () -> Array[Mihari::Emitters::Base]
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class BinaryEdge < Base
|
4
|
-
|
5
|
-
attr_reader query: String
|
6
|
-
|
7
|
-
attr_reader interval: ::Integer
|
8
|
-
|
9
|
-
attr_reader api_key: String?
|
10
|
-
|
11
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
PAGE_SIZE: ::Integer
|
16
|
-
|
17
|
-
def search_with_page: (String query, ?page: ::Integer page) -> Hash[(String | Symbol), untyped]
|
18
|
-
|
19
|
-
def search: () -> Array[Hash[(String | Symbol), untyped]]
|
20
|
-
|
21
|
-
def configuration_keys: () -> ::Array["binaryedge_api_key"]
|
22
|
-
|
23
|
-
def api: () -> untyped
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Censys < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader interval: ::Integer
|
7
|
-
|
8
|
-
attr_reader id: String?
|
9
|
-
|
10
|
-
attr_reader secret: String?
|
11
|
-
|
12
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def search: () -> Array[String]
|
17
|
-
|
18
|
-
#
|
19
|
-
# Extract IPv4s from Censys search API response
|
20
|
-
#
|
21
|
-
# @param [Structs::Censys::Response] response
|
22
|
-
#
|
23
|
-
# @return [Array<String>]
|
24
|
-
#
|
25
|
-
def response_to_artifacts: (Mihari::Structs::Censys::Response response) -> Array[String]
|
26
|
-
|
27
|
-
#
|
28
|
-
# Build an artifact from a Shodan search API response
|
29
|
-
#
|
30
|
-
# @param [Structs::Censys::Hit] hit
|
31
|
-
#
|
32
|
-
# @return [Artifact]
|
33
|
-
#
|
34
|
-
def build_artifact: (Mihari::Structs::Censys::Hit hit) -> Mihari::Artifact
|
35
|
-
|
36
|
-
def configuration_keys: () -> ::Array["censys_id" | "censys_secret"]
|
37
|
-
|
38
|
-
def api: () -> untyped
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class CIRCL < Base
|
4
|
-
include Mixins::Refang
|
5
|
-
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader type: String?
|
9
|
-
|
10
|
-
attr_reader username: String?
|
11
|
-
|
12
|
-
attr_reader password: String?
|
13
|
-
|
14
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
15
|
-
|
16
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def configuration_keys: () -> ::Array["circl_passive_password" | "circl_passive_username"]
|
21
|
-
|
22
|
-
def api: () -> untyped
|
23
|
-
|
24
|
-
def search: () -> Array[String]
|
25
|
-
|
26
|
-
def passive_dns_search: () -> Array[String]
|
27
|
-
|
28
|
-
def passive_ssl_search: () -> Array[String]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Crtsh < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader exclude_expired: bool
|
7
|
-
|
8
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def api: () -> untyped
|
13
|
-
|
14
|
-
def search: () -> Array[Hash[(String | Symbol), untyped]]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class DNPedia < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
7
|
-
|
8
|
-
private
|
9
|
-
|
10
|
-
def api: () -> untyped
|
11
|
-
|
12
|
-
def search: () -> Array[Mihari::Artifact]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class DNSTwister < Base
|
4
|
-
include Mixins::Refang
|
5
|
-
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader type: String
|
9
|
-
|
10
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
11
|
-
|
12
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def valid_type?: () -> bool
|
17
|
-
|
18
|
-
def api: () -> untyped
|
19
|
-
|
20
|
-
def resolvable?: (String domain) -> bool
|
21
|
-
|
22
|
-
def search: () -> Array[String]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Feed < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader http_request_headers: Hash[(String | Symbol), untyped]
|
7
|
-
attr_reader http_request_method: String
|
8
|
-
attr_reader http_request_payload_type: String?
|
9
|
-
attr_reader http_request_payload: Hash[(String | Symbol), untyped]
|
10
|
-
|
11
|
-
attr_reader selector: String
|
12
|
-
|
13
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def data: () -> Array[Hash]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Onyphe < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader interval: ::Integer
|
7
|
-
|
8
|
-
attr_reader api_key: String?
|
9
|
-
|
10
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
PAGE_SIZE: ::Integer
|
15
|
-
|
16
|
-
def configuration_keys: () -> ::Array["onyphe_api_key"]
|
17
|
-
|
18
|
-
def api: () -> untyped
|
19
|
-
|
20
|
-
def search_with_page: (String query, ?page: ::Integer page) -> Mihari::Structs::Onyphe::Response
|
21
|
-
|
22
|
-
def search: () -> Array[Mihari::Structs::Onyphe::Response]
|
23
|
-
|
24
|
-
#
|
25
|
-
# Build an artifact from an Onyphe search API result
|
26
|
-
#
|
27
|
-
# @param [Structs::Onyphe::Result] result
|
28
|
-
#
|
29
|
-
# @return [Artifact]
|
30
|
-
#
|
31
|
-
def build_artifact: (Mihari::Structs::Onyphe::Result result) -> Mihari::Artifact
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class OTX < Base
|
4
|
-
include Mixins::Refang
|
5
|
-
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader type: String?
|
9
|
-
|
10
|
-
attr_reader api_key: String?
|
11
|
-
|
12
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
13
|
-
|
14
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def configuration_keys: () -> ::Array["otx_api_key"]
|
19
|
-
|
20
|
-
def domain_client: () -> untyped
|
21
|
-
|
22
|
-
def ip_client: () -> untyped
|
23
|
-
|
24
|
-
def valid_type?: () -> bool
|
25
|
-
|
26
|
-
def search: () -> Array[String]
|
27
|
-
|
28
|
-
def domain_search: () -> Array[String]
|
29
|
-
|
30
|
-
def ip_search: () -> Array[String]
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class PassiveTotal < Base
|
4
|
-
include Mixins::Refang
|
5
|
-
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader type: String?
|
9
|
-
|
10
|
-
attr_reader username: String?
|
11
|
-
|
12
|
-
attr_reader api_key: String?
|
13
|
-
|
14
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
15
|
-
|
16
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def configuration_keys: () -> ::Array["passivetotal_username" | "passivetotal_api_key"]
|
21
|
-
|
22
|
-
def api: () -> untyped
|
23
|
-
|
24
|
-
def valid_type?: () -> bool
|
25
|
-
|
26
|
-
def search: () -> Array[String]
|
27
|
-
|
28
|
-
def passive_dns_search: () -> Array[String]
|
29
|
-
|
30
|
-
def reverse_whois_search: () -> Array[Mihari::Artifact]
|
31
|
-
|
32
|
-
def ssl_search: () -> Array[Mihari::Artifact]
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Pulsedive < Base
|
4
|
-
include Mixins::Refang
|
5
|
-
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader type: String?
|
9
|
-
|
10
|
-
attr_reader api_key: String?
|
11
|
-
|
12
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
13
|
-
|
14
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def configuration_keys: () -> ::Array["pulsedive_api_key"]
|
19
|
-
|
20
|
-
def api: () -> untyped
|
21
|
-
|
22
|
-
def valid_type?: () -> bool
|
23
|
-
|
24
|
-
def search: () -> Array[Mihari::Artifact]
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
ANALYZER_TO_CLASS: Hash[String, singleton(Mihari::Analyzers::Base)]
|
4
|
-
|
5
|
-
class Rule < Base
|
6
|
-
include Mihari::Mixins::DisallowedDataValue
|
7
|
-
|
8
|
-
attr_reader title: String
|
9
|
-
attr_reader description: String
|
10
|
-
attr_reader queries: Hash[(String | Symbol), untyped]
|
11
|
-
attr_reader tags: Array[String]
|
12
|
-
attr_reader allowed_data_types: Array[String]
|
13
|
-
attr_reader disallowed_data_values: Array[String]
|
14
|
-
attr_reader source: String
|
15
|
-
attr_reader id: String?
|
16
|
-
|
17
|
-
def initialize: (**untyped kwargs) -> void
|
18
|
-
|
19
|
-
#
|
20
|
-
# Returns a list of artifacts matched with queries
|
21
|
-
#
|
22
|
-
# @return [Array<Mihari::Artifact>]
|
23
|
-
#
|
24
|
-
def artifacts: () -> (Array[Mihari::Artifact])
|
25
|
-
|
26
|
-
#
|
27
|
-
# Normalize artifacts
|
28
|
-
# - Uniquefy artifacts by #uniq(&:data)
|
29
|
-
# - Reject an invalid artifact (for just in case)
|
30
|
-
# - Select artifacts with allowed data types
|
31
|
-
# - Reject artifacts with disallowed data values
|
32
|
-
#
|
33
|
-
# @return [Array<Mihari::Artifact>]
|
34
|
-
#
|
35
|
-
def normalized_artifacts: () -> untyped
|
36
|
-
|
37
|
-
#
|
38
|
-
# Normalized disallowed data values
|
39
|
-
#
|
40
|
-
# @return [Array<Regexp, String>]
|
41
|
-
#
|
42
|
-
def normalized_disallowed_data_values: () -> untyped
|
43
|
-
|
44
|
-
#
|
45
|
-
# Check whether a value is a disallowed data value or not
|
46
|
-
#
|
47
|
-
# @return [Boolean]
|
48
|
-
#
|
49
|
-
def disallowed_data_value?: (untyped value) -> untyped
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
#
|
54
|
-
# Get analyzer class
|
55
|
-
#
|
56
|
-
# @param [String] analyzer_name
|
57
|
-
#
|
58
|
-
# @return [Class<Mihari::Analyzers::Base>] analyzer class
|
59
|
-
#
|
60
|
-
def get_analyzer_class: (untyped analyzer_name) -> untyped
|
61
|
-
|
62
|
-
#
|
63
|
-
# Validate configuration of analyzers
|
64
|
-
#
|
65
|
-
def validate_analyzer_configurations: () -> untyped
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class SecurityTrails < Base
|
4
|
-
include Mixins::Refang
|
5
|
-
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader type: String?
|
9
|
-
|
10
|
-
attr_reader api_key: String?
|
11
|
-
|
12
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
13
|
-
|
14
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def configuration_keys: () -> ::Array["securitytrails_api_key"]
|
19
|
-
|
20
|
-
def api: () -> untyped
|
21
|
-
|
22
|
-
def valid_type?: () -> bool
|
23
|
-
|
24
|
-
def search: () -> Array[String]
|
25
|
-
|
26
|
-
def domain_search: () -> Array[String]
|
27
|
-
|
28
|
-
def ip_search: () -> Array[Mihari::Artifact]
|
29
|
-
|
30
|
-
def mail_search: () -> Array[Mihari::Artifact]
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class Shodan < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader interval: ::Integer
|
7
|
-
|
8
|
-
attr_reader api_key: String?
|
9
|
-
|
10
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
PAGE_SIZE: ::Integer
|
15
|
-
|
16
|
-
def configuration_keys: () -> ::Array["shodan_api_key"]
|
17
|
-
|
18
|
-
def api: () -> untyped
|
19
|
-
|
20
|
-
def search_with_page: (String query, ?page: ::Integer page) -> Hash[(String | Symbol), untyped]
|
21
|
-
|
22
|
-
def search: () -> Array[Hash[(String | Symbol), untyped]]
|
23
|
-
|
24
|
-
def collect_metadata_by_ip: (Array[Mihari::Structs::Shodan::Match] matches, ip: String) -> Array[Hash[(String | Symbol), untyped]]
|
25
|
-
|
26
|
-
#
|
27
|
-
# Build an artifact from a Shodan search API response
|
28
|
-
#
|
29
|
-
# @param [Structs::Shodan::Match] match
|
30
|
-
#
|
31
|
-
# @return [Artifact]
|
32
|
-
#
|
33
|
-
def build_artifact: (Mihari::Structs::Shodan::Match match) -> Mihari::Artifact
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
SUPPORTED_DATA_TYPES: untyped
|
2
|
-
|
3
|
-
module Mihari
|
4
|
-
module Analyzers
|
5
|
-
class Urlscan < Base
|
6
|
-
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader allowed_data_types: Array[String]
|
9
|
-
|
10
|
-
attr_reader interval: ::Integer
|
11
|
-
|
12
|
-
attr_reader api_key: String?
|
13
|
-
|
14
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
15
|
-
|
16
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def configuration_keys: () -> ::Array["urlscan_api_key"]
|
21
|
-
|
22
|
-
def api: () -> untyped
|
23
|
-
|
24
|
-
def search_with_search_after: (search_after: String?) -> Array[Hash[(String | Symbol), untyped]]
|
25
|
-
|
26
|
-
def search: () -> Array[Mihari::Structs::Urlscan::Response]
|
27
|
-
|
28
|
-
def valid_alllowed_data_types?: () -> bool
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class VirusTotal < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader type: String?
|
7
|
-
|
8
|
-
attr_reader api_key: String?
|
9
|
-
|
10
|
-
include Mixins::Refang
|
11
|
-
|
12
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
13
|
-
|
14
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def configuration_keys: () -> ::Array["virustotal_api_key"]
|
19
|
-
|
20
|
-
def api: () -> untyped
|
21
|
-
|
22
|
-
def valid_type?: () -> bool
|
23
|
-
|
24
|
-
def search: () -> Array[Mihari::Artifact]
|
25
|
-
|
26
|
-
def domain_search: () -> Array[Mihari::Artifact]
|
27
|
-
|
28
|
-
def ip_search: () -> Array[Mihari::Artifact]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class VirusTotalIntelligence < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader interval: ::Integer
|
7
|
-
|
8
|
-
attr_reader api_key: String?
|
9
|
-
|
10
|
-
def initialize: (*untyped args, **untyped kwargs) -> void
|
11
|
-
|
12
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def configuration_keys: () -> ::Array["virustotal_api_key"]
|
17
|
-
|
18
|
-
#
|
19
|
-
# VT API
|
20
|
-
#
|
21
|
-
# @return [::VirusTotal::API]
|
22
|
-
#
|
23
|
-
def api: () -> untyped
|
24
|
-
|
25
|
-
#
|
26
|
-
# Search with cursor
|
27
|
-
#
|
28
|
-
# @return [Array<Mihari::Structs::VirusTotalIntelligence::Response>]
|
29
|
-
#
|
30
|
-
def search_witgh_cursor: () -> Array[Mihari::Structs::VirusTotalIntelligence::Response]
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Mihari
|
2
|
-
module Analyzers
|
3
|
-
class ZoomEye < Base
|
4
|
-
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader type: String?
|
7
|
-
|
8
|
-
attr_reader interval: ::Integer
|
9
|
-
|
10
|
-
attr_reader api_key: String?
|
11
|
-
|
12
|
-
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
PAGE_SIZE: ::Integer
|
17
|
-
|
18
|
-
def valid_type?: () -> bool
|
19
|
-
|
20
|
-
def configuration_keys: () -> ::Array["zoomeye_api_key"]
|
21
|
-
|
22
|
-
def api: () -> untyped
|
23
|
-
|
24
|
-
def convert_responses: (Array[Hash[(String | Symbol), untyped]] responses) -> Array[Mihari::Artifact]
|
25
|
-
|
26
|
-
def _host_search: (String query, ?page: ::Integer page) -> (Hash[(String | Symbol), untyped] | nil)
|
27
|
-
|
28
|
-
def host_search: () -> Array[String]
|
29
|
-
|
30
|
-
def _web_search: (String query, ?page: ::Integer page) -> (Hash[(String | Symbol), untyped] | nil)
|
31
|
-
|
32
|
-
def web_search: () -> Array[String]
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/sig/lib/mihari/cli/base.rbs
DELETED