mihari 4.10.0 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/README.md +13 -3
  4. data/build_frontend.sh +0 -3
  5. data/docker/Dockerfile +11 -12
  6. data/images/Tines-Full_Logo-Tines_Black.png +0 -0
  7. data/lib/mihari/analyzers/circl.rb +1 -1
  8. data/lib/mihari/commands/web.rb +4 -2
  9. data/lib/mihari/emitters/slack.rb +2 -2
  10. data/lib/mihari/version.rb +1 -1
  11. data/lib/mihari/web/app.rb +10 -4
  12. data/lib/mihari/web/public/{static/fonts/fa-brands-400.f5defc2e.ttf → assets/fa-brands-400-b1d1c1b0.ttf} +0 -0
  13. data/lib/mihari/web/public/assets/fa-brands-400-c61287c2.woff2 +0 -0
  14. data/lib/mihari/web/public/assets/fa-regular-400-5da313b0.woff2 +0 -0
  15. data/lib/mihari/web/public/{static/fonts/fa-regular-400.3edb9004.ttf → assets/fa-regular-400-d7b19fe2.ttf} +0 -0
  16. data/lib/mihari/web/public/assets/fa-solid-900-8f06540f.woff2 +0 -0
  17. data/lib/mihari/web/public/assets/fa-solid-900-e4f6a7e9.ttf +0 -0
  18. data/lib/mihari/web/public/assets/fa-v4compatibility-2ddb3b41.ttf +0 -0
  19. data/lib/mihari/web/public/assets/fa-v4compatibility-f46715c9.woff2 +0 -0
  20. data/lib/mihari/web/public/assets/index-07aa1ba2.css +5 -0
  21. data/lib/mihari/web/public/assets/index-a7fe697b.js +63 -0
  22. data/lib/mihari/web/public/{static/favicon.ico → favicon.ico} +0 -0
  23. data/lib/mihari/web/public/index.html +23 -1
  24. data/lib/mihari/web/public/redoc-static.html +8 -8
  25. data/lib/mihari.rb +0 -2
  26. data/mihari.gemspec +21 -21
  27. metadata +57 -60
  28. data/lib/mihari/web/public/static/css/app.2a5d3d21.css +0 -1
  29. data/lib/mihari/web/public/static/css/chunk-vendors.380724be.css +0 -7
  30. data/lib/mihari/web/public/static/fonts/fa-brands-400.86c7e1fa.woff2 +0 -0
  31. data/lib/mihari/web/public/static/fonts/fa-regular-400.e0550912.woff2 +0 -0
  32. data/lib/mihari/web/public/static/fonts/fa-solid-900.64d5644d.woff2 +0 -0
  33. data/lib/mihari/web/public/static/fonts/fa-solid-900.f418d876.ttf +0 -0
  34. data/lib/mihari/web/public/static/fonts/fa-v4compatibility.7e7e1dad.ttf +0 -0
  35. data/lib/mihari/web/public/static/js/app.6413bf4f.js +0 -2
  36. data/lib/mihari/web/public/static/js/app.6413bf4f.js.map +0 -1
  37. data/lib/mihari/web/public/static/js/chunk-vendors.723e02cf.js +0 -31
  38. data/lib/mihari/web/public/static/js/chunk-vendors.723e02cf.js.map +0 -1
  39. data/sig/lib/mihari/analyzers/spyse.rbs +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54ef0421cb5da34c8174fe0fdc3b43d310770dca779dd51fac284a678b86fc0a
4
- data.tar.gz: 6b24c7b37c00f7ebed9ee0fcfbfb66b95d7d60ea7c7792a40be32607bdda07fe
3
+ metadata.gz: 16412e44a6aa5eb9fb7022aa531b950249df76f074136e71c6621e5f2d3c7d44
4
+ data.tar.gz: 403f780911934e891ef072c87a3a6ae48d31f1854c8806d4c9ece884faf9ec62
5
5
  SHA512:
6
- metadata.gz: 941a6e47d53a2287d793fe28fab3e6e9295076ed39e50fcf8f55e6cdca102381ae425b3db603acdfea9b28e438a7f57627ed793be1efcb0093d83b17ac128535
7
- data.tar.gz: 25055c04746f33620e0c762f1d79d6407d8a9156d47820c2129ed4b72e926e7cf2d3ea275ff546046bb5b9ce82fe069b222d56f5b69700eb44179f83d80c058c
6
+ metadata.gz: edde8ae3fb93a7e3719788c6727782f7f9a9e2ae53eaa9d804342e545e0ca5e9ec6bb96d633f9c26a33f98e4addaf8693b6da37de8930f8770847a531665baa0
7
+ data.tar.gz: afda1bef59be058cbb5972d771bf7615820cc4588cae6cc53c2f2d39333e02edce9a3165dee30caf0996195ab09565392316d116040ce5cc93dbdac28b04c239
@@ -43,7 +43,7 @@ jobs:
43
43
  strategy:
44
44
  fail-fast: false
45
45
  matrix:
46
- ruby: [2.7, "3.0", 3.1]
46
+ ruby: [2.7, "3.0", 3.1, 3.2]
47
47
 
48
48
  steps:
49
49
  - uses: actions/checkout@v3
data/README.md CHANGED
@@ -5,9 +5,19 @@
5
5
  [![Coverage Status](https://coveralls.io/repos/github/ninoseki/mihari/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/mihari?branch=master)
6
6
  [![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/mihari/badge)](https://www.codefactor.io/repository/github/ninoseki/mihari)
7
7
 
8
- ![img](https://github.com/ninoseki/mihari/raw/master/images/logo.png)
9
-
10
- [![](images/tines.png)](https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki)
8
+ ---
9
+
10
+ <p align="center">
11
+ <img src="https://github.com/ninoseki/mihari/raw/master/images/logo.png"/>
12
+ <br/>
13
+ <a href="https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki">
14
+ <img src="https://github.com/ninoseki/mihari/raw/master/images/Tines-Full_Logo-Tines_Black.png"/>
15
+ </a>
16
+ <br/>
17
+ Mihari is proudly supported by <a href="https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki">Tines</a>
18
+ </p>
19
+
20
+ ---
11
21
 
12
22
  Mihari is a tool for OSINT based threat hunting.
13
23
 
data/build_frontend.sh CHANGED
@@ -15,8 +15,5 @@ trash -r ${CURRENT_DIR}/lib/mihari/web/public/
15
15
  mkdir -p ${CURRENT_DIR}/lib/mihari/web/public/
16
16
  cp -r dist/* ${CURRENT_DIR}/lib/mihari/web/public
17
17
 
18
- # replace favicon path
19
- sed -i "" 's/href="\/favicon.ico"/href="\/static\/favicon.ico"/' ${CURRENT_DIR}/lib/mihari/web/public/index.html
20
-
21
18
  # remove tmp dir
22
19
  rm -rf ${CURRENT_DIR}/tmp/mihari-frontend
data/docker/Dockerfile CHANGED
@@ -1,15 +1,14 @@
1
- FROM ruby:3.0.3-alpine3.13
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
- && cd /tmp/ \
6
- && git clone https://github.com/ninoseki/mihari.git \
7
- && cd mihari \
8
- && gem build mihari.gemspec -o mihari.gem \
9
- && gem install mihari.gem \
10
- && rm -rf /tmp/mihari \
11
- && apk del --purge git build-base ruby-dev
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=4.11.0
7
+
8
+ RUN gem install mihari -v ${MIHARI_VERSION}
9
+
10
+ RUN apk del --purge git build-base ruby-dev
12
11
 
13
12
  ENTRYPOINT ["mihari"]
14
13
 
15
- CMD ["--help"]
14
+ CMD ["--help"]
@@ -71,7 +71,7 @@ module Mihari
71
71
  results = api.dns.query(@query)
72
72
  results.filter_map do |result|
73
73
  type = result["rrtype"]
74
- type == "A" ? result["rdata"] : nil
74
+ (type == "A") ? result["rdata"] : nil
75
75
  end.uniq
76
76
  end
77
77
 
@@ -8,18 +8,20 @@ module Mihari
8
8
  desc "web", "Launch the web app"
9
9
  method_option :port, type: :numeric, default: 9292, desc: "Hostname to listen on"
10
10
  method_option :host, type: :string, default: "localhost", desc: "Port to listen on"
11
- method_option :threads, type: :string, default: "1:1", desc: "min:max threads to use"
11
+ method_option :threads, type: :string, default: "0:5", desc: "min:max threads to use"
12
12
  method_option :verbose, type: :boolean, default: true, desc: "Report each request"
13
+ method_option :worker_timeout, type: :numeric, default: 60, desc: "Worker timeout value (in seconds)"
13
14
  def web
14
15
  port = options["port"]
15
16
  host = options["host"]
16
17
  threads = options["threads"]
17
18
  verbose = options["verbose"]
19
+ worker_timeout = options["worker_timeout"]
18
20
 
19
21
  # set rack env as production
20
22
  ENV["RACK_ENV"] ||= "production"
21
23
 
22
- Mihari::App.run!(port: port, host: host, threads: threads, verbose: verbose)
24
+ Mihari::App.run!(port: port, host: host, threads: threads, verbose: verbose, worker_timeout: worker_timeout)
23
25
  end
24
26
  end
25
27
  end
@@ -87,13 +87,13 @@ module Mihari
87
87
 
88
88
  # @return [String, nil]
89
89
  def _censys_link
90
- data_type == "ip" ? "https://search.censys.io/hosts/#{data}" : nil
90
+ (data_type == "ip") ? "https://search.censys.io/hosts/#{data}" : nil
91
91
  end
92
92
  memoize :_censys_link
93
93
 
94
94
  # @return [String, nil]
95
95
  def _shodan_link
96
- data_type == "ip" ? "https://www.shodan.io/host/#{data}" : nil
96
+ (data_type == "ip") ? "https://www.shodan.io/host/#{data}" : nil
97
97
  end
98
98
  memoize :_shodan_link
99
99
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "4.10.0"
4
+ VERSION = "4.12.0"
5
5
  end
@@ -31,7 +31,7 @@ module Mihari
31
31
  use Rack::Cors do
32
32
  allow do
33
33
  origins "*"
34
- resource "*", headers: :any, methods: [:get, :post, :put, :delete, :options]
34
+ resource "*", headers: :any, methods: %i[get post put delete options]
35
35
  end
36
36
  end
37
37
 
@@ -42,7 +42,7 @@ module Mihari
42
42
  end.to_app
43
43
  end
44
44
 
45
- def run!(port: 9292, host: "localhost", threads: "1:1", verbose: false)
45
+ def run!(port: 9292, host: "localhost", threads: "0:5", verbose: false, worker_timeout: 60)
46
46
  url = "http://#{host}:#{port}"
47
47
 
48
48
  # set maximum number of threads to use as PARALLEL_PROCESSOR_COUNT (if it is not set)
@@ -50,8 +50,14 @@ module Mihari
50
50
  # TODO: is this the best way?
51
51
  _min_thread, max_thread = threads.split(":")
52
52
  ENV["PARALLEL_PROCESSOR_COUNT"] = max_thread if ENV["PARALLEL_PROCESSOR_COUNT"].nil?
53
-
54
- Rack::Handler::Puma.run(instance, Port: port, Host: host, Threads: threads, Verbose: verbose) do |_launcher|
53
+ Rack::Handler::Puma.run(
54
+ instance,
55
+ Port: port,
56
+ Host: host,
57
+ Threads: threads,
58
+ Verbose: verbose,
59
+ worker_timeout: worker_timeout
60
+ ) do |_launcher|
55
61
  Launchy.open(url) if ENV["RACK_ENV"] != "development"
56
62
  rescue Launchy::CommandNotFoundError
57
63
  # ref. https://github.com/ninoseki/mihari/issues/477