miteru 0.5.0 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3784652417f9e36941b1bc9ed8a76acaa86481a4730223b8ad1913775980097
4
- data.tar.gz: 47526f0cc44c07a8aa9a651973f0fa4a3d455dfe49abed255f0aed1780abb604
3
+ metadata.gz: 166a1fddc570f084a95e186663f2e180834dcfa1066678991c4d6ea27f2f1af4
4
+ data.tar.gz: bc44cf63a3d83664550920d04b2fa527b1c05cb92229a0f661cd0686ce2f2cb8
5
5
  SHA512:
6
- metadata.gz: 124a5071040ee603dab9e5986064566e6e61d2acb812d052bc8cee69a673253894004b1824c3fac80fa467674640c2a21edec37a14aa1b22d1d03d40c7b99b4c
7
- data.tar.gz: 7da8680a710bef8081b2ba279843b53a28fba36c29290ba9566ce3e40fd892ac714a92feec4008236d2b84246ac5bbaa3d94600d008b39953c6103630faa3627
6
+ metadata.gz: 90e6bb04c2054742753eb92015443792afdd43002ccb16b9e96119d96627c0c4b34264382412e98b449f3474aeb95dfdebc51d6302c79b3071b17d82ceb4ac97
7
+ data.tar.gz: 1c65f5dea8bab1c7a7abe44814d0f2703cab12b3e8e3049bb89635540f205d54e3b7396830af0404732706f186b336af2c573c116c54cbb546058a3123ec21cc
data/README.md CHANGED
@@ -36,9 +36,11 @@ Options:
36
36
  [--auto-download], [--no-auto-download] # Enable or disable auto-download of *.zip file(s)
37
37
  [--download-to=DOWNLOAD_TO] # Directory to download file(s)
38
38
  # Default: /tmp
39
+ [--post-to-slack], [--no-post-to-slack] # Post a message to Slack if it detects a phishing kit
39
40
  [--size=N] # Number of urlscan.io's results. (Max: 100,000)
40
41
  # Default: 100
41
- [--post-to-slack], [--no-post-to-slack] # Post a message to Slack if it detects a phishing kit
42
+ [--threads=N] # Number of threads to use
43
+ # Default: 10
42
44
  [--verbose], [--no-verbose]
43
45
  # Default: true
44
46
 
@@ -53,3 +55,10 @@ https://dummy2.com: it doesn't contain a phishing kit.
53
55
  https://dummy3.com: it doesn't contain a phishing kit.
54
56
  https://dummy4.com: it might contain a phishing kit (dummy.zip).
55
57
  ```
58
+
59
+ ## Note
60
+
61
+ For using `--post-to-slack` feature, you should set the following environment variables:
62
+
63
+ - `SLACK_WEBHOOK_URL`: Your Slack Webhook URL.
64
+ - `SLACK_CHANNEL`: Slack channel to post a message (default: "#general").
data/lib/miteru/cli.rb CHANGED
@@ -10,12 +10,13 @@ module Miteru
10
10
  class CLI < Thor
11
11
  method_option :auto_download, type: :boolean, default: false, desc: "Enable or disable auto-download of *.zip file(s)"
12
12
  method_option :download_to, type: :string, default: "/tmp", desc: "Directory to download file(s)"
13
- method_option :size, type: :numeric, default: 100, desc: "Number of urlscan.io's results. (Max: 100,000)"
14
13
  method_option :post_to_slack, type: :boolean, default: false, desc: "Post a message to Slack if it detects a phishing kit"
14
+ method_option :size, type: :numeric, default: 100, desc: "Number of urlscan.io's results. (Max: 100,000)"
15
+ method_option :threads, type: :numeric, default: 10, desc: "Number of threads to use"
15
16
  method_option :verbose, type: :boolean, default: true
16
17
  desc "execute", "Execute the crawler"
17
18
  def execute
18
- websites = Crawler.execute(size: options[:size], verbose: options[:verbose])
19
+ websites = Crawler.execute(size: options[:size], threads: options[:threads], verbose: options[:verbose])
19
20
  websites.each do |website|
20
21
  next unless website.has_kit?
21
22
 
@@ -14,9 +14,9 @@ module Miteru
14
14
  URLSCAN_ENDPOINT = "https://urlscan.io/api/v1"
15
15
  OPENPHISH_ENDPOINT = "https://openphish.com"
16
16
 
17
- def initialize(size: 100, verbose: false)
18
- @threads = 10
17
+ def initialize(size: 100, threads: 10, verbose: false)
19
18
  @size = size
19
+ @threads = threads
20
20
  @verbose = verbose
21
21
  raise ArgumentError, "size must be less than 100,000" if size > 100_000
22
22
  end
@@ -70,8 +70,8 @@ module Miteru
70
70
  websites
71
71
  end
72
72
 
73
- def self.execute(size: 100, verbose: false)
74
- new(size: size, verbose: verbose).execute
73
+ def self.execute(size: 100, threads: 10, verbose: false)
74
+ new(size: size, threads: threads, verbose: verbose).execute
75
75
  end
76
76
 
77
77
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Miteru
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miteru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki