miteru 2.4.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -5
- data/lib/miteru/commands/main.rb +0 -3
- data/lib/miteru/config.rb +2 -6
- data/lib/miteru/database.rb +1 -1
- data/lib/miteru/orchestrator.rb +0 -22
- data/lib/miteru/service.rb +0 -4
- data/lib/miteru/version.rb +1 -1
- data/lib/miteru.rb +0 -10
- data/miteru.gemspec +11 -10
- metadata +22 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a030ed3385f8c667ad95514cd0ca672c2682935afda529aa3ba97bec34da2f4
|
4
|
+
data.tar.gz: d3a79e73d68cf139bba9e1b692e990b87e1cde695756177c1d4c12e52b2a76db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c364bb3db19ea3ef41f14ab18b71ec6821e5bfb22e02050a0c11aca8d15abd908f2aa69f41809e22cb46d7b858936d09aa3e202a83269ad8afb6abebbe558c91
|
7
|
+
data.tar.gz: 9862e99d8ed38664c6b1b1ecd0456f517e189b646821b7338e5d71aa69fdb748da5e3be891bd1d5e9f3fcd69f06a515fd93ec92598def899e25cde064cfbfa16
|
data/.github/workflows/ruby.yml
CHANGED
@@ -35,7 +35,7 @@ jobs:
|
|
35
35
|
--health-retries=3
|
36
36
|
strategy:
|
37
37
|
matrix:
|
38
|
-
ruby: [3.
|
38
|
+
ruby: [3.2, 3.3]
|
39
39
|
steps:
|
40
40
|
- uses: actions/checkout@v4
|
41
41
|
- name: Set up Ruby
|
@@ -49,10 +49,8 @@ jobs:
|
|
49
49
|
- name: Test with PostgreSQL
|
50
50
|
env:
|
51
51
|
MITERU_DATABASE: postgresql://postgres:postgres@localhost:5432/test
|
52
|
-
run:
|
53
|
-
bundle exec rake
|
52
|
+
run: bundle exec rake
|
54
53
|
- name: Test with MySQL
|
55
54
|
env:
|
56
55
|
MITERU_DATABASE: mysql2://mysql:mysql@127.0.0.1:3306/test
|
57
|
-
run:
|
58
|
-
bundle exec rake
|
56
|
+
run: bundle exec rake
|
data/lib/miteru/commands/main.rb
CHANGED
@@ -13,7 +13,6 @@ module Miteru
|
|
13
13
|
method_option :directory_traveling, type: :boolean, default: false,
|
14
14
|
desc: "Enable or disable directory traveling"
|
15
15
|
method_option :download_to, type: :string, default: "/tmp", desc: "Directory to download phishing kits"
|
16
|
-
method_option :threads, type: :numeric, desc: "Number of threads to use", default: Parallel.processor_count
|
17
16
|
method_option :verbose, type: :boolean, default: true
|
18
17
|
desc "execute", "Execute the crawler"
|
19
18
|
around :with_db_connection
|
@@ -22,10 +21,8 @@ module Miteru
|
|
22
21
|
config.auto_download = options["auto_download"]
|
23
22
|
config.directory_traveling = options["directory_traveling"]
|
24
23
|
config.download_to = options["download_to"]
|
25
|
-
config.threads = options["threads"]
|
26
24
|
config.verbose = options["verbose"]
|
27
25
|
end
|
28
|
-
|
29
26
|
Orchestrator.call
|
30
27
|
end
|
31
28
|
default_command :execute
|
data/lib/miteru/config.rb
CHANGED
@@ -26,7 +26,7 @@ module Miteru
|
|
26
26
|
download_timeout: 60,
|
27
27
|
sentry_dsn: nil,
|
28
28
|
sentry_trace_sample_rate: 0.25,
|
29
|
-
sidekiq_redis_url:
|
29
|
+
sidekiq_redis_url: "redis://localhost:6379",
|
30
30
|
sidekiq_job_retry: 0,
|
31
31
|
sidekiq_batch_size: 50,
|
32
32
|
sidekiq_job_timeout: 600,
|
@@ -35,7 +35,6 @@ module Miteru
|
|
35
35
|
cache_prefix: "miteru:cache",
|
36
36
|
slack_channel: "#general",
|
37
37
|
slack_webhook_url: nil,
|
38
|
-
threads: Parallel.processor_count,
|
39
38
|
urlscan_api_key: nil,
|
40
39
|
urlscan_submit_visibility: "public",
|
41
40
|
urlscan_date_condition: "date:>now-1h",
|
@@ -50,7 +49,7 @@ module Miteru
|
|
50
49
|
# @return [Float]
|
51
50
|
|
52
51
|
# @!attribute [r] sidekiq_redis_url
|
53
|
-
# @return [String
|
52
|
+
# @return [String]
|
54
53
|
|
55
54
|
# @!attribute [r] sidekiq_job_retry
|
56
55
|
# @return [Integer]
|
@@ -88,9 +87,6 @@ module Miteru
|
|
88
87
|
# @!attribute [rw] download_to
|
89
88
|
# @return [String]
|
90
89
|
|
91
|
-
# @!attribute [rw] threads
|
92
|
-
# @return [Integer]
|
93
|
-
|
94
90
|
# @!attribute [r] cache_redis_url
|
95
91
|
# @return [String, nil]
|
96
92
|
|
data/lib/miteru/database.rb
CHANGED
data/lib/miteru/orchestrator.rb
CHANGED
@@ -4,32 +4,10 @@ module Miteru
|
|
4
4
|
class Orchestrator < Service
|
5
5
|
def call
|
6
6
|
logger.info("#{non_cached_websites.length} websites loaded in total.") if verbose?
|
7
|
-
|
8
|
-
if sidekiq?
|
9
|
-
sidekiq_call
|
10
|
-
else
|
11
|
-
parallel_call
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def sidekiq_call
|
16
7
|
array_of_args = non_cached_websites.map { |website| [website.url, website.source] }
|
17
8
|
Jobs::CrawleJob.perform_bulk(array_of_args, batch_size: Miteru.config.sidekiq_batch_size)
|
18
9
|
end
|
19
10
|
|
20
|
-
def parallel_call
|
21
|
-
logger.info("Use #{threads} thread(s).") if verbose?
|
22
|
-
Parallel.each(non_cached_websites, in_threads: threads) do |website|
|
23
|
-
logger.info("Website:#{website.truncated_url} crawling started.") if verbose?
|
24
|
-
result = Crawler.result(website)
|
25
|
-
if result.success?
|
26
|
-
logger.info("Crawler:#{website.truncated_url} succeeded.")
|
27
|
-
else
|
28
|
-
logger.info("Crawler:#{website.truncated_url} failed - #{result.failure}.")
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
11
|
#
|
34
12
|
# @return [Array<Miteru::Website>]
|
35
13
|
#
|
data/lib/miteru/service.rb
CHANGED
data/lib/miteru/version.rb
CHANGED
data/lib/miteru.rb
CHANGED
@@ -9,7 +9,6 @@ require "uuidtools"
|
|
9
9
|
# Core 3rd party libraries
|
10
10
|
require "colorize"
|
11
11
|
require "memo_wise"
|
12
|
-
require "parallel"
|
13
12
|
require "semantic_logger"
|
14
13
|
require "sentry-ruby"
|
15
14
|
|
@@ -55,8 +54,6 @@ module Miteru
|
|
55
54
|
# @return [SematicLogger]
|
56
55
|
#
|
57
56
|
def logger
|
58
|
-
SemanticLogger.sync! unless sidekiq?
|
59
|
-
|
60
57
|
SemanticLogger.default_level = :info
|
61
58
|
SemanticLogger.add_appender(io: $stderr, formatter: :color)
|
62
59
|
SemanticLogger["Miteru"]
|
@@ -108,13 +105,6 @@ module Miteru
|
|
108
105
|
@cache ||= Cache.new(Miteru.config.cache_redis_url)
|
109
106
|
end
|
110
107
|
|
111
|
-
#
|
112
|
-
# @return [Boolean]
|
113
|
-
#
|
114
|
-
def sidekiq?
|
115
|
-
!Miteru.config.sidekiq_redis_url.nil?
|
116
|
-
end
|
117
|
-
|
118
108
|
def sentry?
|
119
109
|
!Miteru.config.sentry_dsn.nil?
|
120
110
|
end
|
data/miteru.gemspec
CHANGED
@@ -16,6 +16,8 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.homepage = "https://github.com/ninoseki/miteru"
|
17
17
|
spec.license = "MIT"
|
18
18
|
|
19
|
+
spec.required_ruby_version = ">= 3.2"
|
20
|
+
|
19
21
|
# Specify which files should be added to the gem when it is released.
|
20
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
23
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
@@ -34,12 +36,12 @@ Gem::Specification.new do |spec|
|
|
34
36
|
spec.add_development_dependency "rake", "~> 13.2.1"
|
35
37
|
spec.add_development_dependency "rspec", "~> 3.13"
|
36
38
|
spec.add_development_dependency "simplecov-lcov", "~> 0.8"
|
37
|
-
spec.add_development_dependency "standard", "~> 1.
|
39
|
+
spec.add_development_dependency "standard", "~> 1.42.1"
|
38
40
|
spec.add_development_dependency "test-prof", "~> 1.4.2"
|
39
41
|
spec.add_development_dependency "vcr", "~> 6.3.1"
|
40
42
|
spec.add_development_dependency "webmock", "~> 3.24.0"
|
41
43
|
|
42
|
-
spec.add_dependency "activerecord", "
|
44
|
+
spec.add_dependency "activerecord", "8.0.0"
|
43
45
|
spec.add_dependency "addressable", "2.8.7"
|
44
46
|
spec.add_dependency "anyway_config", "2.6.4"
|
45
47
|
spec.add_dependency "colorize", "1.1.0"
|
@@ -48,20 +50,19 @@ Gem::Specification.new do |spec|
|
|
48
50
|
spec.add_dependency "dry-files", "1.1.0"
|
49
51
|
spec.add_dependency "dry-monads", "1.6.0"
|
50
52
|
spec.add_dependency "http", "5.2.0"
|
51
|
-
spec.add_dependency "memo_wise", "1.
|
53
|
+
spec.add_dependency "memo_wise", "1.10.0"
|
52
54
|
spec.add_dependency "oga", "3.4"
|
53
|
-
spec.add_dependency "
|
54
|
-
spec.add_dependency "puma", "6.4.3"
|
55
|
+
spec.add_dependency "puma", "6.5.0"
|
55
56
|
spec.add_dependency "rack", "3.1.8"
|
56
57
|
spec.add_dependency "rack-session", "2.0.0"
|
57
|
-
spec.add_dependency "rackup", "2.2.
|
58
|
+
spec.add_dependency "rackup", "2.2.1"
|
58
59
|
spec.add_dependency "redis", "5.3.0"
|
59
60
|
spec.add_dependency "semantic_logger", "4.16.1"
|
60
|
-
spec.add_dependency "sentry-ruby", "5.
|
61
|
-
spec.add_dependency "sentry-sidekiq", "5.
|
62
|
-
spec.add_dependency "sidekiq", "7.3.
|
61
|
+
spec.add_dependency "sentry-ruby", "5.22.0"
|
62
|
+
spec.add_dependency "sentry-sidekiq", "5.22.0"
|
63
|
+
spec.add_dependency "sidekiq", "7.3.6"
|
63
64
|
spec.add_dependency "slack-notifier", "2.4.0"
|
64
|
-
spec.add_dependency "sqlite3", "
|
65
|
+
spec.add_dependency "sqlite3", "2.4.1"
|
65
66
|
spec.add_dependency "thor", "1.3.2"
|
66
67
|
spec.add_dependency "thor-hollaback", "0.2.1"
|
67
68
|
spec.add_dependency "uuidtools", "2.2.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miteru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.42.1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.42.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: test-prof
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +198,14 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - '='
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 8.0.0
|
202
202
|
type: :runtime
|
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:
|
208
|
+
version: 8.0.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: addressable
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -324,14 +324,14 @@ dependencies:
|
|
324
324
|
requirements:
|
325
325
|
- - '='
|
326
326
|
- !ruby/object:Gem::Version
|
327
|
-
version: 1.
|
327
|
+
version: 1.10.0
|
328
328
|
type: :runtime
|
329
329
|
prerelease: false
|
330
330
|
version_requirements: !ruby/object:Gem::Requirement
|
331
331
|
requirements:
|
332
332
|
- - '='
|
333
333
|
- !ruby/object:Gem::Version
|
334
|
-
version: 1.
|
334
|
+
version: 1.10.0
|
335
335
|
- !ruby/object:Gem::Dependency
|
336
336
|
name: oga
|
337
337
|
requirement: !ruby/object:Gem::Requirement
|
@@ -346,34 +346,20 @@ dependencies:
|
|
346
346
|
- - '='
|
347
347
|
- !ruby/object:Gem::Version
|
348
348
|
version: '3.4'
|
349
|
-
- !ruby/object:Gem::Dependency
|
350
|
-
name: parallel
|
351
|
-
requirement: !ruby/object:Gem::Requirement
|
352
|
-
requirements:
|
353
|
-
- - '='
|
354
|
-
- !ruby/object:Gem::Version
|
355
|
-
version: 1.26.3
|
356
|
-
type: :runtime
|
357
|
-
prerelease: false
|
358
|
-
version_requirements: !ruby/object:Gem::Requirement
|
359
|
-
requirements:
|
360
|
-
- - '='
|
361
|
-
- !ruby/object:Gem::Version
|
362
|
-
version: 1.26.3
|
363
349
|
- !ruby/object:Gem::Dependency
|
364
350
|
name: puma
|
365
351
|
requirement: !ruby/object:Gem::Requirement
|
366
352
|
requirements:
|
367
353
|
- - '='
|
368
354
|
- !ruby/object:Gem::Version
|
369
|
-
version: 6.
|
355
|
+
version: 6.5.0
|
370
356
|
type: :runtime
|
371
357
|
prerelease: false
|
372
358
|
version_requirements: !ruby/object:Gem::Requirement
|
373
359
|
requirements:
|
374
360
|
- - '='
|
375
361
|
- !ruby/object:Gem::Version
|
376
|
-
version: 6.
|
362
|
+
version: 6.5.0
|
377
363
|
- !ruby/object:Gem::Dependency
|
378
364
|
name: rack
|
379
365
|
requirement: !ruby/object:Gem::Requirement
|
@@ -408,14 +394,14 @@ dependencies:
|
|
408
394
|
requirements:
|
409
395
|
- - '='
|
410
396
|
- !ruby/object:Gem::Version
|
411
|
-
version: 2.2.
|
397
|
+
version: 2.2.1
|
412
398
|
type: :runtime
|
413
399
|
prerelease: false
|
414
400
|
version_requirements: !ruby/object:Gem::Requirement
|
415
401
|
requirements:
|
416
402
|
- - '='
|
417
403
|
- !ruby/object:Gem::Version
|
418
|
-
version: 2.2.
|
404
|
+
version: 2.2.1
|
419
405
|
- !ruby/object:Gem::Dependency
|
420
406
|
name: redis
|
421
407
|
requirement: !ruby/object:Gem::Requirement
|
@@ -450,42 +436,42 @@ dependencies:
|
|
450
436
|
requirements:
|
451
437
|
- - '='
|
452
438
|
- !ruby/object:Gem::Version
|
453
|
-
version: 5.
|
439
|
+
version: 5.22.0
|
454
440
|
type: :runtime
|
455
441
|
prerelease: false
|
456
442
|
version_requirements: !ruby/object:Gem::Requirement
|
457
443
|
requirements:
|
458
444
|
- - '='
|
459
445
|
- !ruby/object:Gem::Version
|
460
|
-
version: 5.
|
446
|
+
version: 5.22.0
|
461
447
|
- !ruby/object:Gem::Dependency
|
462
448
|
name: sentry-sidekiq
|
463
449
|
requirement: !ruby/object:Gem::Requirement
|
464
450
|
requirements:
|
465
451
|
- - '='
|
466
452
|
- !ruby/object:Gem::Version
|
467
|
-
version: 5.
|
453
|
+
version: 5.22.0
|
468
454
|
type: :runtime
|
469
455
|
prerelease: false
|
470
456
|
version_requirements: !ruby/object:Gem::Requirement
|
471
457
|
requirements:
|
472
458
|
- - '='
|
473
459
|
- !ruby/object:Gem::Version
|
474
|
-
version: 5.
|
460
|
+
version: 5.22.0
|
475
461
|
- !ruby/object:Gem::Dependency
|
476
462
|
name: sidekiq
|
477
463
|
requirement: !ruby/object:Gem::Requirement
|
478
464
|
requirements:
|
479
465
|
- - '='
|
480
466
|
- !ruby/object:Gem::Version
|
481
|
-
version: 7.3.
|
467
|
+
version: 7.3.6
|
482
468
|
type: :runtime
|
483
469
|
prerelease: false
|
484
470
|
version_requirements: !ruby/object:Gem::Requirement
|
485
471
|
requirements:
|
486
472
|
- - '='
|
487
473
|
- !ruby/object:Gem::Version
|
488
|
-
version: 7.3.
|
474
|
+
version: 7.3.6
|
489
475
|
- !ruby/object:Gem::Dependency
|
490
476
|
name: slack-notifier
|
491
477
|
requirement: !ruby/object:Gem::Requirement
|
@@ -506,14 +492,14 @@ dependencies:
|
|
506
492
|
requirements:
|
507
493
|
- - '='
|
508
494
|
- !ruby/object:Gem::Version
|
509
|
-
version:
|
495
|
+
version: 2.4.1
|
510
496
|
type: :runtime
|
511
497
|
prerelease: false
|
512
498
|
version_requirements: !ruby/object:Gem::Requirement
|
513
499
|
requirements:
|
514
500
|
- - '='
|
515
501
|
- !ruby/object:Gem::Version
|
516
|
-
version:
|
502
|
+
version: 2.4.1
|
517
503
|
- !ruby/object:Gem::Dependency
|
518
504
|
name: thor
|
519
505
|
requirement: !ruby/object:Gem::Requirement
|
@@ -632,14 +618,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
632
618
|
requirements:
|
633
619
|
- - ">="
|
634
620
|
- !ruby/object:Gem::Version
|
635
|
-
version: '
|
621
|
+
version: '3.2'
|
636
622
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
637
623
|
requirements:
|
638
624
|
- - ">="
|
639
625
|
- !ruby/object:Gem::Version
|
640
626
|
version: '0'
|
641
627
|
requirements: []
|
642
|
-
rubygems_version: 3.5.
|
628
|
+
rubygems_version: 3.5.22
|
643
629
|
signing_key:
|
644
630
|
specification_version: 4
|
645
631
|
summary: A phishing kit collector for scavengers
|