mihari 4.4.1 → 4.5.2
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 +6 -1
- data/lib/mihari/analyzers/shodan.rb +39 -5
- data/lib/mihari/commands/web.rb +1 -1
- data/lib/mihari/database.rb +22 -1
- data/lib/mihari/enrichers/ipinfo.rb +1 -1
- data/lib/mihari/enrichers/shodan.rb +36 -0
- data/lib/mihari/entities/artifact.rb +6 -0
- data/lib/mihari/entities/cpe.rb +9 -0
- data/lib/mihari/entities/port.rb +9 -0
- data/lib/mihari/errors.rb +10 -2
- data/lib/mihari/http.rb +7 -1
- data/lib/mihari/models/alert.rb +3 -1
- data/lib/mihari/models/artifact.rb +31 -1
- data/lib/mihari/models/cpe.rb +23 -0
- data/lib/mihari/models/port.rb +23 -0
- data/lib/mihari/models/reverse_dns.rb +4 -4
- data/lib/mihari/schemas/analyzer.rb +2 -2
- data/lib/mihari/schemas/emitter.rb +1 -1
- data/lib/mihari/structs/censys.rb +14 -1
- data/lib/mihari/structs/rule.rb +3 -0
- data/lib/mihari/structs/shodan.rb +27 -0
- data/lib/mihari/types.rb +2 -4
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/api.rb +0 -2
- data/lib/mihari/web/app.rb +7 -1
- data/lib/mihari/web/endpoints/artifacts.rb +3 -1
- data/lib/mihari/web/endpoints/rules.rb +2 -1
- data/lib/mihari/web/public/index.html +1 -1
- data/lib/mihari/web/public/redoc-static.html +319 -320
- data/lib/mihari/web/public/static/css/{app.de5845d8.css → app.2a5d3d21.css} +1 -1
- data/lib/mihari/web/public/static/css/{chunk-vendors.da2a7bfc.css → chunk-vendors.06251949.css} +2 -2
- data/lib/mihari/web/public/static/fonts/{fa-brands-400.f7223235.ttf → fa-brands-400.7fa789ab.ttf} +0 -0
- data/lib/mihari/web/public/static/fonts/fa-brands-400.859fc388.woff2 +0 -0
- data/lib/mihari/web/public/static/fonts/fa-regular-400.2ffd018f.woff2 +0 -0
- data/lib/mihari/web/public/static/fonts/{fa-regular-400.a7fde52b.ttf → fa-regular-400.da02cb7e.ttf} +0 -0
- data/lib/mihari/web/public/static/fonts/{fa-solid-900.5b03221c.ttf → fa-solid-900.3a463ec3.ttf} +0 -0
- data/lib/mihari/web/public/static/fonts/fa-solid-900.40ddefd7.woff2 +0 -0
- data/lib/mihari/web/public/static/fonts/{fa-v4compatibility.42932bea.ttf → fa-v4compatibility.924588dc.ttf} +0 -0
- data/lib/mihari/web/public/static/js/app-legacy.9d5c9c3d.js +2 -0
- data/lib/mihari/web/public/static/js/app-legacy.9d5c9c3d.js.map +1 -0
- data/lib/mihari/web/public/static/js/app.823b5af7.js +2 -0
- data/lib/mihari/web/public/static/js/app.823b5af7.js.map +1 -0
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.b110c129.js +25 -0
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.b110c129.js.map +1 -0
- data/lib/mihari/web/public/static/js/chunk-vendors.dde2116c.js +31 -0
- data/lib/mihari/web/public/static/js/chunk-vendors.dde2116c.js.map +1 -0
- data/lib/mihari.rb +5 -1
- data/mihari.gemspec +7 -9
- data/sig/lib/mihari/models/artifact.rbs +2 -0
- data/sig/lib/mihari/models/cpe.rbs +7 -0
- data/sig/lib/mihari/models/port.rbs +7 -0
- data/sig/lib/mihari/structs/censys.rbs +8 -0
- data/sig/lib/mihari/structs/shodan.rbs +2 -0
- metadata +40 -63
- data/lib/mihari/entities/command.rb +0 -14
- data/lib/mihari/web/endpoints/command.rb +0 -33
- data/lib/mihari/web/public/static/fonts/fa-brands-400.edf40f86.woff2 +0 -0
- data/lib/mihari/web/public/static/fonts/fa-regular-400.3665ebc7.woff2 +0 -0
- data/lib/mihari/web/public/static/fonts/fa-solid-900.0d2abd43.woff2 +0 -0
- data/lib/mihari/web/public/static/js/app-legacy.f550d6ae.js +0 -2
- data/lib/mihari/web/public/static/js/app-legacy.f550d6ae.js.map +0 -1
- data/lib/mihari/web/public/static/js/app.40749592.js +0 -2
- data/lib/mihari/web/public/static/js/app.40749592.js.map +0 -1
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.d6b76c57.js +0 -25
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.d6b76c57.js.map +0 -1
- data/lib/mihari/web/public/static/js/chunk-vendors.3bdbaffb.js +0 -31
- data/lib/mihari/web/public/static/js/chunk-vendors.3bdbaffb.js.map +0 -1
data/lib/mihari.rb
CHANGED
@@ -169,13 +169,16 @@ require "mihari/schemas/rule"
|
|
169
169
|
# Enrichers
|
170
170
|
require "mihari/enrichers/base"
|
171
171
|
require "mihari/enrichers/ipinfo"
|
172
|
+
require "mihari/enrichers/shodan"
|
172
173
|
|
173
174
|
# Models
|
174
175
|
require "mihari/models/alert"
|
175
176
|
require "mihari/models/artifact"
|
176
177
|
require "mihari/models/autonomous_system"
|
178
|
+
require "mihari/models/cpe"
|
177
179
|
require "mihari/models/dns"
|
178
180
|
require "mihari/models/geolocation"
|
181
|
+
require "mihari/models/port"
|
179
182
|
require "mihari/models/reverse_dns"
|
180
183
|
require "mihari/models/rule"
|
181
184
|
require "mihari/models/tag"
|
@@ -220,11 +223,12 @@ require "mihari/analyzers/rule"
|
|
220
223
|
require "mihari/entities/message"
|
221
224
|
|
222
225
|
require "mihari/entities/autonomous_system"
|
223
|
-
require "mihari/entities/command"
|
224
226
|
require "mihari/entities/config"
|
227
|
+
require "mihari/entities/cpe"
|
225
228
|
require "mihari/entities/dns"
|
226
229
|
require "mihari/entities/geolocation"
|
227
230
|
require "mihari/entities/ip_address"
|
231
|
+
require "mihari/entities/port"
|
228
232
|
require "mihari/entities/reverse_dns"
|
229
233
|
require "mihari/entities/source"
|
230
234
|
require "mihari/entities/tag"
|
data/mihari.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency "coveralls_reborn", "~> 0.24"
|
32
32
|
spec.add_development_dependency "fakefs", "~> 1.4"
|
33
33
|
spec.add_development_dependency "mysql2", "~> 0.5"
|
34
|
-
spec.add_development_dependency "overcommit", "~> 0.
|
34
|
+
spec.add_development_dependency "overcommit", "~> 0.59"
|
35
35
|
spec.add_development_dependency "pg", "~> 1.3"
|
36
36
|
spec.add_development_dependency "rack-test", "~> 1.1"
|
37
37
|
spec.add_development_dependency "rake", "~> 13.0"
|
@@ -39,13 +39,13 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_development_dependency "rerun", "~> 0.13"
|
40
40
|
spec.add_development_dependency "rspec", "~> 3.11"
|
41
41
|
spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
|
42
|
-
spec.add_development_dependency "standard", "~> 1.
|
43
|
-
spec.add_development_dependency "steep", "~> 0.
|
42
|
+
spec.add_development_dependency "standard", "~> 1.11"
|
43
|
+
spec.add_development_dependency "steep", "~> 0.52"
|
44
44
|
spec.add_development_dependency "timecop", "~> 0.9"
|
45
45
|
spec.add_development_dependency "vcr", "~> 6.1"
|
46
46
|
spec.add_development_dependency "webmock", "~> 3.14"
|
47
47
|
|
48
|
-
spec.add_dependency "activerecord", "7.0.2.
|
48
|
+
spec.add_dependency "activerecord", "7.0.2.4"
|
49
49
|
spec.add_dependency "addressable", "2.8.0"
|
50
50
|
spec.add_dependency "awrence", "2.0.1"
|
51
51
|
spec.add_dependency "binaryedge", "0.1.0"
|
@@ -54,7 +54,7 @@ Gem::Specification.new do |spec|
|
|
54
54
|
spec.add_dependency "dnpedia", "0.1.0"
|
55
55
|
spec.add_dependency "dnstwister", "0.1.0"
|
56
56
|
spec.add_dependency "dotenv", "2.7.6"
|
57
|
-
spec.add_dependency "dry-configurable", "0.
|
57
|
+
spec.add_dependency "dry-configurable", "0.15.0"
|
58
58
|
spec.add_dependency "dry-container", "0.9.0"
|
59
59
|
spec.add_dependency "dry-files", "0.1.0"
|
60
60
|
spec.add_dependency "dry-initializer", "3.1.1"
|
@@ -81,22 +81,20 @@ Gem::Specification.new do |spec|
|
|
81
81
|
spec.add_dependency "passive_circl", "0.1.0"
|
82
82
|
spec.add_dependency "passivetotalx", "0.1.1"
|
83
83
|
spec.add_dependency "plissken", "2.0.1"
|
84
|
-
spec.add_dependency "public_suffix", "4.0.
|
84
|
+
spec.add_dependency "public_suffix", "4.0.7"
|
85
85
|
spec.add_dependency "pulsedive", "0.1.5"
|
86
86
|
spec.add_dependency "puma", "5.6.4"
|
87
87
|
spec.add_dependency "rack", "2.2.3"
|
88
88
|
spec.add_dependency "rack-contrib", "2.3.0"
|
89
89
|
spec.add_dependency "rack-cors", "1.1.1"
|
90
|
-
spec.add_dependency "safe_shell", "1.1.0"
|
91
90
|
spec.add_dependency "securitytrails", "1.0.0"
|
92
91
|
spec.add_dependency "semantic_logger", "4.10.0"
|
93
|
-
spec.add_dependency "sentry-ruby", "5.
|
92
|
+
spec.add_dependency "sentry-ruby", "5.3.0"
|
94
93
|
spec.add_dependency "shodanx", "0.2.1"
|
95
94
|
spec.add_dependency "slack-notifier", "2.4.0"
|
96
95
|
spec.add_dependency "spysex", "0.2.0"
|
97
96
|
spec.add_dependency "sqlite3", "1.4.2"
|
98
97
|
spec.add_dependency "thor", "1.2.1"
|
99
|
-
spec.add_dependency "thread_safe", "0.3.6"
|
100
98
|
spec.add_dependency "urlscan", "0.8.0"
|
101
99
|
spec.add_dependency "uuidtools", "2.2.0"
|
102
100
|
spec.add_dependency "virustotalx", "1.2.0"
|
@@ -14,6 +14,8 @@ module Mihari
|
|
14
14
|
attr_accessor whois_record(): Mihari::WhoisRecord
|
15
15
|
attr_accessor dns_records(): Array[Mihari::DnsRecord]
|
16
16
|
attr_accessor reverse_dns_names(): Array[Mihari::ReverseDnsName]
|
17
|
+
attr_accessor cpes(): Array[Mihari::CPE]
|
18
|
+
attr_accessor ports(): Array[Mihari::Port]
|
17
19
|
|
18
20
|
include ActiveModel::Validations
|
19
21
|
|
@@ -14,10 +14,18 @@ module Mihari
|
|
14
14
|
def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Location
|
15
15
|
end
|
16
16
|
|
17
|
+
class Service
|
18
|
+
attr_reader port: Integer
|
19
|
+
|
20
|
+
def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Service
|
21
|
+
end
|
22
|
+
|
17
23
|
class Hit
|
18
24
|
attr_reader ip: String
|
19
25
|
attr_reader location: Mihari::Structs::Censys::Location
|
20
26
|
attr_reader autonomous_system: Mihari::Structs::Censys::AutonomousSystem
|
27
|
+
attr_reader metadata: Hash[(String | Symbol), untyped]
|
28
|
+
attr_reader services: Array[Mihari::Structs::Censys::Service]
|
21
29
|
|
22
30
|
def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Hit
|
23
31
|
end
|
@@ -14,6 +14,8 @@ module Mihari
|
|
14
14
|
attr_reader location: Mihari::Structs::Shodan::Location
|
15
15
|
attr_reader domains: Array[String]
|
16
16
|
attr_reader ip_str: String
|
17
|
+
attr_reader port: Integer
|
18
|
+
|
17
19
|
def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Shodan::Match
|
18
20
|
end
|
19
21
|
|
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: 4.
|
4
|
+
version: 4.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
75
|
+
version: '0.59'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.59'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pg
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,28 +184,28 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: '1.
|
187
|
+
version: '1.11'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: '1.
|
194
|
+
version: '1.11'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: steep
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0.
|
201
|
+
version: '0.52'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0.
|
208
|
+
version: '0.52'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: timecop
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,14 +254,14 @@ dependencies:
|
|
254
254
|
requirements:
|
255
255
|
- - '='
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: 7.0.2.
|
257
|
+
version: 7.0.2.4
|
258
258
|
type: :runtime
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
262
|
- - '='
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: 7.0.2.
|
264
|
+
version: 7.0.2.4
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: addressable
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -380,14 +380,14 @@ dependencies:
|
|
380
380
|
requirements:
|
381
381
|
- - '='
|
382
382
|
- !ruby/object:Gem::Version
|
383
|
-
version: 0.
|
383
|
+
version: 0.15.0
|
384
384
|
type: :runtime
|
385
385
|
prerelease: false
|
386
386
|
version_requirements: !ruby/object:Gem::Requirement
|
387
387
|
requirements:
|
388
388
|
- - '='
|
389
389
|
- !ruby/object:Gem::Version
|
390
|
-
version: 0.
|
390
|
+
version: 0.15.0
|
391
391
|
- !ruby/object:Gem::Dependency
|
392
392
|
name: dry-container
|
393
393
|
requirement: !ruby/object:Gem::Requirement
|
@@ -758,14 +758,14 @@ dependencies:
|
|
758
758
|
requirements:
|
759
759
|
- - '='
|
760
760
|
- !ruby/object:Gem::Version
|
761
|
-
version: 4.0.
|
761
|
+
version: 4.0.7
|
762
762
|
type: :runtime
|
763
763
|
prerelease: false
|
764
764
|
version_requirements: !ruby/object:Gem::Requirement
|
765
765
|
requirements:
|
766
766
|
- - '='
|
767
767
|
- !ruby/object:Gem::Version
|
768
|
-
version: 4.0.
|
768
|
+
version: 4.0.7
|
769
769
|
- !ruby/object:Gem::Dependency
|
770
770
|
name: pulsedive
|
771
771
|
requirement: !ruby/object:Gem::Requirement
|
@@ -836,20 +836,6 @@ dependencies:
|
|
836
836
|
- - '='
|
837
837
|
- !ruby/object:Gem::Version
|
838
838
|
version: 1.1.1
|
839
|
-
- !ruby/object:Gem::Dependency
|
840
|
-
name: safe_shell
|
841
|
-
requirement: !ruby/object:Gem::Requirement
|
842
|
-
requirements:
|
843
|
-
- - '='
|
844
|
-
- !ruby/object:Gem::Version
|
845
|
-
version: 1.1.0
|
846
|
-
type: :runtime
|
847
|
-
prerelease: false
|
848
|
-
version_requirements: !ruby/object:Gem::Requirement
|
849
|
-
requirements:
|
850
|
-
- - '='
|
851
|
-
- !ruby/object:Gem::Version
|
852
|
-
version: 1.1.0
|
853
839
|
- !ruby/object:Gem::Dependency
|
854
840
|
name: securitytrails
|
855
841
|
requirement: !ruby/object:Gem::Requirement
|
@@ -884,14 +870,14 @@ dependencies:
|
|
884
870
|
requirements:
|
885
871
|
- - '='
|
886
872
|
- !ruby/object:Gem::Version
|
887
|
-
version: 5.
|
873
|
+
version: 5.3.0
|
888
874
|
type: :runtime
|
889
875
|
prerelease: false
|
890
876
|
version_requirements: !ruby/object:Gem::Requirement
|
891
877
|
requirements:
|
892
878
|
- - '='
|
893
879
|
- !ruby/object:Gem::Version
|
894
|
-
version: 5.
|
880
|
+
version: 5.3.0
|
895
881
|
- !ruby/object:Gem::Dependency
|
896
882
|
name: shodanx
|
897
883
|
requirement: !ruby/object:Gem::Requirement
|
@@ -962,20 +948,6 @@ dependencies:
|
|
962
948
|
- - '='
|
963
949
|
- !ruby/object:Gem::Version
|
964
950
|
version: 1.2.1
|
965
|
-
- !ruby/object:Gem::Dependency
|
966
|
-
name: thread_safe
|
967
|
-
requirement: !ruby/object:Gem::Requirement
|
968
|
-
requirements:
|
969
|
-
- - '='
|
970
|
-
- !ruby/object:Gem::Version
|
971
|
-
version: 0.3.6
|
972
|
-
type: :runtime
|
973
|
-
prerelease: false
|
974
|
-
version_requirements: !ruby/object:Gem::Requirement
|
975
|
-
requirements:
|
976
|
-
- - '='
|
977
|
-
- !ruby/object:Gem::Version
|
978
|
-
version: 0.3.6
|
979
951
|
- !ruby/object:Gem::Dependency
|
980
952
|
name: urlscan
|
981
953
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1139,15 +1111,17 @@ files:
|
|
1139
1111
|
- lib/mihari/emitters/webhook.rb
|
1140
1112
|
- lib/mihari/enrichers/base.rb
|
1141
1113
|
- lib/mihari/enrichers/ipinfo.rb
|
1114
|
+
- lib/mihari/enrichers/shodan.rb
|
1142
1115
|
- lib/mihari/entities/alert.rb
|
1143
1116
|
- lib/mihari/entities/artifact.rb
|
1144
1117
|
- lib/mihari/entities/autonomous_system.rb
|
1145
|
-
- lib/mihari/entities/command.rb
|
1146
1118
|
- lib/mihari/entities/config.rb
|
1119
|
+
- lib/mihari/entities/cpe.rb
|
1147
1120
|
- lib/mihari/entities/dns.rb
|
1148
1121
|
- lib/mihari/entities/geolocation.rb
|
1149
1122
|
- lib/mihari/entities/ip_address.rb
|
1150
1123
|
- lib/mihari/entities/message.rb
|
1124
|
+
- lib/mihari/entities/port.rb
|
1151
1125
|
- lib/mihari/entities/reverse_dns.rb
|
1152
1126
|
- lib/mihari/entities/rule.rb
|
1153
1127
|
- lib/mihari/entities/source.rb
|
@@ -1168,8 +1142,10 @@ files:
|
|
1168
1142
|
- lib/mihari/models/alert.rb
|
1169
1143
|
- lib/mihari/models/artifact.rb
|
1170
1144
|
- lib/mihari/models/autonomous_system.rb
|
1145
|
+
- lib/mihari/models/cpe.rb
|
1171
1146
|
- lib/mihari/models/dns.rb
|
1172
1147
|
- lib/mihari/models/geolocation.rb
|
1148
|
+
- lib/mihari/models/port.rb
|
1173
1149
|
- lib/mihari/models/reverse_dns.rb
|
1174
1150
|
- lib/mihari/models/rule.rb
|
1175
1151
|
- lib/mihari/models/tag.rb
|
@@ -1197,7 +1173,6 @@ files:
|
|
1197
1173
|
- lib/mihari/web/app.rb
|
1198
1174
|
- lib/mihari/web/endpoints/alerts.rb
|
1199
1175
|
- lib/mihari/web/endpoints/artifacts.rb
|
1200
|
-
- lib/mihari/web/endpoints/command.rb
|
1201
1176
|
- lib/mihari/web/endpoints/configs.rb
|
1202
1177
|
- lib/mihari/web/endpoints/ip_addresses.rb
|
1203
1178
|
- lib/mihari/web/endpoints/rules.rb
|
@@ -1207,24 +1182,24 @@ files:
|
|
1207
1182
|
- lib/mihari/web/middleware/error_notification_adapter.rb
|
1208
1183
|
- lib/mihari/web/public/index.html
|
1209
1184
|
- lib/mihari/web/public/redoc-static.html
|
1210
|
-
- lib/mihari/web/public/static/css/app.
|
1211
|
-
- lib/mihari/web/public/static/css/chunk-vendors.
|
1185
|
+
- lib/mihari/web/public/static/css/app.2a5d3d21.css
|
1186
|
+
- lib/mihari/web/public/static/css/chunk-vendors.06251949.css
|
1212
1187
|
- lib/mihari/web/public/static/favicon.ico
|
1213
|
-
- lib/mihari/web/public/static/fonts/fa-brands-400.
|
1214
|
-
- lib/mihari/web/public/static/fonts/fa-brands-400.
|
1215
|
-
- lib/mihari/web/public/static/fonts/fa-regular-400.
|
1216
|
-
- lib/mihari/web/public/static/fonts/fa-regular-400.
|
1217
|
-
- lib/mihari/web/public/static/fonts/fa-solid-900.
|
1218
|
-
- lib/mihari/web/public/static/fonts/fa-solid-900.
|
1219
|
-
- lib/mihari/web/public/static/fonts/fa-v4compatibility.
|
1220
|
-
- lib/mihari/web/public/static/js/app-legacy.
|
1221
|
-
- lib/mihari/web/public/static/js/app-legacy.
|
1222
|
-
- lib/mihari/web/public/static/js/app.
|
1223
|
-
- lib/mihari/web/public/static/js/app.
|
1224
|
-
- lib/mihari/web/public/static/js/chunk-vendors-legacy.
|
1225
|
-
- lib/mihari/web/public/static/js/chunk-vendors-legacy.
|
1226
|
-
- lib/mihari/web/public/static/js/chunk-vendors.
|
1227
|
-
- lib/mihari/web/public/static/js/chunk-vendors.
|
1188
|
+
- lib/mihari/web/public/static/fonts/fa-brands-400.7fa789ab.ttf
|
1189
|
+
- lib/mihari/web/public/static/fonts/fa-brands-400.859fc388.woff2
|
1190
|
+
- lib/mihari/web/public/static/fonts/fa-regular-400.2ffd018f.woff2
|
1191
|
+
- lib/mihari/web/public/static/fonts/fa-regular-400.da02cb7e.ttf
|
1192
|
+
- lib/mihari/web/public/static/fonts/fa-solid-900.3a463ec3.ttf
|
1193
|
+
- lib/mihari/web/public/static/fonts/fa-solid-900.40ddefd7.woff2
|
1194
|
+
- lib/mihari/web/public/static/fonts/fa-v4compatibility.924588dc.ttf
|
1195
|
+
- lib/mihari/web/public/static/js/app-legacy.9d5c9c3d.js
|
1196
|
+
- lib/mihari/web/public/static/js/app-legacy.9d5c9c3d.js.map
|
1197
|
+
- lib/mihari/web/public/static/js/app.823b5af7.js
|
1198
|
+
- lib/mihari/web/public/static/js/app.823b5af7.js.map
|
1199
|
+
- lib/mihari/web/public/static/js/chunk-vendors-legacy.b110c129.js
|
1200
|
+
- lib/mihari/web/public/static/js/chunk-vendors-legacy.b110c129.js.map
|
1201
|
+
- lib/mihari/web/public/static/js/chunk-vendors.dde2116c.js
|
1202
|
+
- lib/mihari/web/public/static/js/chunk-vendors.dde2116c.js.map
|
1228
1203
|
- mihari.gemspec
|
1229
1204
|
- renovate.json
|
1230
1205
|
- sig/lib/mihari.rbs
|
@@ -1285,8 +1260,10 @@ files:
|
|
1285
1260
|
- sig/lib/mihari/models/alert.rbs
|
1286
1261
|
- sig/lib/mihari/models/artifact.rbs
|
1287
1262
|
- sig/lib/mihari/models/autonomous_system.rbs
|
1263
|
+
- sig/lib/mihari/models/cpe.rbs
|
1288
1264
|
- sig/lib/mihari/models/dns.rbs
|
1289
1265
|
- sig/lib/mihari/models/geolocation.rbs
|
1266
|
+
- sig/lib/mihari/models/port.rbs
|
1290
1267
|
- sig/lib/mihari/models/reverse_dns.rbs
|
1291
1268
|
- sig/lib/mihari/models/rule.rbs
|
1292
1269
|
- sig/lib/mihari/models/tag.rbs
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Mihari
|
4
|
-
module Entities
|
5
|
-
class CommandInput < Grape::Entity
|
6
|
-
expose :command, documentation: { type: String, required: true }
|
7
|
-
end
|
8
|
-
|
9
|
-
class CommandResult < Grape::Entity
|
10
|
-
expose :output, documentation: { type: String, required: true }
|
11
|
-
expose :success, documentation: { type: Grape::API::Boolean, required: true }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "safe_shell"
|
4
|
-
|
5
|
-
module Mihari
|
6
|
-
module Endpoints
|
7
|
-
class Command < Grape::API
|
8
|
-
namespace :command do
|
9
|
-
desc "Run a command", {
|
10
|
-
success: Entities::CommandResult,
|
11
|
-
failure: [{ code: 400, message: "Bad request", model: Entities::Message }],
|
12
|
-
summary: "Run a command"
|
13
|
-
}
|
14
|
-
params do
|
15
|
-
requires :command, type: String, documentation: { param_type: "body" }
|
16
|
-
end
|
17
|
-
post "/" do
|
18
|
-
command = params[:command]
|
19
|
-
if command.nil?
|
20
|
-
error!({ message: "command is required" }, 400)
|
21
|
-
end
|
22
|
-
|
23
|
-
command = command.split
|
24
|
-
|
25
|
-
output = SafeShell.execute("mihari", *command)
|
26
|
-
success = $?.success?
|
27
|
-
|
28
|
-
present({ output: output, success: success }, with: Entities::CommandResult)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
Binary file
|
Binary file
|
Binary file
|