mihari 5.2.1 → 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/.rubocop.yml +2 -0
- data/lib/mihari/analyzers/base.rb +20 -115
- data/lib/mihari/analyzers/binaryedge.rb +0 -1
- data/lib/mihari/analyzers/censys.rb +26 -3
- data/lib/mihari/analyzers/circl.rb +1 -1
- data/lib/mihari/analyzers/onyphe.rb +1 -1
- data/lib/mihari/analyzers/passivetotal.rb +1 -1
- data/lib/mihari/analyzers/rule.rb +122 -75
- data/lib/mihari/analyzers/shodan.rb +1 -1
- data/lib/mihari/analyzers/urlscan.rb +6 -9
- data/lib/mihari/analyzers/virustotal_intelligence.rb +1 -6
- data/lib/mihari/cli/main.rb +2 -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 +88 -0
- 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/mixins/error_notification.rb +0 -2
- data/lib/mihari/models/artifact.rb +1 -1
- data/lib/mihari/schemas/rule.rb +2 -17
- data/lib/mihari/structs/censys.rb +226 -56
- data/lib/mihari/structs/config.rb +48 -18
- data/lib/mihari/structs/google_public_dns.rb +56 -14
- data/lib/mihari/structs/greynoise.rb +122 -29
- data/lib/mihari/structs/ipinfo.rb +40 -0
- data/lib/mihari/structs/onyphe.rb +112 -26
- data/lib/mihari/structs/rule.rb +4 -2
- data/lib/mihari/structs/shodan.rb +189 -47
- data/lib/mihari/structs/urlscan.rb +123 -20
- data/lib/mihari/structs/virustotal_intelligence.rb +129 -26
- data/lib/mihari/type_checker.rb +10 -8
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari.rb +1 -0
- data/mihari.gemspec +11 -10
- metadata +35 -36
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -43
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -15
- data/.github/workflows/test.yml +0 -90
- data/config/pre_commit.yml +0 -3
- data/docker/Dockerfile +0 -14
- data/examples/ipinfo_hosted_domains.rb +0 -45
- data/images/Tines-Full_Logo-Tines_Black.png +0 -0
- data/images/alert.png +0 -0
- data/images/logo.png +0 -0
- data/images/misp.png +0 -0
- data/images/overview.jpg +0 -0
- data/images/slack.png +0 -0
- data/images/tines.png +0 -0
- data/images/web_alerts.png +0 -0
- data/images/web_config.png +0 -0
- data/lib/mihari/commands/searcher.rb +0 -61
data/mihari.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
# Specify which files should be added to the gem when it is released.
|
27
27
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
28
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
29
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|images|docker|.github)/}) }
|
30
30
|
end
|
31
31
|
spec.bindir = "exe"
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -34,28 +34,29 @@ 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
|
-
spec.add_development_dependency "pg", "~> 1.
|
40
|
+
spec.add_development_dependency "pg", "~> 1.5"
|
41
41
|
spec.add_development_dependency "rack-test", "~> 2.1"
|
42
42
|
spec.add_development_dependency "rake", "~> 13.0"
|
43
43
|
spec.add_development_dependency "rb-fsevent", "~> 0.11"
|
44
44
|
spec.add_development_dependency "rerun", "~> 0.14"
|
45
45
|
spec.add_development_dependency "rspec", "~> 3.12"
|
46
46
|
spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
|
47
|
-
spec.add_development_dependency "standard", "~> 1.
|
47
|
+
spec.add_development_dependency "standard", "~> 1.28"
|
48
48
|
spec.add_development_dependency "timecop", "~> 0.9"
|
49
49
|
spec.add_development_dependency "vcr", "~> 6.1"
|
50
50
|
spec.add_development_dependency "webmock", "~> 3.18"
|
51
51
|
|
52
52
|
unless ci_env?
|
53
53
|
spec.add_development_dependency "overcommit", "~> 0.60"
|
54
|
-
spec.add_development_dependency "ruby-lsp", "~> 0.
|
55
|
-
spec.add_development_dependency "
|
54
|
+
spec.add_development_dependency "ruby-lsp", "~> 0.5"
|
55
|
+
spec.add_development_dependency "solargraph", "~> 0.49"
|
56
|
+
spec.add_development_dependency "steep", "~> 1.4"
|
56
57
|
end
|
57
58
|
|
58
|
-
spec.add_dependency "activerecord", "7.0.
|
59
|
+
spec.add_dependency "activerecord", "7.0.5"
|
59
60
|
spec.add_dependency "addressable", "2.8.4"
|
60
61
|
spec.add_dependency "awrence", "2.0.1"
|
61
62
|
spec.add_dependency "dotenv", "2.8.1"
|
@@ -69,7 +70,7 @@ Gem::Specification.new do |spec|
|
|
69
70
|
spec.add_dependency "email_address", "0.2.4"
|
70
71
|
spec.add_dependency "grape", "1.7.0"
|
71
72
|
spec.add_dependency "grape-entity", "1.0.0"
|
72
|
-
spec.add_dependency "grape-swagger", "1.6.
|
73
|
+
spec.add_dependency "grape-swagger", "1.6.1"
|
73
74
|
spec.add_dependency "grape-swagger-entity", "0.5.1"
|
74
75
|
spec.add_dependency "insensitive_hash", "0.3.3"
|
75
76
|
spec.add_dependency "jr-cli", "0.6.0"
|
@@ -87,8 +88,8 @@ Gem::Specification.new do |spec|
|
|
87
88
|
spec.add_dependency "semantic_logger", "4.13.0"
|
88
89
|
spec.add_dependency "sentry-ruby", "5.9.0"
|
89
90
|
spec.add_dependency "slack-notifier", "2.4.0"
|
90
|
-
spec.add_dependency "sqlite3", "1.6.
|
91
|
-
spec.add_dependency "thor", "1.2.
|
91
|
+
spec.add_dependency "sqlite3", "1.6.3"
|
92
|
+
spec.add_dependency "thor", "1.2.2"
|
92
93
|
spec.add_dependency "uuidtools", "2.2.0"
|
93
94
|
spec.add_dependency "whois", "5.1.0"
|
94
95
|
spec.add_dependency "whois-parser", "2.0.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-
|
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
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
89
|
+
version: '1.5'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
96
|
+
version: '1.5'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rack-test
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: '1.
|
187
|
+
version: '1.28'
|
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.28'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: timecop
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,42 +254,56 @@ dependencies:
|
|
254
254
|
requirements:
|
255
255
|
- - "~>"
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: '0.
|
257
|
+
version: '0.5'
|
258
258
|
type: :development
|
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: '0.
|
264
|
+
version: '0.5'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: solargraph
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '0.49'
|
272
|
+
type: :development
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - "~>"
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '0.49'
|
265
279
|
- !ruby/object:Gem::Dependency
|
266
280
|
name: steep
|
267
281
|
requirement: !ruby/object:Gem::Requirement
|
268
282
|
requirements:
|
269
283
|
- - "~>"
|
270
284
|
- !ruby/object:Gem::Version
|
271
|
-
version: '1.
|
285
|
+
version: '1.4'
|
272
286
|
type: :development
|
273
287
|
prerelease: false
|
274
288
|
version_requirements: !ruby/object:Gem::Requirement
|
275
289
|
requirements:
|
276
290
|
- - "~>"
|
277
291
|
- !ruby/object:Gem::Version
|
278
|
-
version: '1.
|
292
|
+
version: '1.4'
|
279
293
|
- !ruby/object:Gem::Dependency
|
280
294
|
name: activerecord
|
281
295
|
requirement: !ruby/object:Gem::Requirement
|
282
296
|
requirements:
|
283
297
|
- - '='
|
284
298
|
- !ruby/object:Gem::Version
|
285
|
-
version: 7.0.
|
299
|
+
version: 7.0.5
|
286
300
|
type: :runtime
|
287
301
|
prerelease: false
|
288
302
|
version_requirements: !ruby/object:Gem::Requirement
|
289
303
|
requirements:
|
290
304
|
- - '='
|
291
305
|
- !ruby/object:Gem::Version
|
292
|
-
version: 7.0.
|
306
|
+
version: 7.0.5
|
293
307
|
- !ruby/object:Gem::Dependency
|
294
308
|
name: addressable
|
295
309
|
requirement: !ruby/object:Gem::Requirement
|
@@ -478,14 +492,14 @@ dependencies:
|
|
478
492
|
requirements:
|
479
493
|
- - '='
|
480
494
|
- !ruby/object:Gem::Version
|
481
|
-
version: 1.6.
|
495
|
+
version: 1.6.1
|
482
496
|
type: :runtime
|
483
497
|
prerelease: false
|
484
498
|
version_requirements: !ruby/object:Gem::Requirement
|
485
499
|
requirements:
|
486
500
|
- - '='
|
487
501
|
- !ruby/object:Gem::Version
|
488
|
-
version: 1.6.
|
502
|
+
version: 1.6.1
|
489
503
|
- !ruby/object:Gem::Dependency
|
490
504
|
name: grape-swagger-entity
|
491
505
|
requirement: !ruby/object:Gem::Requirement
|
@@ -730,28 +744,28 @@ dependencies:
|
|
730
744
|
requirements:
|
731
745
|
- - '='
|
732
746
|
- !ruby/object:Gem::Version
|
733
|
-
version: 1.6.
|
747
|
+
version: 1.6.3
|
734
748
|
type: :runtime
|
735
749
|
prerelease: false
|
736
750
|
version_requirements: !ruby/object:Gem::Requirement
|
737
751
|
requirements:
|
738
752
|
- - '='
|
739
753
|
- !ruby/object:Gem::Version
|
740
|
-
version: 1.6.
|
754
|
+
version: 1.6.3
|
741
755
|
- !ruby/object:Gem::Dependency
|
742
756
|
name: thor
|
743
757
|
requirement: !ruby/object:Gem::Requirement
|
744
758
|
requirements:
|
745
759
|
- - '='
|
746
760
|
- !ruby/object:Gem::Version
|
747
|
-
version: 1.2.
|
761
|
+
version: 1.2.2
|
748
762
|
type: :runtime
|
749
763
|
prerelease: false
|
750
764
|
version_requirements: !ruby/object:Gem::Requirement
|
751
765
|
requirements:
|
752
766
|
- - '='
|
753
767
|
- !ruby/object:Gem::Version
|
754
|
-
version: 1.2.
|
768
|
+
version: 1.2.2
|
755
769
|
- !ruby/object:Gem::Dependency
|
756
770
|
name: uuidtools
|
757
771
|
requirement: !ruby/object:Gem::Requirement
|
@@ -802,9 +816,6 @@ executables:
|
|
802
816
|
extensions: []
|
803
817
|
extra_rdoc_files: []
|
804
818
|
files:
|
805
|
-
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
806
|
-
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
807
|
-
- ".github/workflows/test.yml"
|
808
819
|
- ".gitignore"
|
809
820
|
- ".gitmodules"
|
810
821
|
- ".overcommit.yml"
|
@@ -820,19 +831,7 @@ files:
|
|
820
831
|
- bin/setup
|
821
832
|
- build_frontend.sh
|
822
833
|
- config.ru
|
823
|
-
- config/pre_commit.yml
|
824
|
-
- docker/Dockerfile
|
825
|
-
- examples/ipinfo_hosted_domains.rb
|
826
834
|
- exe/mihari
|
827
|
-
- images/Tines-Full_Logo-Tines_Black.png
|
828
|
-
- images/alert.png
|
829
|
-
- images/logo.png
|
830
|
-
- images/misp.png
|
831
|
-
- images/overview.jpg
|
832
|
-
- images/slack.png
|
833
|
-
- images/tines.png
|
834
|
-
- images/web_alerts.png
|
835
|
-
- images/web_config.png
|
836
835
|
- lib/mihari.rb
|
837
836
|
- lib/mihari/analyzers/base.rb
|
838
837
|
- lib/mihari/analyzers/binaryedge.rb
|
@@ -877,7 +876,7 @@ files:
|
|
877
876
|
- lib/mihari/clients/zoomeye.rb
|
878
877
|
- lib/mihari/commands/database.rb
|
879
878
|
- lib/mihari/commands/rule.rb
|
880
|
-
- lib/mihari/commands/
|
879
|
+
- lib/mihari/commands/search.rb
|
881
880
|
- lib/mihari/commands/version.rb
|
882
881
|
- lib/mihari/commands/web.rb
|
883
882
|
- lib/mihari/constants.rb
|
@@ -1,43 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Bug report
|
3
|
-
about: Create a bug report to help us improve
|
4
|
-
title: "[BUG]"
|
5
|
-
labels: bug
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
<!--
|
11
|
-
Thank you for taking the time to report a bug.
|
12
|
-
Please make sure there is no existing issue about this kind of bug.
|
13
|
-
-->
|
14
|
-
|
15
|
-
### **Describe the bug**
|
16
|
-
|
17
|
-
A clear and concise description of what the bug is.
|
18
|
-
|
19
|
-
### **Steps to reproduce**
|
20
|
-
|
21
|
-
- ...
|
22
|
-
|
23
|
-
### **Expected behavior**
|
24
|
-
|
25
|
-
A clear and concise description of what you expected to happen.
|
26
|
-
|
27
|
-
### **Actual behavior**
|
28
|
-
|
29
|
-
A clear and concise description of what actually happened.
|
30
|
-
|
31
|
-
### **Screenshots**
|
32
|
-
|
33
|
-
Add screenshots to help explain your problem.
|
34
|
-
|
35
|
-
### **System Information:**
|
36
|
-
|
37
|
-
- OS: [e.g. Windows10]
|
38
|
-
- Ruby version: [e.g. 3.0]
|
39
|
-
- Mihari version: [e.g. 2.0.0]
|
40
|
-
|
41
|
-
### **Additional context**
|
42
|
-
|
43
|
-
Add any other context about the problem here.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Feature request
|
3
|
-
about: Suggest a new Feature for Mihari
|
4
|
-
title: "[Feature Request]"
|
5
|
-
labels: enhancement
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
<!--
|
10
|
-
|
11
|
-
1. Make sure your requested feature makes sense for Mihari.
|
12
|
-
|
13
|
-
2. If you want to suggest a new integration of a service, please provide detailed information of it. (e.g. API docs)
|
14
|
-
|
15
|
-
-->
|
data/.github/workflows/test.yml
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
name: Ruby CI
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [master]
|
6
|
-
pull_request:
|
7
|
-
branches: [master]
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
test:
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
|
13
|
-
services:
|
14
|
-
postgres:
|
15
|
-
image: postgres:12
|
16
|
-
env:
|
17
|
-
POSTGRES_USER: postgres
|
18
|
-
POSTGRES_PASSWORD: postgres
|
19
|
-
POSTGRES_DB: test
|
20
|
-
options: >-
|
21
|
-
--health-cmd pg_isready
|
22
|
-
--health-interval 10s
|
23
|
-
--health-timeout 5s
|
24
|
-
--health-retries 5
|
25
|
-
ports:
|
26
|
-
- 5432:5432
|
27
|
-
|
28
|
-
mysql:
|
29
|
-
image: mysql:8.0
|
30
|
-
env:
|
31
|
-
MYSQL_USER: mysql
|
32
|
-
MYSQL_PASSWORD: mysql
|
33
|
-
MYSQL_DATABASE: test
|
34
|
-
MYSQL_ROOT_PASSWORD: rootpassword
|
35
|
-
ports:
|
36
|
-
- 3306:3306
|
37
|
-
options: >-
|
38
|
-
--health-cmd="mysqladmin ping"
|
39
|
-
--health-interval=10s
|
40
|
-
--health-timeout=5s
|
41
|
-
--health-retries=3
|
42
|
-
|
43
|
-
strategy:
|
44
|
-
fail-fast: false
|
45
|
-
matrix:
|
46
|
-
ruby: [2.7, "3.0", 3.1, 3.2]
|
47
|
-
|
48
|
-
steps:
|
49
|
-
- uses: actions/checkout@v3
|
50
|
-
|
51
|
-
- name: Install dependencies
|
52
|
-
run: |
|
53
|
-
sudo apt-get -yqq install libpq-dev libmysqlclient-dev
|
54
|
-
|
55
|
-
- name: Set up Ruby
|
56
|
-
uses: ruby/setup-ruby@v1
|
57
|
-
with:
|
58
|
-
ruby-version: ${{ matrix.ruby }}
|
59
|
-
bundler: latest
|
60
|
-
bundler-cache: true
|
61
|
-
|
62
|
-
- name: Test with PostgreSQL
|
63
|
-
env:
|
64
|
-
DATABASE: postgresql://postgres:postgres@localhost:5432/test
|
65
|
-
run: |
|
66
|
-
bundle exec rake
|
67
|
-
|
68
|
-
- name: Test with MySQL
|
69
|
-
env:
|
70
|
-
DATABASE: mysql2://mysql:mysql@127.0.0.1:3306/test
|
71
|
-
run: |
|
72
|
-
bundle exec rake
|
73
|
-
|
74
|
-
- name: Coveralls Parallel
|
75
|
-
uses: coverallsapp/github-action@master
|
76
|
-
with:
|
77
|
-
github-token: ${{ secrets.github_token }}
|
78
|
-
flag-name: run-${{ matrix.ruby-version }}
|
79
|
-
parallel: true
|
80
|
-
|
81
|
-
coverage:
|
82
|
-
name: Coverage
|
83
|
-
needs: test
|
84
|
-
runs-on: ubuntu-latest
|
85
|
-
steps:
|
86
|
-
- name: Coveralls Finished
|
87
|
-
uses: coverallsapp/github-action@master
|
88
|
-
with:
|
89
|
-
github-token: ${{ secrets.github_token }}
|
90
|
-
parallel-finished: true
|
data/config/pre_commit.yml
DELETED
data/docker/Dockerfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
FROM ruby:3.1.3-alpine3.17
|
2
|
-
|
3
|
-
RUN apk --no-cache add git build-base ruby-dev sqlite-dev postgresql-dev mysql-client mysql-dev && \
|
4
|
-
gem install pg mysql2
|
5
|
-
|
6
|
-
ARG MIHARI_VERSION=5.1.0
|
7
|
-
|
8
|
-
RUN gem install mihari -v ${MIHARI_VERSION}
|
9
|
-
|
10
|
-
RUN apk del --purge git build-base ruby-dev
|
11
|
-
|
12
|
-
ENTRYPOINT ["mihari"]
|
13
|
-
|
14
|
-
CMD ["--help"]
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift("#{__dir__}/../lib")
|
4
|
-
|
5
|
-
require "json"
|
6
|
-
require "mihari"
|
7
|
-
require "open-uri"
|
8
|
-
|
9
|
-
module Mihari
|
10
|
-
module Analyzers
|
11
|
-
class HostedDomains < Base
|
12
|
-
attr_reader :ip
|
13
|
-
|
14
|
-
IPINFO_API_ENDPOINT = "https://ipinfo.io"
|
15
|
-
|
16
|
-
def initialize(ip, token: nil)
|
17
|
-
@ip = ip
|
18
|
-
@token = token
|
19
|
-
end
|
20
|
-
|
21
|
-
def title
|
22
|
-
"IPinfo hosted domains"
|
23
|
-
end
|
24
|
-
|
25
|
-
def description
|
26
|
-
"IP info hosted domains: #{ip}"
|
27
|
-
end
|
28
|
-
|
29
|
-
def token
|
30
|
-
ENV["IPINFO_TOKEN"] || @token
|
31
|
-
end
|
32
|
-
|
33
|
-
def artifacts
|
34
|
-
uri = URI("#{IPINFO_API_ENDPOINT}/domains/#{ip}?token=#{token}")
|
35
|
-
res = uri.read
|
36
|
-
json = JSON.parse(res)
|
37
|
-
json["domains"] || []
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
ip = "TARGET_IP"
|
44
|
-
analyzer = Mihari::Analyzers::HostedDomains.new(ip)
|
45
|
-
analyzer.run
|
Binary file
|
data/images/alert.png
DELETED
Binary file
|
data/images/logo.png
DELETED
Binary file
|
data/images/misp.png
DELETED
Binary file
|
data/images/overview.jpg
DELETED
Binary file
|
data/images/slack.png
DELETED
Binary file
|
data/images/tines.png
DELETED
Binary file
|
data/images/web_alerts.png
DELETED
Binary file
|
data/images/web_config.png
DELETED
Binary file
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Mihari
|
4
|
-
module Commands
|
5
|
-
module Searcher
|
6
|
-
include Mixins::ErrorNotification
|
7
|
-
|
8
|
-
def self.included(thor)
|
9
|
-
thor.class_eval do
|
10
|
-
desc "search [PATH]", "Search by a rule"
|
11
|
-
method_option :force_overwrite, type: :boolean, aliases: "-f", desc: "Force an overwrite the rule"
|
12
|
-
#
|
13
|
-
# Search by a rule
|
14
|
-
#
|
15
|
-
# @param [String] path_or_id
|
16
|
-
#
|
17
|
-
def search(path_or_id)
|
18
|
-
Mihari::Database.with_db_connection do
|
19
|
-
rule = Structs::Rule.from_path_or_id path_or_id
|
20
|
-
|
21
|
-
# validate
|
22
|
-
begin
|
23
|
-
rule.validate!
|
24
|
-
rescue RuleValidationError
|
25
|
-
return
|
26
|
-
end
|
27
|
-
|
28
|
-
force_overwrite = options["force_overwrite"] || false
|
29
|
-
|
30
|
-
begin
|
31
|
-
rule_model = Mihari::Rule.find(rule.id)
|
32
|
-
has_change = rule_model.data != rule.data.deep_stringify_keys
|
33
|
-
has_change_and_not_force_overwrite = has_change & !force_overwrite
|
34
|
-
|
35
|
-
if has_change_and_not_force_overwrite && !yes?("This operation will overwrite the rule in the database (Rule ID: #{rule.id}). Are you sure you want to update the rule? (y/n)")
|
36
|
-
return
|
37
|
-
end
|
38
|
-
|
39
|
-
# update the rule
|
40
|
-
rule.model.save
|
41
|
-
rescue ActiveRecord::RecordNotFound
|
42
|
-
# create a new rule
|
43
|
-
rule.model.save
|
44
|
-
end
|
45
|
-
|
46
|
-
with_error_notification do
|
47
|
-
alert = rule.analyzer.run
|
48
|
-
if alert
|
49
|
-
data = Mihari::Entities::Alert.represent(alert)
|
50
|
-
puts JSON.pretty_generate(data.as_json)
|
51
|
-
else
|
52
|
-
Mihari.logger.info "There is no new alert created in the database"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|