miteru 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5c223747e06cb6d010f4a5e3157b1a4999662761ccaef108521b1627489b800
4
- data.tar.gz: 403ed81289db89582add2420290b6f8c343da88babf2c548940871f0791655dd
3
+ metadata.gz: 7428f741cd791e37e5f201c978f4ee6b5f6fe239d350b69d3377a6af4604305d
4
+ data.tar.gz: 0057c9ee7ebe6dd5ee039939b30ff897d3298605c3843c980f2b30081ad8bc2d
5
5
  SHA512:
6
- metadata.gz: 255a86779cdb3473ba4b7683159b1290b0774eae7863db2cd9e770610b6a14f1397ff1a07823132009daafc5b0c75aea2489cd39c051067311242cf30535517d
7
- data.tar.gz: 3662c8946aba747ad6dcda2fbedc1dc34b0cba8fd680e9d573b3a1c24114b5658f5029ecb3bf5e222c2d4cced01dd0f6f1542d4878566fab0880456bb500997e
6
+ metadata.gz: b4f69cf18c8db256f035466f669835810e53329f7af7df5fd3d58689002c2e7175abb9456b31e21c0b23369e31a1559040c82f92c662202661c50cc8cc702334
7
+ data.tar.gz: d7188fe6bc2372560031fb964254f5ea6df56672edd0f112a6ebe7b41d5ad7efa2a52e6c1deb666891573990f0cf75e8b4ea768f5240cd5d25127a544e06e26c
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ Style/StringLiterals:
2
+ EnforcedStyle: double_quotes
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Miteru
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/miteru.svg)](https://badge.fury.io/rb/miteru)
4
- [![Ruby CI](https://github.com/ninoseki/miteru/actions/workflows/test.yml/badge.svg)](https://github.com/ninoseki/miteru/actions/workflows/test.yml)
4
+ [![Ruby CI](https://github.com/ninoseki/miteru/actions/workflows/ruby.yml/badge.svg)](https://github.com/ninoseki/miteru/actions/workflows/ruby.yml)
5
5
  [![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/miteru/badge)](https://www.codefactor.io/repository/github/ninoseki/miteru)
6
6
  [![Coverage Status](https://coveralls.io/repos/github/ninoseki/miteru/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/miteru?branch=master)
7
7
 
@@ -14,12 +14,12 @@ I take no responsibility and/or liability for how you choose to use this tool.
14
14
 
15
15
  ## How It Works
16
16
 
17
- - It collects phishy URLs from the following feeds:
18
- - urlscan.io's automatic submissions. (`task.method:automatic`)
17
+ - Collect phishy URLs from the following feeds:
18
+ - urlscan.io's automatic submissions. (`task.method:automatic AND NOT task.source:urlscan-observe`)
19
19
  - urlscan.io phish feed. (available for Pro users)
20
20
  - [mitchellkrogza/Phishing.Database](https://github.com/mitchellkrogza/Phishing.Database)'s `phishing-links-ACTIVE-NOW.txt`.
21
21
  - [ninoseki/ayashige](https://github.com/ninoseki/ayashige) feed.
22
- - It checks each phishy URL whether it enables directory listing and contains phishing kits (compressed files) or not.
22
+ - Check each phishy URL whether it enables directory listing and contains phishing kits (compressed files) or not.
23
23
  - Note: Supported compressed files are: `*.zip`, `*.rar`, `*.7z`, `*.tar` and `*.gz`.
24
24
 
25
25
  ## Docs
data/lib/miteru/config.rb CHANGED
@@ -27,7 +27,8 @@ module Miteru
27
27
  threads: Parallel.processor_count,
28
28
  urlscan_api_key: nil,
29
29
  urlscan_submit_visibility: "public",
30
- urlscan_date_condition: ">now-1h",
30
+ urlscan_date_condition: "date:>now-1h",
31
+ urlscan_base_condition: "task.method:automatic AND NOT task.source:urlscan-observe",
31
32
  verbose: false
32
33
  )
33
34
 
@@ -91,6 +92,9 @@ module Miteru
91
92
  # @!attribute [r] urlscan_date_condition
92
93
  # @return [String]
93
94
 
95
+ # @!attribute [r] urlscan_base_condition
96
+ # @return [String]
97
+
94
98
  def database_url=(val)
95
99
  super(URI(val.to_s))
96
100
  end
@@ -3,9 +3,6 @@
3
3
  module Miteru
4
4
  class Feeds
5
5
  class Ayashige < Base
6
- HOST = "ayashige.herokuapp.com"
7
- URL = "https://#{HOST}".freeze
8
-
9
6
  def initialize(base_url = "https://ayashige.herokuapp.com")
10
7
  super(base_url)
11
8
  end
@@ -31,7 +31,7 @@ module Miteru
31
31
  end
32
32
 
33
33
  def q
34
- "task.method:automatic AND date:#{Miteru.config.urlscan_date_condition}"
34
+ "#{base_condition} AND #{date_condition}"
35
35
  end
36
36
 
37
37
  #
@@ -59,6 +59,14 @@ module Miteru
59
59
  end
60
60
  end
61
61
  end
62
+
63
+ def base_condition
64
+ Miteru.config.urlscan_base_condition
65
+ end
66
+
67
+ def date_condition
68
+ Miteru.config.urlscan_date_condition
69
+ end
62
70
  end
63
71
  end
64
72
  end
@@ -23,7 +23,7 @@ module Miteru
23
23
  end
24
24
 
25
25
  def q
26
- "date:#{Miteru.config.urlscan_date_condition}"
26
+ Miteru.config.urlscan_date_condition
27
27
  end
28
28
 
29
29
  def format
@@ -87,7 +87,7 @@ module Miteru
87
87
  end
88
88
 
89
89
  def callable?
90
- !Miteru.config.slack_webhook_url.nil?
90
+ !slack_webhook_url.nil?
91
91
  end
92
92
 
93
93
  private
@@ -40,7 +40,14 @@ module Miteru
40
40
  Miteru.logger.warn("Feed:#{feed.source} failed - #{result.failure}")
41
41
  end
42
42
  end
43
- end.flatten
43
+ end.flatten.uniq(&:url)
44
+ end
45
+
46
+ #
47
+ # @return [Array<Miteru::Feeds::Base>]
48
+ #
49
+ def feeds
50
+ Miteru.feeds.map(&:new)
44
51
  end
45
52
 
46
53
  private
@@ -52,12 +59,5 @@ module Miteru
52
59
  def verbose?
53
60
  Miteru.config.verbose
54
61
  end
55
-
56
- #
57
- # @return [Array<Miteru::Feeds::Base>]
58
- #
59
- def feeds
60
- Miteru.feeds.map(&:new)
61
- end
62
62
  end
63
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Miteru
4
- VERSION = "2.0.2"
4
+ VERSION = "2.1.0"
5
5
  end
data/miteru.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'mysql2', '~> 0.5'
33
33
  spec.add_development_dependency 'pg', '~> 1.5'
34
34
  spec.add_development_dependency 'rake', '~> 13.1'
35
- spec.add_development_dependency 'rspec', '~> 3.12'
35
+ spec.add_development_dependency 'rspec', '~> 3.13'
36
36
  spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
37
37
  spec.add_development_dependency 'standard', '~> 1.33'
38
38
  spec.add_development_dependency 'test-prof', '~> 1.3'
@@ -47,12 +47,12 @@ Gem::Specification.new do |spec|
47
47
  spec.add_dependency 'down', '5.4.1'
48
48
  spec.add_dependency 'dry-files', '1.1.0'
49
49
  spec.add_dependency 'dry-monads', '1.6.0'
50
- spec.add_dependency 'http', '5.1.1'
50
+ spec.add_dependency 'http', '5.2.0'
51
51
  spec.add_dependency 'memo_wise', '1.8.0'
52
52
  spec.add_dependency 'oga', '3.4'
53
53
  spec.add_dependency 'parallel', '1.24.0'
54
54
  spec.add_dependency 'puma', '6.4.2'
55
- spec.add_dependency 'rack', '3.0.8'
55
+ spec.add_dependency 'rack', '3.0.9'
56
56
  spec.add_dependency 'rack-session', '2.0.0'
57
57
  spec.add_dependency 'rackup', '2.1.0'
58
58
  spec.add_dependency 'semantic_logger', '4.15.0'
@@ -60,7 +60,7 @@ Gem::Specification.new do |spec|
60
60
  spec.add_dependency 'sentry-sidekiq', '5.16.1'
61
61
  spec.add_dependency 'sidekiq', '7.2.1'
62
62
  spec.add_dependency 'slack-notifier', '2.4.0'
63
- spec.add_dependency 'sqlite3', '1.7.1'
63
+ spec.add_dependency 'sqlite3', '1.7.2'
64
64
  spec.add_dependency 'thor', '1.3.0'
65
65
  spec.add_dependency 'thor-hollaback', '0.2.1'
66
66
  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: 2.0.2
4
+ version: 2.1.0
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-01-29 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.12'
117
+ version: '3.13'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.12'
124
+ version: '3.13'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov-lcov
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -310,14 +310,14 @@ dependencies:
310
310
  requirements:
311
311
  - - '='
312
312
  - !ruby/object:Gem::Version
313
- version: 5.1.1
313
+ version: 5.2.0
314
314
  type: :runtime
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
318
  - - '='
319
319
  - !ruby/object:Gem::Version
320
- version: 5.1.1
320
+ version: 5.2.0
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: memo_wise
323
323
  requirement: !ruby/object:Gem::Requirement
@@ -380,14 +380,14 @@ dependencies:
380
380
  requirements:
381
381
  - - '='
382
382
  - !ruby/object:Gem::Version
383
- version: 3.0.8
383
+ version: 3.0.9
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: 3.0.8
390
+ version: 3.0.9
391
391
  - !ruby/object:Gem::Dependency
392
392
  name: rack-session
393
393
  requirement: !ruby/object:Gem::Requirement
@@ -492,14 +492,14 @@ dependencies:
492
492
  requirements:
493
493
  - - '='
494
494
  - !ruby/object:Gem::Version
495
- version: 1.7.1
495
+ version: 1.7.2
496
496
  type: :runtime
497
497
  prerelease: false
498
498
  version_requirements: !ruby/object:Gem::Requirement
499
499
  requirements:
500
500
  - - '='
501
501
  - !ruby/object:Gem::Version
502
- version: 1.7.1
502
+ version: 1.7.2
503
503
  - !ruby/object:Gem::Dependency
504
504
  name: thor
505
505
  requirement: !ruby/object:Gem::Requirement
@@ -554,6 +554,7 @@ files:
554
554
  - ".github/workflows/ruby.yml"
555
555
  - ".gitignore"
556
556
  - ".rspec"
557
+ - ".rubocop.yml"
557
558
  - Gemfile
558
559
  - LICENSE
559
560
  - README.md
@@ -600,7 +601,6 @@ files:
600
601
  - lib/miteru/website.rb
601
602
  - miteru.gemspec
602
603
  - renovate.json
603
- - screenshots/slack.png
604
604
  homepage: https://github.com/ninoseki/miteru
605
605
  licenses:
606
606
  - MIT
Binary file