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 +4 -4
- data/lib/mihari/analyzers/urlscan.rb +21 -1
- data/lib/mihari/cli.rb +3 -0
- data/lib/mihari/version.rb +1 -1
- data/mihari.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab3906ec64d1f2fe33db26d91da0459b3509a8a30b7ad68bd5613fb04f6b788b
|
4
|
+
data.tar.gz: 6824cc1b248e17828f57fd5c39089a04ac49ac5e8e92b7b30491c2e32d2eefe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
|
data/lib/mihari/cli.rb
CHANGED
@@ -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
|
data/lib/mihari/version.rb
CHANGED
data/mihari.gemspec
CHANGED
@@ -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.
|
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.
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
586
|
+
version: '0.6'
|
587
587
|
- !ruby/object:Gem::Dependency
|
588
588
|
name: virustotalx
|
589
589
|
requirement: !ruby/object:Gem::Requirement
|