miteru 0.14.5 → 0.14.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docker/Dockerfile +1 -1
- data/lib/miteru/kit.rb +26 -10
- data/lib/miteru/version.rb +1 -1
- data/miteru.gemspec +4 -4
- data/renovate.json +5 -0
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e33e427231064c47dd4e1358e71e009ebc9418af15350e1f9c7f833ea02205f
|
4
|
+
data.tar.gz: cf3e3f1608a6be63b7b5b93f1e12a8264935da1e059bfbda7437f91a8009bf63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e26651ad45bfc20c22b6584b3ea6f8419f99801f36e6673835034c4a77da3ea5ec2502273265fae8f89590551c4bd3eb42f33bc66a6fb3b873422b57e5136d40
|
7
|
+
data.tar.gz: f582e8422d5d33a97b8f9d3ae7aa58fe1346fc68284b867c0139f7bb908107b3b8eb8081f1bcdc3bbfb678427d318e6eaf269ce1d28647d317ec7dd8ed49a7d8
|
data/docker/Dockerfile
CHANGED
data/lib/miteru/kit.rb
CHANGED
@@ -10,12 +10,23 @@ module Miteru
|
|
10
10
|
|
11
11
|
attr_reader :url
|
12
12
|
|
13
|
+
attr_reader :status
|
14
|
+
attr_reader :content_length
|
15
|
+
attr_reader :mime_type
|
16
|
+
|
13
17
|
def initialize(url)
|
14
18
|
@url = url
|
19
|
+
|
20
|
+
@content_length = nil
|
21
|
+
@mime_type = nil
|
22
|
+
@status = nil
|
15
23
|
end
|
16
24
|
|
17
25
|
def valid?;
|
18
|
-
|
26
|
+
# make a HEAD request for the validation
|
27
|
+
before_validation
|
28
|
+
|
29
|
+
valid_ext? && reachable? && valid_mime_type? && valid_content_length?
|
19
30
|
end
|
20
31
|
|
21
32
|
def extname
|
@@ -70,20 +81,25 @@ module Miteru
|
|
70
81
|
VALID_EXTENSIONS.include? extname
|
71
82
|
end
|
72
83
|
|
73
|
-
def
|
74
|
-
|
84
|
+
def before_validation
|
85
|
+
res = HTTPClient.head(url)
|
86
|
+
@content_length = res.content_length
|
87
|
+
@mime_type = res.content_type.mime_type.to_s
|
88
|
+
@status = res.status
|
89
|
+
rescue StandardError
|
90
|
+
# do nothing
|
75
91
|
end
|
76
92
|
|
77
|
-
def
|
78
|
-
|
93
|
+
def reachable?
|
94
|
+
status&.success?
|
95
|
+
end
|
96
|
+
|
97
|
+
def valid_mime_type?
|
79
98
|
VALID_MIME_TYPES.include? mime_type
|
80
99
|
end
|
81
100
|
|
82
|
-
def
|
83
|
-
|
84
|
-
reachable?(res) && valid_mime_type?(res)
|
85
|
-
rescue StandardError
|
86
|
-
false
|
101
|
+
def valid_content_length?
|
102
|
+
content_length.to_i > 0
|
87
103
|
end
|
88
104
|
end
|
89
105
|
end
|
data/lib/miteru/version.rb
CHANGED
data/miteru.gemspec
CHANGED
@@ -30,14 +30,14 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "rake", "~> 13.0"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.9"
|
32
32
|
spec.add_development_dependency "vcr", "~> 6.0"
|
33
|
-
spec.add_development_dependency "webmock", "~> 3.
|
33
|
+
spec.add_development_dependency "webmock", "~> 3.9"
|
34
34
|
|
35
35
|
spec.add_dependency "colorize", "~> 0.8"
|
36
|
-
spec.add_dependency "down", "~> 5.
|
36
|
+
spec.add_dependency "down", "~> 5.2"
|
37
37
|
spec.add_dependency "http", "~> 4.4"
|
38
|
-
spec.add_dependency "oga", "~> 3.
|
38
|
+
spec.add_dependency "oga", "~> 3.3"
|
39
39
|
spec.add_dependency "parallel", "~> 1.19"
|
40
40
|
spec.add_dependency "slack-notifier", "~> 2.3"
|
41
41
|
spec.add_dependency "thor", "~> 1.0"
|
42
|
-
spec.add_dependency "urlscan", "~> 0.
|
42
|
+
spec.add_dependency "urlscan", "~> 0.6"
|
43
43
|
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.14.
|
4
|
+
version: 0.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3.
|
103
|
+
version: '3.9'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '3.
|
110
|
+
version: '3.9'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: colorize
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '5.
|
131
|
+
version: '5.2'
|
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: '5.
|
138
|
+
version: '5.2'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: http
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '3.
|
159
|
+
version: '3.3'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '3.
|
166
|
+
version: '3.3'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: parallel
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +212,14 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: '0.
|
215
|
+
version: '0.6'
|
216
216
|
type: :runtime
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: '0.
|
222
|
+
version: '0.6'
|
223
223
|
description: An experimental phishing kit detector
|
224
224
|
email:
|
225
225
|
- manabu.niseki@gmail.com
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- lib/miteru/version.rb
|
260
260
|
- lib/miteru/website.rb
|
261
261
|
- miteru.gemspec
|
262
|
+
- renovate.json
|
262
263
|
- screenshots/slack.png
|
263
264
|
homepage: https://github.com/ninoseki/miteru
|
264
265
|
licenses:
|