mihari 3.10.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/docker/Dockerfile +1 -1
- data/lib/mihari/analyzers/base.rb +7 -7
- data/lib/mihari/analyzers/binaryedge.rb +8 -5
- data/lib/mihari/analyzers/censys.rb +6 -3
- data/lib/mihari/analyzers/circl.rb +0 -3
- data/lib/mihari/analyzers/crtsh.rb +7 -5
- data/lib/mihari/analyzers/dnpedia.rb +4 -4
- data/lib/mihari/analyzers/dnstwister.rb +1 -4
- data/lib/mihari/analyzers/feed.rb +36 -0
- data/lib/mihari/analyzers/greynoise.rb +1 -3
- data/lib/mihari/analyzers/onyphe.rb +6 -3
- data/lib/mihari/analyzers/otx.rb +0 -3
- data/lib/mihari/analyzers/passivetotal.rb +8 -9
- data/lib/mihari/analyzers/pulsedive.rb +7 -5
- data/lib/mihari/analyzers/rule.rb +11 -5
- data/lib/mihari/analyzers/securitytrails.rb +10 -7
- data/lib/mihari/analyzers/shodan.rb +15 -8
- data/lib/mihari/analyzers/spyse.rb +10 -11
- data/lib/mihari/analyzers/urlscan.rb +39 -16
- data/lib/mihari/analyzers/virustotal.rb +8 -9
- data/lib/mihari/analyzers/virustotal_intelligence.rb +9 -5
- data/lib/mihari/analyzers/zoomeye.rb +12 -5
- data/lib/mihari/cli/base.rb +0 -5
- data/lib/mihari/cli/init.rb +0 -2
- data/lib/mihari/cli/main.rb +4 -6
- data/lib/mihari/cli/mixins/utils.rb +2 -18
- data/lib/mihari/commands/init.rb +0 -18
- data/lib/mihari/commands/search.rb +20 -15
- data/lib/mihari/commands/validator.rb +7 -19
- data/lib/mihari/commands/web.rb +0 -3
- data/lib/mihari/database.rb +71 -19
- data/lib/mihari/emitters/misp.rb +0 -1
- data/lib/mihari/emitters/slack.rb +3 -4
- data/lib/mihari/emitters/stdout.rb +0 -2
- data/lib/mihari/emitters/the_hive.rb +0 -1
- data/lib/mihari/emitters/webhook.rb +1 -5
- data/lib/mihari/enrichers/ipinfo.rb +2 -2
- data/lib/mihari/errors.rb +6 -0
- data/lib/mihari/feed/parser.rb +34 -0
- data/lib/mihari/feed/reader.rb +127 -0
- data/lib/mihari/mixins/autonomous_system.rb +2 -0
- data/lib/mihari/mixins/database.rb +14 -0
- data/lib/mihari/mixins/disallowed_data_value.rb +2 -3
- data/lib/mihari/mixins/rule.rb +36 -31
- data/lib/mihari/models/alert.rb +7 -8
- data/lib/mihari/models/artifact.rb +1 -7
- data/lib/mihari/models/autonomous_system.rb +0 -2
- data/lib/mihari/models/dns.rb +2 -5
- data/lib/mihari/models/geolocation.rb +0 -1
- data/lib/mihari/models/reverse_dns.rb +0 -3
- data/lib/mihari/models/rule.rb +73 -0
- data/lib/mihari/models/tag.rb +0 -2
- data/lib/mihari/models/tagging.rb +0 -2
- data/lib/mihari/models/whois.rb +0 -2
- data/lib/mihari/notifiers/exception_notifier.rb +0 -2
- data/lib/mihari/schemas/analyzer.rb +0 -5
- data/lib/mihari/schemas/macros.rb +0 -2
- data/lib/mihari/schemas/rule.rb +21 -7
- data/lib/mihari/status.rb +2 -2
- data/lib/mihari/structs/alert.rb +2 -3
- data/lib/mihari/structs/censys.rb +4 -3
- data/lib/mihari/structs/greynoise.rb +4 -3
- data/lib/mihari/structs/ipinfo.rb +1 -2
- data/lib/mihari/structs/onyphe.rb +6 -5
- data/lib/mihari/structs/rule.rb +121 -0
- data/lib/mihari/structs/shodan.rb +8 -7
- data/lib/mihari/structs/urlscan.rb +50 -0
- data/lib/mihari/structs/virustotal_intelligence.rb +4 -3
- data/lib/mihari/type_checker.rb +2 -6
- data/lib/mihari/types.rb +8 -1
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/api.rb +6 -0
- data/lib/mihari/web/app.rb +5 -7
- data/lib/mihari/web/endpoints/alerts.rb +7 -3
- data/lib/mihari/web/endpoints/artifacts.rb +6 -3
- data/lib/mihari/web/endpoints/command.rb +2 -1
- data/lib/mihari/web/endpoints/configs.rb +2 -1
- data/lib/mihari/web/endpoints/ip_addresses.rb +2 -1
- data/lib/mihari/web/endpoints/rules.rb +140 -0
- data/lib/mihari/web/endpoints/sources.rb +2 -1
- data/lib/mihari/web/endpoints/tags.rb +4 -2
- data/lib/mihari/web/entities/artifact.rb +4 -2
- data/lib/mihari/web/entities/rule.rb +35 -0
- data/lib/mihari/web/entities/whois.rb +1 -1
- data/lib/mihari/web/middleware/connection_adapter.rb +19 -0
- data/lib/mihari/web/public/index.html +1 -1
- data/lib/mihari/web/public/redoc-static.html +196 -184
- data/lib/mihari/web/public/static/js/app.49ab738a.js +21 -0
- data/lib/mihari/web/public/static/js/app.49ab738a.js.map +1 -0
- data/lib/mihari/web/public/static/js/app.5dc97aae.js +21 -0
- data/lib/mihari/web/public/static/js/app.5dc97aae.js.map +1 -0
- data/lib/mihari/web/public/static/js/app.f2b8890f.js +21 -0
- data/lib/mihari/web/public/static/js/app.f2b8890f.js.map +1 -0
- data/lib/mihari/web/public/static/js/app.fbc19869.js +21 -0
- data/lib/mihari/web/public/static/js/app.fbc19869.js.map +1 -0
- data/lib/mihari.rb +42 -34
- data/mihari.gemspec +21 -23
- data/sig/lib/mihari/analyzers/binaryedge.rbs +2 -3
- data/sig/lib/mihari/analyzers/censys.rbs +2 -3
- data/sig/lib/mihari/analyzers/circl.rbs +1 -3
- data/sig/lib/mihari/analyzers/crtsh.rbs +1 -3
- data/sig/lib/mihari/analyzers/dnpedia.rbs +1 -4
- data/sig/lib/mihari/analyzers/dnstwister.rbs +1 -3
- data/sig/lib/mihari/analyzers/feed.rbs +20 -0
- data/sig/lib/mihari/analyzers/onyphe.rbs +2 -3
- data/sig/lib/mihari/analyzers/otx.rbs +1 -3
- data/sig/lib/mihari/analyzers/passivetotal.rbs +3 -5
- data/sig/lib/mihari/analyzers/pulsedive.rbs +2 -4
- data/sig/lib/mihari/analyzers/securitytrails.rbs +3 -5
- data/sig/lib/mihari/analyzers/shodan.rbs +2 -3
- data/sig/lib/mihari/analyzers/spyse.rbs +4 -6
- data/sig/lib/mihari/analyzers/urlscan.rbs +6 -5
- data/sig/lib/mihari/analyzers/virustotal.rbs +4 -6
- data/sig/lib/mihari/analyzers/virustotal_intelligence.rbs +2 -3
- data/sig/lib/mihari/analyzers/zoomeye.rbs +4 -4
- data/sig/lib/mihari/commands/init.rbs +0 -2
- data/sig/lib/mihari/commands/validator.rbs +0 -2
- data/sig/lib/mihari/emitters/slack.rbs +0 -1
- data/sig/lib/mihari/feed/parser.rbs +11 -0
- data/sig/lib/mihari/feed/reader.rbs +56 -0
- data/sig/lib/mihari/mixins/disallowed_data_value.rbs +0 -2
- data/sig/lib/mihari/mixins/rule.rbs +5 -12
- data/sig/lib/mihari/models/alert.rbs +1 -1
- data/sig/lib/mihari/models/artifact.rbs +2 -0
- data/sig/lib/mihari/models/rule.rbs +14 -0
- data/sig/lib/mihari/structs/alert.rbs +1 -1
- data/sig/lib/mihari/structs/greynoise.rbs +3 -3
- data/sig/lib/mihari/structs/rule.rbs +56 -0
- data/sig/lib/mihari/structs/shodan.rbs +2 -2
- data/sig/lib/mihari/structs/urlscan.rbs +28 -0
- data/sig/lib/mihari/types.rbs +4 -0
- data/sig/lib/mihari.rbs +0 -2
- metadata +102 -147
- data/lib/mihari/cli/analyzer.rb +0 -52
- data/lib/mihari/commands/binaryedge.rb +0 -21
- data/lib/mihari/commands/censys.rb +0 -22
- data/lib/mihari/commands/circl.rb +0 -21
- data/lib/mihari/commands/crtsh.rb +0 -22
- data/lib/mihari/commands/dnpedia.rb +0 -21
- data/lib/mihari/commands/dnstwister.rb +0 -21
- data/lib/mihari/commands/greynoise.rb +0 -21
- data/lib/mihari/commands/json.rb +0 -42
- data/lib/mihari/commands/onyphe.rb +0 -21
- data/lib/mihari/commands/otx.rb +0 -21
- data/lib/mihari/commands/passivetotal.rb +0 -22
- data/lib/mihari/commands/pulsedive.rb +0 -21
- data/lib/mihari/commands/securitytrails.rb +0 -22
- data/lib/mihari/commands/shodan.rb +0 -21
- data/lib/mihari/commands/spyse.rb +0 -22
- data/lib/mihari/commands/urlscan.rb +0 -23
- data/lib/mihari/commands/virustotal.rb +0 -22
- data/lib/mihari/commands/virustotal_intelligence.rb +0 -22
- data/lib/mihari/commands/zoomeye.rb +0 -22
- data/lib/mihari/mixins/configuration.rb +0 -100
- data/lib/mihari/mixins/hash.rb +0 -20
- data/lib/mihari/schemas/configuration.rb +0 -44
- data/lib/mihari/web/public/grape.rb +0 -73
- data/sig/lib/mihari/cli/analyzer.rbs +0 -39
- data/sig/lib/mihari/commands/binaryedge.rbs +0 -7
- data/sig/lib/mihari/commands/censys.rbs +0 -7
- data/sig/lib/mihari/commands/circl.rbs +0 -7
- data/sig/lib/mihari/commands/crtsh.rbs +0 -7
- data/sig/lib/mihari/commands/dnpedia.rbs +0 -7
- data/sig/lib/mihari/commands/dnstwister.rbs +0 -7
- data/sig/lib/mihari/commands/onyphe.rbs +0 -7
- data/sig/lib/mihari/commands/otx.rbs +0 -7
- data/sig/lib/mihari/commands/passivetotal.rbs +0 -7
- data/sig/lib/mihari/commands/pulsedive.rbs +0 -7
- data/sig/lib/mihari/commands/securitytrails.rbs +0 -7
- data/sig/lib/mihari/commands/shodan.rbs +0 -7
- data/sig/lib/mihari/commands/spyse.rbs +0 -7
- data/sig/lib/mihari/commands/urlscan.rbs +0 -7
- data/sig/lib/mihari/commands/virustotal.rbs +0 -7
- data/sig/lib/mihari/commands/zoomeye.rbs +0 -7
data/lib/mihari.rb
CHANGED
@@ -1,22 +1,52 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
4
|
-
|
3
|
+
require "active_support"
|
4
|
+
|
5
|
+
require "active_support/core_ext/hash"
|
6
|
+
require "active_support/core_ext/integer/time"
|
7
|
+
require "active_support/core_ext/numeric/time"
|
8
|
+
|
9
|
+
require "active_record"
|
10
|
+
|
11
|
+
# dry-rb
|
5
12
|
require "dry/configurable"
|
6
13
|
require "dry/files"
|
7
|
-
require "
|
14
|
+
require "dry/initializer"
|
15
|
+
require "dry/schema"
|
16
|
+
require "dry/struct"
|
17
|
+
require "dry/types"
|
18
|
+
require "dry/validation"
|
19
|
+
|
20
|
+
# standard & utility libs
|
21
|
+
require "addressable/uri"
|
22
|
+
require "awrence"
|
23
|
+
require "colorize"
|
24
|
+
require "email_address"
|
25
|
+
require "ipaddr"
|
26
|
+
require "json"
|
27
|
+
require "memist"
|
28
|
+
require "net/http"
|
29
|
+
require "net/https"
|
30
|
+
require "net/ping"
|
8
31
|
require "plissken"
|
32
|
+
require "public_suffix"
|
33
|
+
require "resolv"
|
34
|
+
require "uuidtools"
|
9
35
|
require "yaml"
|
36
|
+
require "parallel"
|
10
37
|
|
11
38
|
# Load .env
|
12
39
|
require "dotenv/load"
|
13
40
|
|
41
|
+
# Mihari
|
42
|
+
require "mihari/version"
|
43
|
+
require "mihari/errors"
|
44
|
+
|
14
45
|
# Mixins
|
15
46
|
require "mihari/mixins/autonomous_system"
|
16
47
|
require "mihari/mixins/configurable"
|
17
|
-
require "mihari/mixins/
|
48
|
+
require "mihari/mixins/database"
|
18
49
|
require "mihari/mixins/disallowed_data_value"
|
19
|
-
require "mihari/mixins/hash"
|
20
50
|
require "mihari/mixins/refang"
|
21
51
|
require "mihari/mixins/retriable"
|
22
52
|
require "mihari/mixins/rule"
|
@@ -30,7 +60,6 @@ end
|
|
30
60
|
|
31
61
|
module Mihari
|
32
62
|
extend Dry::Configurable
|
33
|
-
extend Mixins::Configuration
|
34
63
|
|
35
64
|
setting :binaryedge_api_key, default: ENV["BINARYEDGE_API_KEY"]
|
36
65
|
setting :censys_id, default: ENV["CENSYS_ID"]
|
@@ -61,7 +90,7 @@ module Mihari
|
|
61
90
|
setting :zoomeye_api_key, default: ENV["ZOOMEYE_API_KEY"]
|
62
91
|
|
63
92
|
class << self
|
64
|
-
include
|
93
|
+
include Memist::Memoizable
|
65
94
|
|
66
95
|
def emitters
|
67
96
|
[]
|
@@ -77,30 +106,9 @@ module Mihari
|
|
77
106
|
[]
|
78
107
|
end
|
79
108
|
memoize :enrichers
|
80
|
-
|
81
|
-
#
|
82
|
-
# Load configuration from YAML file
|
83
|
-
#
|
84
|
-
# @param [String] path Path to YAML file
|
85
|
-
#
|
86
|
-
# @return [nil]
|
87
|
-
#
|
88
|
-
def load_config_from_yaml(path)
|
89
|
-
config = load_config(path)
|
90
|
-
|
91
|
-
# validate loaded yaml data
|
92
|
-
validate_config config
|
93
|
-
|
94
|
-
config.each do |key, value|
|
95
|
-
Mihari.config.send("#{key.downcase}=".to_sym, value)
|
96
|
-
end
|
97
|
-
end
|
98
109
|
end
|
99
110
|
end
|
100
111
|
|
101
|
-
require "mihari/version"
|
102
|
-
require "mihari/errors"
|
103
|
-
|
104
112
|
require "mihari/database"
|
105
113
|
require "mihari/type_checker"
|
106
114
|
|
@@ -116,12 +124,15 @@ require "mihari/structs/censys"
|
|
116
124
|
require "mihari/structs/greynoise"
|
117
125
|
require "mihari/structs/ipinfo"
|
118
126
|
require "mihari/structs/onyphe"
|
127
|
+
require "mihari/structs/rule"
|
119
128
|
require "mihari/structs/shodan"
|
129
|
+
require "mihari/structs/urlscan"
|
120
130
|
require "mihari/structs/virustotal_intelligence"
|
121
131
|
|
122
132
|
# Schemas
|
133
|
+
require "mihari/schemas/macros"
|
134
|
+
|
123
135
|
require "mihari/schemas/analyzer"
|
124
|
-
require "mihari/schemas/configuration"
|
125
136
|
require "mihari/schemas/rule"
|
126
137
|
|
127
138
|
# Enrichers
|
@@ -135,6 +146,7 @@ require "mihari/models/autonomous_system"
|
|
135
146
|
require "mihari/models/dns"
|
136
147
|
require "mihari/models/geolocation"
|
137
148
|
require "mihari/models/reverse_dns"
|
149
|
+
require "mihari/models/rule"
|
138
150
|
require "mihari/models/tag"
|
139
151
|
require "mihari/models/tagging"
|
140
152
|
require "mihari/models/whois"
|
@@ -149,6 +161,7 @@ require "mihari/analyzers/circl"
|
|
149
161
|
require "mihari/analyzers/crtsh"
|
150
162
|
require "mihari/analyzers/dnpedia"
|
151
163
|
require "mihari/analyzers/dnstwister"
|
164
|
+
require "mihari/analyzers/feed"
|
152
165
|
require "mihari/analyzers/greynoise"
|
153
166
|
require "mihari/analyzers/onyphe"
|
154
167
|
require "mihari/analyzers/otx"
|
@@ -184,9 +197,4 @@ require "mihari/status"
|
|
184
197
|
require "mihari/web/app"
|
185
198
|
|
186
199
|
# CLIs
|
187
|
-
require "mihari/cli/base"
|
188
|
-
|
189
|
-
require "mihari/cli/analyzer"
|
190
|
-
require "mihari/cli/init"
|
191
|
-
|
192
200
|
require "mihari/cli/main"
|
data/mihari.gemspec
CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "~> 2.
|
28
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
29
29
|
spec.add_development_dependency "coveralls_reborn", "~> 0.23"
|
30
|
-
spec.add_development_dependency "fakefs", "~> 1.
|
30
|
+
spec.add_development_dependency "fakefs", "~> 1.4"
|
31
31
|
spec.add_development_dependency "mysql2", "~> 0.5"
|
32
32
|
spec.add_development_dependency "overcommit", "~> 0.58"
|
33
33
|
spec.add_development_dependency "pg", "~> 1.2"
|
@@ -36,40 +36,38 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency "rb-fsevent", "~> 0.11"
|
37
37
|
spec.add_development_dependency "rerun", "~> 0.13"
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.10"
|
39
|
-
spec.add_development_dependency "standard", "~> 1.
|
40
|
-
spec.add_development_dependency "steep", "~> 0.
|
39
|
+
spec.add_development_dependency "standard", "~> 1.5"
|
40
|
+
spec.add_development_dependency "steep", "~> 0.47"
|
41
41
|
spec.add_development_dependency "timecop", "~> 0.9"
|
42
42
|
spec.add_development_dependency "vcr", "~> 6.0"
|
43
43
|
spec.add_development_dependency "webmock", "~> 3.14"
|
44
44
|
|
45
|
-
spec.add_dependency "activerecord", "
|
46
|
-
spec.add_dependency "activerecord-filter", "~> 6.1"
|
45
|
+
spec.add_dependency "activerecord", "7.0.1"
|
47
46
|
spec.add_dependency "addressable", "~> 2.8"
|
48
47
|
spec.add_dependency "awrence", "~> 1.2"
|
49
48
|
spec.add_dependency "binaryedge", "~> 0.1"
|
50
49
|
spec.add_dependency "censysx", "~> 0.1"
|
51
50
|
spec.add_dependency "colorize", "~> 0.8"
|
52
51
|
spec.add_dependency "crtsh-rb", "~> 0.3"
|
53
|
-
spec.add_dependency "cymbal", "~> 2.0"
|
54
52
|
spec.add_dependency "dnpedia", "~> 0.1"
|
55
53
|
spec.add_dependency "dnstwister", "~> 0.1"
|
56
54
|
spec.add_dependency "dotenv", "~> 2.7"
|
57
|
-
spec.add_dependency "dry-configurable", "
|
58
|
-
spec.add_dependency "dry-container", "
|
59
|
-
spec.add_dependency "dry-files", "
|
60
|
-
spec.add_dependency "dry-initializer", "
|
61
|
-
spec.add_dependency "dry-struct", "
|
62
|
-
spec.add_dependency "dry-validation", "
|
55
|
+
spec.add_dependency "dry-configurable", "0.14.0"
|
56
|
+
spec.add_dependency "dry-container", "0.9.0"
|
57
|
+
spec.add_dependency "dry-files", "0.1.0"
|
58
|
+
spec.add_dependency "dry-initializer", "3.1.1"
|
59
|
+
spec.add_dependency "dry-struct", "1.4.0"
|
60
|
+
spec.add_dependency "dry-validation", "1.7.0"
|
63
61
|
spec.add_dependency "email_address", "~> 0.2"
|
64
|
-
spec.add_dependency "grape", "
|
65
|
-
spec.add_dependency "grape-entity", "
|
66
|
-
spec.add_dependency "grape-swagger", "
|
67
|
-
spec.add_dependency "grape-swagger-entity", "
|
62
|
+
spec.add_dependency "grape", "1.6.2"
|
63
|
+
spec.add_dependency "grape-entity", "0.10.1"
|
64
|
+
spec.add_dependency "grape-swagger", "1.4.2"
|
65
|
+
spec.add_dependency "grape-swagger-entity", "0.5.1"
|
68
66
|
spec.add_dependency "greynoise", "~> 0.1"
|
69
67
|
spec.add_dependency "hachi", "~> 1.0"
|
70
68
|
spec.add_dependency "http", "~> 5.0"
|
69
|
+
spec.add_dependency "jr-cli", "~> 0.5"
|
71
70
|
spec.add_dependency "launchy", "~> 2.5"
|
72
|
-
spec.add_dependency "mem", "~> 0.1"
|
73
71
|
spec.add_dependency "memist", "~> 2.0"
|
74
72
|
spec.add_dependency "misp", "~> 0.1"
|
75
73
|
spec.add_dependency "net-ping", "~> 2.0"
|
@@ -82,9 +80,9 @@ Gem::Specification.new do |spec|
|
|
82
80
|
spec.add_dependency "plissken", "~> 1.4"
|
83
81
|
spec.add_dependency "public_suffix", "~> 4.0"
|
84
82
|
spec.add_dependency "pulsedive", "~> 0.1"
|
85
|
-
spec.add_dependency "puma", "
|
86
|
-
spec.add_dependency "rack", "
|
87
|
-
spec.add_dependency "rack-contrib", "
|
83
|
+
spec.add_dependency "puma", "5.5.2"
|
84
|
+
spec.add_dependency "rack", "2.2.3"
|
85
|
+
spec.add_dependency "rack-contrib", "2.3.0"
|
88
86
|
spec.add_dependency "rack-cors", "~> 1.1"
|
89
87
|
spec.add_dependency "safe_shell", "~> 1.1"
|
90
88
|
spec.add_dependency "securitytrails", "~> 1.0"
|
@@ -92,9 +90,9 @@ Gem::Specification.new do |spec|
|
|
92
90
|
spec.add_dependency "slack-notifier", "~> 2.4"
|
93
91
|
spec.add_dependency "spysex", "~> 0.2"
|
94
92
|
spec.add_dependency "sqlite3", "~> 1.4"
|
95
|
-
spec.add_dependency "thor", "
|
93
|
+
spec.add_dependency "thor", "1.1.0"
|
96
94
|
spec.add_dependency "thread_safe", "~> 0.3"
|
97
|
-
spec.add_dependency "urlscan", "~> 0.
|
95
|
+
spec.add_dependency "urlscan", "~> 0.8"
|
98
96
|
spec.add_dependency "uuidtools", "~> 2.2"
|
99
97
|
spec.add_dependency "virustotalx", "~> 1.2"
|
100
98
|
spec.add_dependency "whois", "~> 5.0"
|
@@ -3,9 +3,8 @@ module Mihari
|
|
3
3
|
class BinaryEdge < Base
|
4
4
|
|
5
5
|
attr_reader query: String
|
6
|
-
|
7
|
-
attr_reader
|
8
|
-
attr_reader tags: Array[String]
|
6
|
+
|
7
|
+
attr_reader interval: ::Integer
|
9
8
|
|
10
9
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
11
10
|
|
@@ -2,9 +2,8 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class Censys < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
6
|
+
attr_reader interval: ::Integer
|
8
7
|
|
9
8
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
10
9
|
|
@@ -2,9 +2,7 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class Crtsh < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader description: String
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
8
6
|
attr_reader exclude_expired: bool
|
9
7
|
|
10
8
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
@@ -2,9 +2,6 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class DNPedia < Base
|
4
4
|
attr_reader query: String
|
5
|
-
attr_reader title: String
|
6
|
-
attr_reader description: String
|
7
|
-
attr_reader tags: Array[String]
|
8
5
|
|
9
6
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
10
7
|
|
@@ -12,7 +9,7 @@ module Mihari
|
|
12
9
|
|
13
10
|
def api: () -> untyped
|
14
11
|
|
15
|
-
def search: () -> Array[
|
12
|
+
def search: () -> Array[Mihari::Artifact]
|
16
13
|
end
|
17
14
|
end
|
18
15
|
end
|
@@ -0,0 +1,20 @@
|
|
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
|
@@ -2,9 +2,8 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class Onyphe < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
6
|
+
attr_reader interval: ::Integer
|
8
7
|
|
9
8
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
10
9
|
|
@@ -4,9 +4,7 @@ module Mihari
|
|
4
4
|
include Mixins::Refang
|
5
5
|
|
6
6
|
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader description: String
|
9
|
-
attr_reader tags: Array[String]
|
7
|
+
|
10
8
|
attr_reader type: String
|
11
9
|
|
12
10
|
def initialize: (*untyped args, **untyped kwargs) -> void
|
@@ -25,9 +23,9 @@ module Mihari
|
|
25
23
|
|
26
24
|
def passive_dns_search: () -> Array[String]
|
27
25
|
|
28
|
-
def reverse_whois_search: () -> Array[
|
26
|
+
def reverse_whois_search: () -> Array[Mihari::Artifact]
|
29
27
|
|
30
|
-
def ssl_search: () -> Array[
|
28
|
+
def ssl_search: () -> Array[Mihari::Artifact]
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
@@ -4,9 +4,7 @@ module Mihari
|
|
4
4
|
include Mixins::Refang
|
5
5
|
|
6
6
|
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader description: String
|
9
|
-
attr_reader tags: Array[String]
|
7
|
+
|
10
8
|
attr_reader type: String
|
11
9
|
|
12
10
|
def initialize: (*untyped args, **untyped kwargs) -> void
|
@@ -21,7 +19,7 @@ module Mihari
|
|
21
19
|
|
22
20
|
def valid_type?: () -> bool
|
23
21
|
|
24
|
-
def search: () -> Array[
|
22
|
+
def search: () -> Array[Mihari::Artifact]
|
25
23
|
end
|
26
24
|
end
|
27
25
|
end
|
@@ -4,9 +4,7 @@ module Mihari
|
|
4
4
|
include Mixins::Refang
|
5
5
|
|
6
6
|
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader description: String
|
9
|
-
attr_reader tags: Array[String]
|
7
|
+
|
10
8
|
attr_reader type: String
|
11
9
|
|
12
10
|
def initialize: (*untyped args, **untyped kwargs) -> void
|
@@ -25,9 +23,9 @@ module Mihari
|
|
25
23
|
|
26
24
|
def domain_search: () -> Array[String]
|
27
25
|
|
28
|
-
def ip_search: () -> Array[
|
26
|
+
def ip_search: () -> Array[Mihari::Artifact]
|
29
27
|
|
30
|
-
def mail_search: () -> Array[
|
28
|
+
def mail_search: () -> Array[Mihari::Artifact]
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
@@ -2,9 +2,8 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class Shodan < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
6
|
+
attr_reader interval: ::Integer
|
8
7
|
|
9
8
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
10
9
|
|
@@ -2,9 +2,7 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class Spyse < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader description: String
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
8
6
|
attr_reader type: String
|
9
7
|
|
10
8
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
@@ -19,11 +17,11 @@ module Mihari
|
|
19
17
|
|
20
18
|
def valid_type?: () -> bool
|
21
19
|
|
22
|
-
def domain_search: () -> Array[
|
20
|
+
def domain_search: () -> Array[Mihari::Artifact]
|
23
21
|
|
24
|
-
def ip_search: () -> Array[
|
22
|
+
def ip_search: () -> Array[Mihari::Artifact]
|
25
23
|
|
26
|
-
def search: () -> Array[
|
24
|
+
def search: () -> Array[Mihari::Artifact]
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
@@ -4,11 +4,10 @@ module Mihari
|
|
4
4
|
module Analyzers
|
5
5
|
class Urlscan < Base
|
6
6
|
attr_reader query: String
|
7
|
-
|
8
|
-
attr_reader description: String
|
9
|
-
attr_reader tags: Array[String]
|
7
|
+
|
10
8
|
attr_reader allowed_data_types: Array[String]
|
11
|
-
|
9
|
+
|
10
|
+
attr_reader interval: ::Integer
|
12
11
|
|
13
12
|
def initialize: (*untyped args, **untyped kwargs) -> void
|
14
13
|
|
@@ -20,7 +19,9 @@ module Mihari
|
|
20
19
|
|
21
20
|
def api: () -> untyped
|
22
21
|
|
23
|
-
def
|
22
|
+
def search_with_search_after: (search_after: String?) -> Array[Hash[(String | Symbol), untyped]]
|
23
|
+
|
24
|
+
def search: () -> Array[Mihari::Structs::Urlscan::Response]
|
24
25
|
|
25
26
|
def valid_alllowed_data_types?: () -> bool
|
26
27
|
end
|
@@ -2,9 +2,7 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class VirusTotal < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader description: String
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
8
6
|
attr_reader type: String
|
9
7
|
|
10
8
|
include Mixins::Refang
|
@@ -21,11 +19,11 @@ module Mihari
|
|
21
19
|
|
22
20
|
def valid_type?: () -> bool
|
23
21
|
|
24
|
-
def search: () -> Array[
|
22
|
+
def search: () -> Array[Mihari::Artifact]
|
25
23
|
|
26
|
-
def domain_search: () -> Array[
|
24
|
+
def domain_search: () -> Array[Mihari::Artifact]
|
27
25
|
|
28
|
-
def ip_search: () -> Array[
|
26
|
+
def ip_search: () -> Array[Mihari::Artifact]
|
29
27
|
end
|
30
28
|
end
|
31
29
|
end
|
@@ -2,9 +2,8 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class VirusTotalIntelligence < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
6
|
+
attr_reader interval: ::Integer
|
8
7
|
|
9
8
|
def initialize: (*untyped args, **untyped kwargs) -> void
|
10
9
|
|
@@ -2,11 +2,11 @@ module Mihari
|
|
2
2
|
module Analyzers
|
3
3
|
class ZoomEye < Base
|
4
4
|
attr_reader query: String
|
5
|
-
|
6
|
-
attr_reader description: String
|
7
|
-
attr_reader tags: Array[String]
|
5
|
+
|
8
6
|
attr_reader type: String
|
9
7
|
|
8
|
+
attr_reader interval: ::Integer
|
9
|
+
|
10
10
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
11
11
|
|
12
12
|
private
|
@@ -19,7 +19,7 @@ module Mihari
|
|
19
19
|
|
20
20
|
def api: () -> untyped
|
21
21
|
|
22
|
-
def convert_responses: (Array[Hash[(String | Symbol), untyped]] responses) -> Array[
|
22
|
+
def convert_responses: (Array[Hash[(String | Symbol), untyped]] responses) -> Array[Mihari::Artifact]
|
23
23
|
|
24
24
|
def _host_search: (String query, ?page: ::Integer page) -> (Hash[(String | Symbol), untyped] | nil)
|
25
25
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Mihari
|
2
|
+
class FeedReader
|
3
|
+
attr_reader uri: URI
|
4
|
+
|
5
|
+
attr_reader http_request_headers: Hash[(String | Symbol), untyped]
|
6
|
+
|
7
|
+
attr_reader http_request_method: String
|
8
|
+
|
9
|
+
attr_reader http_request_payload_type: String?
|
10
|
+
|
11
|
+
attr_reader http_request_payload: Hash[(String | Symbol), untyped]
|
12
|
+
|
13
|
+
def initialize: (
|
14
|
+
String uri,
|
15
|
+
?http_request_headers: Hash[(String | Symbol), untyped]] http_request_headers,
|
16
|
+
?http_request_method: ::String http_request_method,
|
17
|
+
?http_request_payload_type: String? http_request_payload_type,
|
18
|
+
?http_request_payload: Hash[(String | Symbol), untyped] http_request_payload
|
19
|
+
) -> void
|
20
|
+
|
21
|
+
def read: () -> Array[Hash]
|
22
|
+
|
23
|
+
def get: () -> Array[Hash]
|
24
|
+
|
25
|
+
def post: () -> Array[Hash]
|
26
|
+
|
27
|
+
#
|
28
|
+
# Convert text as JSON
|
29
|
+
#
|
30
|
+
# @param [String] text
|
31
|
+
#
|
32
|
+
# @return [Array<Hash>]
|
33
|
+
#
|
34
|
+
def convert_as_json: (String text) -> Array[Hash]
|
35
|
+
|
36
|
+
#
|
37
|
+
# Convert text as CSV
|
38
|
+
#
|
39
|
+
# @param [String] text
|
40
|
+
#
|
41
|
+
# @return [Array<Hash>]
|
42
|
+
#
|
43
|
+
def convert_as_csv: (String text) -> Array[Hash]
|
44
|
+
|
45
|
+
def https_options: () -> ({ use_ssl: ::TrueClass } | ::Hash[untyped, untyped])
|
46
|
+
|
47
|
+
#
|
48
|
+
# Make a HTTP request
|
49
|
+
#
|
50
|
+
# @param [Net::HTTPRequest] req
|
51
|
+
#
|
52
|
+
# @return [Array<Hash>]
|
53
|
+
#
|
54
|
+
def request: (Net::HTTPRequest req) -> Array[Hash]
|
55
|
+
end
|
56
|
+
end
|