mihari 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 777180f61db321707c6f72c02256fd9e2da24d5cc45f66430d8666a1baf36601
4
- data.tar.gz: 888a4dea9f82823635b9c45418102a57ad60865bf769ddffbc14582d6244efe1
3
+ metadata.gz: 249e7df317ee9b52f8ea3b5cfd61907e01c0b70b212198c761d187d9e7632c05
4
+ data.tar.gz: '0286a744aac6c5572fb427167a221eab3021d7f2f640a7de80e8426cf9f79ca4'
5
5
  SHA512:
6
- metadata.gz: 54c3574805ccd106646d4a75841d79d0ae8da6b1d1062b92d7d202439b15254772e625e6d64aeacc384c7727bc756f3452281ed1bf51ddc0a47df92c7f5873f5
7
- data.tar.gz: 616b4e01a4af3454c9e1d9e5dad4834d553facff5981a462f371991ff391539335b76114652def78d19c64d10583e6bff9fa7ba2a5e475dc79f79065338916cd
6
+ metadata.gz: c962e2822a4202d4e0ad1566964363aaa4ec3aa9cfa70de3cebd263a2929d92b04d01c2825ce300206afcf7b8dc3baec679dd5c0d6fd3db484a82755457f3de1
7
+ data.tar.gz: 796f880fcc0c71cc0d11ee393dc710a9e647cbc545d950c9b4a350336284c17fe9c31438bd5f1344bec185b796782efd7bc82669e821b4e407ad39d3dd080a88
@@ -16,15 +16,21 @@ module Mihari
16
16
  @data_type = data_type
17
17
  end
18
18
 
19
+ def fields
20
+ [vt_link, urlscan_link].compact
21
+ end
22
+
23
+ def actions
24
+ [vt_link, urlscan_link].compact
25
+ end
26
+
19
27
  def vt_link
20
28
  return nil unless _vt_link
21
29
 
22
30
  {
23
- fallback: "VT link",
24
- title: data,
25
- title_link: _vt_link,
26
- footer: "virustotal.com",
27
- footer_icon: "http://www.google.com/s2/favicons?domain=virustotal.com"
31
+ type: "button",
32
+ text: "Lookup on VirusTotal",
33
+ url: _vt_link,
28
34
  }
29
35
  end
30
36
 
@@ -32,17 +38,21 @@ module Mihari
32
38
  return nil unless _urlscan_link
33
39
 
34
40
  {
35
- fallback: "urlscan.io link",
36
- title: data,
37
- title_link: _urlscan_link,
38
- footer: "urlscan.io",
39
- footer_icon: "http://www.google.com/s2/favicons?domain=urlscan.io"
41
+ type: "button",
42
+ text: "Lookup on urlscan.io",
43
+ url: _urlscan_link,
40
44
  }
41
45
  end
42
46
 
43
47
  # @return [Array]
44
48
  def to_a
45
- [vt_link, urlscan_link].compact
49
+ [
50
+ {
51
+ text: defanged_data,
52
+ fallback: "VT & urlscan.io links",
53
+ actions: actions
54
+ }
55
+ ]
46
56
  end
47
57
 
48
58
  private
@@ -82,6 +92,11 @@ module Mihari
82
92
  def sha256
83
93
  Digest::SHA256.hexdigest data
84
94
  end
95
+
96
+ # @return [String]
97
+ def defanged_data
98
+ @defanged_data ||= data.to_s.gsub /\./, "[.]"
99
+ end
85
100
  end
86
101
 
87
102
  class Slack < Base
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mihari
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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-05-04 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler