mihari 1.3.2 → 1.4.0

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: 512d3ee8179279b931bd9510c652693ead1108ead99c823e26880e2a75234b24
4
- data.tar.gz: 81946c213ef30712644637e8ea5e01bea36956aad077ed37bdac60d0adf71f19
3
+ metadata.gz: ab3906ec64d1f2fe33db26d91da0459b3509a8a30b7ad68bd5613fb04f6b788b
4
+ data.tar.gz: 6824cc1b248e17828f57fd5c39089a04ac49ac5e8e92b7b30491c2e32d2eefe7
5
5
  SHA512:
6
- metadata.gz: d6e8b1e9a8791aebfe042de31b1f895fce4bc20d26a417672eaf4dafa83319f2cfb407ee635fe004f70a9d78441c43398c0af79cde01b3bb39bdcfb1dfd9e0c3
7
- data.tar.gz: '09ad98242f96474358908d68ef24f2f8711206b698499d18419346004a853ed5cace40df63e1055e82444e43ac9160fa02fc40d0a662d7a17d290a0dee13fb50'
6
+ metadata.gz: 6449ac095213ed065d8a00f98d34666b3824acf77a1183e17b65a24d1cb29088284677b7169e5832755daa20a8db16df474b241df74f4ee06e556bf6cebaf7ae
7
+ data.tar.gz: 6816de8e51d95352265678bc6cba347b462f1d4a100896a3a48a848c92516bb13e8d106964a13d44082d55e2be88447e92bac6abee799ef50b2b935543a588e9
@@ -9,16 +9,33 @@ module Mihari
9
9
  attr_reader :description
10
10
  attr_reader :query
11
11
  attr_reader :tags
12
+
13
+ attr_reader :filter
12
14
  attr_reader :target_type
15
+ attr_reader :use_pro
16
+ attr_reader :use_similarity
13
17
 
14
- def initialize(query, title: nil, description: nil, tags: [], target_type: "url")
18
+ def initialize(
19
+ query,
20
+ description: nil,
21
+ filter: nil,
22
+ tags: [],
23
+ target_type: "url",
24
+ title: nil,
25
+ use_pro: false,
26
+ use_similarity: false
27
+ )
15
28
  super()
16
29
 
17
30
  @query = query
18
31
  @title = title || "urlscan lookup"
19
32
  @description = description || "query = #{query}"
20
33
  @tags = tags
34
+
35
+ @filter = filter
21
36
  @target_type = target_type
37
+ @use_pro = use_pro
38
+ @use_similarity = use_similarity
22
39
 
23
40
  raise InvalidInputError, "type should be url, domain or ip." unless valid_target_type?
24
41
  end
@@ -44,6 +61,9 @@ module Mihari
44
61
  end
45
62
 
46
63
  def search
64
+ return api.pro.similar(query) if use_similarity
65
+ return api.pro.search(query: query, filter: filter, size: 10_000) if use_pro
66
+
47
67
  api.search(query, size: 10_000)
48
68
  end
49
69
 
@@ -46,7 +46,10 @@ module Mihari
46
46
  method_option :title, type: :string, desc: "title"
47
47
  method_option :description, type: :string, desc: "description"
48
48
  method_option :tags, type: :array, desc: "tags"
49
+ method_option :filter, type: :string, desc: "filter for urlscan pro search"
49
50
  method_option :target_type, type: :string, default: "url", desc: "target type to fetch from lookup results (target type should be 'url', 'domain' or 'ip')"
51
+ method_option :use_pro, type: :boolean, default: false, desc: "use pro search API or not"
52
+ method_option :use_similarity, type: :boolean, default: false, desc: "use similarity API or not"
50
53
  def urlscan(query)
51
54
  with_error_handling do
52
55
  run_analyzer Analyzers::Urlscan, query: query, options: options
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "1.3.2"
4
+ VERSION = "1.4.0"
5
5
  end
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "rubocop-performance", "~> 1.8"
36
36
  spec.add_development_dependency "timecop", "~> 0.9"
37
37
  spec.add_development_dependency "vcr", "~> 6.0"
38
- spec.add_development_dependency "webmock", "~> 3.8"
38
+ spec.add_development_dependency "webmock", "~> 3.9"
39
39
 
40
40
  spec.add_dependency "active_model_serializers", "~> 0.10"
41
41
  spec.add_dependency "activerecord", "~> 6.0"
@@ -65,7 +65,7 @@ Gem::Specification.new do |spec|
65
65
  spec.add_dependency "spysex", "~> 0.1"
66
66
  spec.add_dependency "sqlite3", "~> 1.4"
67
67
  spec.add_dependency "thor", "~> 1.0"
68
- spec.add_dependency "urlscan", "~> 0.5"
68
+ spec.add_dependency "urlscan", "~> 0.6"
69
69
  spec.add_dependency "virustotalx", "~> 1.1"
70
70
  spec.add_dependency "zoomeye-rb", "~> 0.1"
71
71
  end
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: 1.3.2
4
+ version: 1.4.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: 2020-09-12 00:00:00.000000000 Z
11
+ date: 2020-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '3.8'
173
+ version: '3.9'
174
174
  type: :development
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: '3.8'
180
+ version: '3.9'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: active_model_serializers
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -576,14 +576,14 @@ dependencies:
576
576
  requirements:
577
577
  - - "~>"
578
578
  - !ruby/object:Gem::Version
579
- version: '0.5'
579
+ version: '0.6'
580
580
  type: :runtime
581
581
  prerelease: false
582
582
  version_requirements: !ruby/object:Gem::Requirement
583
583
  requirements:
584
584
  - - "~>"
585
585
  - !ruby/object:Gem::Version
586
- version: '0.5'
586
+ version: '0.6'
587
587
  - !ruby/object:Gem::Dependency
588
588
  name: virustotalx
589
589
  requirement: !ruby/object:Gem::Requirement