miteru 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -9
- data/lib/miteru/cli.rb +7 -1
- data/lib/miteru/crawler.rb +16 -12
- data/lib/miteru/version.rb +1 -1
- data/lib/miteru/website.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aab5b29928c45f80d099e6c12dee3606fd3002696814c3ea1d937221a28dc2d0
|
4
|
+
data.tar.gz: eba0390423b107ac8d1df75bc39f47db8b182070aeadee56396cc24f174d6e70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00f9affdcae054c0570965f60afbfcf3c25fcdf57ad4a26b7d9411a54d917593b37bc861f3f3ef1d467817c00e18c88648b52cd15bd0fac087213adb722a3cb4
|
7
|
+
data.tar.gz: 49a9618ee2aa8f7914cc8341b04f8803c965ce5e2cb3f53469f27568e73ca2ccdc9a26a3b70a7bc576c2fe95049f7837bccdc74352eb6d4529e57fe7e2da70da
|
data/README.md
CHANGED
@@ -33,16 +33,17 @@ Usage:
|
|
33
33
|
miteru execute
|
34
34
|
|
35
35
|
Options:
|
36
|
-
[--auto-download], [--no-auto-download]
|
37
|
-
[--
|
38
|
-
|
39
|
-
|
40
|
-
[--
|
41
|
-
#
|
42
|
-
|
43
|
-
|
36
|
+
[--auto-download], [--no-auto-download] # Enable or disable auto-download of *.zip file(s)
|
37
|
+
[--directory-traveling], [--no-directory-traveling] # Enable or disable directory traveling
|
38
|
+
[--download-to=DOWNLOAD_TO] # Directory to download file(s)
|
39
|
+
# Default: /tmp
|
40
|
+
[--post-to-slack], [--no-post-to-slack] # Post a message to Slack if it detects a phishing kit
|
41
|
+
[--size=N] # Number of urlscan.io's results. (Max: 100,000)
|
42
|
+
# Default: 100
|
43
|
+
[--threads=N] # Number of threads to use
|
44
|
+
# Default: 10
|
44
45
|
[--verbose], [--no-verbose]
|
45
|
-
|
46
|
+
# Default: true
|
46
47
|
|
47
48
|
Execute the crawler
|
48
49
|
```
|
data/lib/miteru/cli.rb
CHANGED
@@ -9,6 +9,7 @@ require "thor"
|
|
9
9
|
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
|
+
method_option :directory_traveling, type: :boolean, default: false, desc: "Enable or disable directory traveling"
|
12
13
|
method_option :download_to, type: :string, default: "/tmp", desc: "Directory to download file(s)"
|
13
14
|
method_option :post_to_slack, type: :boolean, default: false, desc: "Post a message to Slack if it detects a phishing kit"
|
14
15
|
method_option :size, type: :numeric, default: 100, desc: "Number of urlscan.io's results. (Max: 100,000)"
|
@@ -16,7 +17,12 @@ module Miteru
|
|
16
17
|
method_option :verbose, type: :boolean, default: true
|
17
18
|
desc "execute", "Execute the crawler"
|
18
19
|
def execute
|
19
|
-
websites = Crawler.execute(
|
20
|
+
websites = Crawler.execute(
|
21
|
+
directory_traveling: options[:directory_traveling],
|
22
|
+
size: options[:size],
|
23
|
+
threads: options[:threads],
|
24
|
+
verbose: options[:verbose]
|
25
|
+
)
|
20
26
|
websites.each do |website|
|
21
27
|
next unless website.has_kit?
|
22
28
|
|
data/lib/miteru/crawler.rb
CHANGED
@@ -7,14 +7,16 @@ require "uri"
|
|
7
7
|
|
8
8
|
module Miteru
|
9
9
|
class Crawler
|
10
|
-
attr_reader :
|
10
|
+
attr_reader :directory_traveling
|
11
11
|
attr_reader :size
|
12
|
+
attr_reader :threads
|
12
13
|
attr_reader :verbose
|
13
14
|
|
14
15
|
URLSCAN_ENDPOINT = "https://urlscan.io/api/v1"
|
15
16
|
OPENPHISH_ENDPOINT = "https://openphish.com"
|
16
17
|
|
17
|
-
def initialize(size: 100, threads: 10, verbose: false)
|
18
|
+
def initialize(directory_traveling: false, size: 100, threads: 10, verbose: false)
|
19
|
+
@directory_traveling = directory_traveling
|
18
20
|
@size = size
|
19
21
|
@threads = threads
|
20
22
|
@verbose = verbose
|
@@ -39,14 +41,16 @@ module Miteru
|
|
39
41
|
return []
|
40
42
|
end
|
41
43
|
base = "#{uri.scheme}://#{uri.hostname}"
|
42
|
-
[base]
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
#
|
48
|
-
|
49
|
-
|
44
|
+
return [base] unless directory_traveling
|
45
|
+
|
46
|
+
segments = uri.path.split("/")
|
47
|
+
return [base] if segments.length.zero?
|
48
|
+
|
49
|
+
urls = (0...segments.length).map { |idx| "#{base}#{segments[0..idx].join('/')}" }
|
50
|
+
urls.reject do |breakdowned_url|
|
51
|
+
# Reject a url which ends with specific extension names
|
52
|
+
%w(.htm .html .php .asp .aspx).any? { |ext| breakdowned_url.end_with? ext }
|
53
|
+
end
|
50
54
|
end
|
51
55
|
|
52
56
|
def suspicious_urls
|
@@ -73,8 +77,8 @@ module Miteru
|
|
73
77
|
websites
|
74
78
|
end
|
75
79
|
|
76
|
-
def self.execute(size: 100, threads: 10, verbose: false)
|
77
|
-
new(size: size, threads: threads, verbose: verbose).execute
|
80
|
+
def self.execute(directory_traveling: false, size: 100, threads: 10, verbose: false)
|
81
|
+
new(directory_traveling: directory_traveling, size: size, threads: threads, verbose: verbose).execute
|
78
82
|
end
|
79
83
|
|
80
84
|
private
|
data/lib/miteru/version.rb
CHANGED
data/lib/miteru/website.rb
CHANGED
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: 0.
|
4
|
+
version: 0.7.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: 2018-09-
|
11
|
+
date: 2018-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|