miteru 0.12.3 → 0.12.4
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 +44 -12
- data/lib/miteru/feeds.rb +1 -1
- data/lib/miteru/kit.rb +2 -0
- data/lib/miteru/notifier.rb +2 -5
- 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: e9e6b96b39d329d3003d0cec2d06f99814f7f9fb518cb80f8c465999a548e88f
|
4
|
+
data.tar.gz: 5fb646c603f612f09de5c9da2cce8a0c3b379af7d9e3a31994ea2403da37e35a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 173f0e24dba5aee1e5cfb126bc70d2e7ae0e7ebf13c59a55f60a023ce9705e84e86f645770c27f5026a48029124355ffa54e68f0b0dfc1675b397f7e6c9544ca
|
7
|
+
data.tar.gz: c8c46730a108355c70696b2034cfd4bbf0a71c144e295c774cc214abb01600e97ecfb6747114bcec904a0852eb5db56fbe7b35aa45d4244f2763e4dff0cf0223
|
data/lib/miteru/attachement.rb
CHANGED
@@ -9,33 +9,65 @@ module Miteru
|
|
9
9
|
@url = url
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def to_a
|
13
|
+
[
|
14
|
+
{
|
15
|
+
text: defanged_url,
|
16
|
+
fallback: "VT & urlscan.io links",
|
17
|
+
actions: actions
|
18
|
+
}
|
19
|
+
]
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def actions
|
25
|
+
[vt_link, urlscan_link].compact
|
26
|
+
end
|
27
|
+
|
28
|
+
def vt_link
|
29
|
+
return nil unless _vt_link
|
30
|
+
|
13
31
|
{
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
footer: "urlscan.io",
|
18
|
-
footer_icon: "http://www.google.com/s2/favicons?domain=urlscan.io"
|
32
|
+
type: "button",
|
33
|
+
text: "Lookup on VirusTotal",
|
34
|
+
url: _vt_link,
|
19
35
|
}
|
20
36
|
end
|
21
37
|
|
22
|
-
|
38
|
+
def urlscan_link
|
39
|
+
return nil unless _urlscan_link
|
23
40
|
|
24
|
-
|
25
|
-
|
41
|
+
{
|
42
|
+
type: "button",
|
43
|
+
text: "Lookup on urlscan.io",
|
44
|
+
url: _urlscan_link,
|
45
|
+
}
|
26
46
|
end
|
27
47
|
|
28
|
-
def
|
29
|
-
|
48
|
+
def defanged_url
|
49
|
+
@defanged_url ||= url.to_s.gsub /\./, "[.]"
|
30
50
|
end
|
31
51
|
|
32
52
|
def domain
|
33
53
|
@domain ||=
|
34
54
|
[].tap do |out|
|
35
55
|
out << URI(url).hostname
|
36
|
-
rescue URI::Error =>
|
56
|
+
rescue URI::Error => _e
|
37
57
|
out << nil
|
38
58
|
end.first
|
39
59
|
end
|
60
|
+
|
61
|
+
def _urlscan_link
|
62
|
+
return nil unless domain
|
63
|
+
|
64
|
+
"https://urlscan.io/domain/#{domain}"
|
65
|
+
end
|
66
|
+
|
67
|
+
def _vt_link
|
68
|
+
return nil unless domain
|
69
|
+
|
70
|
+
"https://www.virustotal.com/#/domain/#{domain}"
|
71
|
+
end
|
40
72
|
end
|
41
73
|
end
|
data/lib/miteru/feeds.rb
CHANGED
data/lib/miteru/kit.rb
CHANGED
data/lib/miteru/notifier.rb
CHANGED
@@ -15,11 +15,8 @@ module Miteru
|
|
15
15
|
if post_to_slack? && !kits.empty?
|
16
16
|
slack = Slack::Incoming::Webhooks.new(slack_webhook_url, channel: slack_channel)
|
17
17
|
slack.post(
|
18
|
-
|
19
|
-
attachments:
|
20
|
-
{ text: message },
|
21
|
-
attachement.to_h
|
22
|
-
]
|
18
|
+
message,
|
19
|
+
attachments: attachement.to_a
|
23
20
|
)
|
24
21
|
end
|
25
22
|
|
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.12.
|
4
|
+
version: 0.12.4
|
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-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|