miteru 0.11.3 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miteru/attachement.rb +41 -0
- data/lib/miteru/crawler.rb +1 -1
- data/lib/miteru/notifier.rb +8 -1
- data/lib/miteru/version.rb +1 -1
- data/lib/miteru.rb +1 -0
- data/miteru.gemspec +3 -3
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e78ff07e29bdfb439c4f5a1c9918fdd689c3ee9a6e076cd48fc08ce2c7f129
|
4
|
+
data.tar.gz: 8524c293c6b72bf6a7d980306fcb15df6053e923241b1403590bb065ee10eac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 541a1464c16e6b1182bbc042de1225e7ac1aa04d6b048fe39aaa647f7d59d0ba88feb462f242d244eebb9999f51f1fc2d2d3561081be0a02d512668523eeab40
|
7
|
+
data.tar.gz: 128d70f6b65351a3023d9f9adb34b1bc8ffbcd6bafc9375891d2b8f7817f1da22ee8f367ee0eaf3dff42e29c9b4d381cab118216d53e542da22377029a8dc48d
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "uri"
|
4
|
+
|
5
|
+
module Miteru
|
6
|
+
class Attachement
|
7
|
+
attr_reader :url
|
8
|
+
def initialize(url)
|
9
|
+
@url = url
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_h
|
13
|
+
{
|
14
|
+
fallback: "urlscan.io link",
|
15
|
+
title: title,
|
16
|
+
title_link: title_link,
|
17
|
+
footer: "urlscan.io",
|
18
|
+
footer_icon: "http://www.google.com/s2/favicons?domain=urlscan.io"
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def title_link
|
25
|
+
domain ? "https://urlscan.io/domain/#{domain}" : "https://urlscan.io"
|
26
|
+
end
|
27
|
+
|
28
|
+
def title
|
29
|
+
domain || "N/A"
|
30
|
+
end
|
31
|
+
|
32
|
+
def domain
|
33
|
+
@domain ||=
|
34
|
+
[].tap do |out|
|
35
|
+
out << URI(url).hostname
|
36
|
+
rescue URI::Error => _
|
37
|
+
out << nil
|
38
|
+
end.first
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/miteru/crawler.rb
CHANGED
@@ -37,7 +37,7 @@ module Miteru
|
|
37
37
|
else
|
38
38
|
notify(website.url, website.compressed_files) if verbose
|
39
39
|
end
|
40
|
-
rescue OpenSSL::SSL::SSLError, HTTP::Error, LL::ParserError => _
|
40
|
+
rescue OpenSSL::SSL::SSLError, HTTP::Error, LL::ParserError, Addressable::URI::InvalidURIError => _
|
41
41
|
next
|
42
42
|
end
|
43
43
|
end
|
data/lib/miteru/notifier.rb
CHANGED
@@ -11,10 +11,17 @@ module Miteru
|
|
11
11
|
|
12
12
|
def notify(url, compressed_files)
|
13
13
|
message = compressed_files.empty? ? "it doesn't contain a phishing kit." : "it might contain phishing kit(s): (#{compressed_files.join(', ')})."
|
14
|
+
attachement = Attachement.new(url)
|
14
15
|
|
15
16
|
if post_to_slack? && !compressed_files.empty?
|
16
17
|
slack = Slack::Incoming::Webhooks.new(slack_webhook_url, channel: slack_channel)
|
17
|
-
slack.post
|
18
|
+
slack.post(
|
19
|
+
url,
|
20
|
+
attachments: [
|
21
|
+
{ text: message },
|
22
|
+
attachement.to_h
|
23
|
+
]
|
24
|
+
)
|
18
25
|
end
|
19
26
|
|
20
27
|
message = message.colorize(:light_red) unless compressed_files.empty?
|
data/lib/miteru/version.rb
CHANGED
data/lib/miteru.rb
CHANGED
data/miteru.gemspec
CHANGED
@@ -33,10 +33,10 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency "webmock", "~> 3.5"
|
34
34
|
|
35
35
|
spec.add_dependency "colorize", "~> 0.8"
|
36
|
-
spec.add_dependency "down", "~> 4.
|
37
|
-
spec.add_dependency "http", "~> 4.
|
36
|
+
spec.add_dependency "down", "~> 4.8"
|
37
|
+
spec.add_dependency "http", "~> 4.1"
|
38
38
|
spec.add_dependency "oga", "~> 2.15"
|
39
|
-
spec.add_dependency "parallel", "~> 1.
|
39
|
+
spec.add_dependency "parallel", "~> 1.14"
|
40
40
|
spec.add_dependency "slack-incoming-webhooks", "~> 0.2"
|
41
41
|
spec.add_dependency "thor", "~> 0.19"
|
42
42
|
end
|
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.12.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: 2019-
|
11
|
+
date: 2019-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '4.
|
131
|
+
version: '4.8'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '4.
|
138
|
+
version: '4.8'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: http
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '4.
|
145
|
+
version: '4.1'
|
146
146
|
type: :runtime
|
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: '4.
|
152
|
+
version: '4.1'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: oga
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '1.
|
173
|
+
version: '1.14'
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '1.
|
180
|
+
version: '1.14'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: slack-incoming-webhooks
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,6 +226,7 @@ files:
|
|
226
226
|
- docker/Dockerfile
|
227
227
|
- exe/miteru
|
228
228
|
- lib/miteru.rb
|
229
|
+
- lib/miteru/attachement.rb
|
229
230
|
- lib/miteru/cli.rb
|
230
231
|
- lib/miteru/crawler.rb
|
231
232
|
- lib/miteru/downloader.rb
|