mihari 0.13.1 → 0.13.2

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: df5ec8a92b6bf1622274b5b488aa544520d15f0360e5274ba466f324f49d0e0e
4
- data.tar.gz: eb6149534d02b0ee551f37b7f01a65e3c936851fdb589bf21b1b938cb2f9d963
3
+ metadata.gz: c5a283261490c642311f94a2cb72a5a1596b2b5b2d3ba1b69d54b7ef785b4d39
4
+ data.tar.gz: '078f0fa96c14cd90a1c91ba1ca6235c453049b826719fc69db8e2c629e7fcc49'
5
5
  SHA512:
6
- metadata.gz: 51bd37cf056ad05ba6c5abd499b045ef963de6bb30414168229826a390ff0ee66a751204d6210336e668092a397f4d879c3a0ad39fcd84b381f11c77b42d7c74
7
- data.tar.gz: c1ad6709246b86ede8a204b2db51af678149fd5bccfec2701c6562cf52123b1215c18a644091e49f23f352e8d248bc40e1fc84523491c5893670b9bb8f3ee7d8
6
+ metadata.gz: d9189cbee2cce11c71342a06f741a8ff5d9351aedc0dd84e85378f8e2b4c88275812fa12cf0b8681965b09f27f7009bb7e7267cade8dd0c74655c11e28cd0d35
7
+ data.tar.gz: ead6cf8241cdba49266abdc455ba8d65287aa1defe9d8dd49a528b7061b26bcf7a23fb80c377d3c26a3a4554e3105aad57775affcf4ee5e720bf31885c1c9558
data/README.md CHANGED
@@ -69,22 +69,22 @@ mihari supports the following services by default.
69
69
  $ mihari
70
70
  Commands:
71
71
  mihari alerts # Show the alerts on TheHive
72
- mihari binaryedge [QUERY] # BinaryEdge lookup by a given query
73
- mihari censys [QUERY] # Censys IPv4 lookup by a given query
74
- mihari circl [DOMAIN|SHA1] # CIRCL passive DNS/SSL lookup by a given domain / SHA1 certificate fingerprint
75
- mihari crtsh [QUERY] # crt.sh lookup by a given query
76
- mihari dnpedia [QUERY] # DNPedia domain lookup by a given query
72
+ mihari binaryedge [QUERY] # BinaryEdge host search by a query
73
+ mihari censys [QUERY] # Censys IPv4 search by a query
74
+ mihari circl [DOMAIN|SHA1] # CIRCL passive DNS/SSL lookup by a domain / SHA1 certificate fingerprint
75
+ mihari crtsh [QUERY] # crt.sh search by a query
76
+ mihari dnpedia [QUERY] # DNPedia domain search by a query
77
77
  mihari help [COMMAND] # Describe available commands or one specific command
78
78
  mihari import_from_json # Give a JSON input via STDIN
79
- mihari onyphe [QUERY] # Onyphe datascan lookup by a given query
80
- mihari passivetotal [IP|DOMAIN|EMAIL|SHA1] # PassiveTotal lookup by a given ip / domain / email / SHA1 certificate fingerprint
81
- mihari securitytrails [IP|DOMAIN|EMAIL] # SecurityTrails lookup by a given ip, domain or email
82
- mihari securitytrails_domain_feed [REGEXP] # SecurityTrails new domain feed lookup by a given regexp
83
- mihari shodan [QUERY] # Shodan host lookup by a given query
79
+ mihari onyphe [QUERY] # Onyphe datascan search by a query
80
+ mihari passivetotal [IP|DOMAIN|EMAIL|SHA1] # PassiveTotal lookup by an ip / domain / email / SHA1 certificate fingerprint
81
+ mihari securitytrails [IP|DOMAIN|EMAIL] # SecurityTrails lookup by an ip, domain or email
82
+ mihari securitytrails_domain_feed [REGEXP] # SecurityTrails new domain feed search by a regexp
83
+ mihari shodan [QUERY] # Shodan host search by a query
84
84
  mihari status # Show the current configuration status
85
- mihari urlscan [QUERY] # urlscan lookup by a given query
86
- mihari virustotal [IP|DOMAIN] # VirusTotal resolutions lookup by a given ip or domain
87
- mihari zoomeye [QUERY] # ZoomEye lookup by a given query
85
+ mihari urlscan [QUERY] # urlscan search by a given query
86
+ mihari virustotal [IP|DOMAIN] # VirusTotal resolutions lookup by an ip or domain
87
+ mihari zoomeye [QUERY] # ZoomEye search by a query
88
88
 
89
89
  ```
90
90
 
@@ -77,7 +77,7 @@ module Mihari
77
77
  end
78
78
 
79
79
  def set_unique_artifacts
80
- retry_on_timeout { unique_artifacts }
80
+ retry_on_error { unique_artifacts }
81
81
  rescue ArgumentError => _e
82
82
  klass = self.class.to_s.split("::").last.to_s
83
83
  raise Error, "Please configure #{klass} API settings properly"
@@ -40,7 +40,7 @@ module Mihari
40
40
  end
41
41
 
42
42
  def search
43
- api.search(query)
43
+ api.search(query, size: 10_000)
44
44
  rescue ::UrlScan::ResponseError => _e
45
45
  nil
46
46
  end
data/lib/mihari/cli.rb CHANGED
@@ -5,7 +5,7 @@ require "json"
5
5
 
6
6
  module Mihari
7
7
  class CLI < Thor
8
- desc "censys [QUERY]", "Censys IPv4 lookup by a given query"
8
+ desc "censys [QUERY]", "Censys IPv4 search by a query"
9
9
  method_option :title, type: :string, desc: "title"
10
10
  method_option :description, type: :string, desc: "description"
11
11
  method_option :tags, type: :array, desc: "tags"
@@ -16,7 +16,7 @@ module Mihari
16
16
  end
17
17
  end
18
18
 
19
- desc "shodan [QUERY]", "Shodan host lookup by a given query"
19
+ desc "shodan [QUERY]", "Shodan host search by a query"
20
20
  method_option :title, type: :string, desc: "title"
21
21
  method_option :description, type: :string, desc: "description"
22
22
  method_option :tags, type: :array, desc: "tags"
@@ -26,7 +26,7 @@ module Mihari
26
26
  end
27
27
  end
28
28
 
29
- desc "onyphe [QUERY]", "Onyphe datascan lookup by a given query"
29
+ desc "onyphe [QUERY]", "Onyphe datascan search by a query"
30
30
  method_option :title, type: :string, desc: "title"
31
31
  method_option :description, type: :string, desc: "description"
32
32
  method_option :tags, type: :array, desc: "tags"
@@ -36,7 +36,7 @@ module Mihari
36
36
  end
37
37
  end
38
38
 
39
- desc "urlscan [QUERY]", "urlscan lookup by a given query"
39
+ desc "urlscan [QUERY]", "urlscan search by a given query"
40
40
  method_option :title, type: :string, desc: "title"
41
41
  method_option :description, type: :string, desc: "description"
42
42
  method_option :tags, type: :array, desc: "tags"
@@ -47,7 +47,7 @@ module Mihari
47
47
  end
48
48
  end
49
49
 
50
- desc "virustotal [IP|DOMAIN]", "VirusTotal resolutions lookup by a given ip or domain"
50
+ desc "virustotal [IP|DOMAIN]", "VirusTotal resolutions lookup by an ip or domain"
51
51
  method_option :title, type: :string, desc: "title"
52
52
  method_option :description, type: :string, desc: "description"
53
53
  method_option :tags, type: :array, desc: "tags"
@@ -57,7 +57,7 @@ module Mihari
57
57
  end
58
58
  end
59
59
 
60
- desc "securitytrails [IP|DOMAIN|EMAIL]", "SecurityTrails lookup by a given ip, domain or email"
60
+ desc "securitytrails [IP|DOMAIN|EMAIL]", "SecurityTrails lookup by an ip, domain or email"
61
61
  method_option :title, type: :string, desc: "title"
62
62
  method_option :description, type: :string, desc: "description"
63
63
  method_option :tags, type: :array, desc: "tags"
@@ -68,7 +68,7 @@ module Mihari
68
68
  end
69
69
  map "st" => :securitytrails
70
70
 
71
- desc "securitytrails_domain_feed [REGEXP]", "SecurityTrails new domain feed lookup by a given regexp"
71
+ desc "securitytrails_domain_feed [REGEXP]", "SecurityTrails new domain feed search by a regexp"
72
72
  method_option :title, type: :string, desc: "title"
73
73
  method_option :description, type: :string, desc: "description"
74
74
  method_option :tags, type: :array, desc: "tags"
@@ -80,7 +80,7 @@ module Mihari
80
80
  end
81
81
  map "st_domain_feed" => :securitytrails_domain_feed
82
82
 
83
- desc "crtsh [QUERY]", "crt.sh lookup by a given query"
83
+ desc "crtsh [QUERY]", "crt.sh search by a query"
84
84
  method_option :title, type: :string, desc: "title"
85
85
  method_option :description, type: :string, desc: "description"
86
86
  method_option :tags, type: :array, desc: "tags"
@@ -90,7 +90,7 @@ module Mihari
90
90
  end
91
91
  end
92
92
 
93
- desc "dnpedia [QUERY]", "DNPedia domain lookup by a given query"
93
+ desc "dnpedia [QUERY]", "DNPedia domain search by a query"
94
94
  method_option :title, type: :string, desc: "title"
95
95
  method_option :description, type: :string, desc: "description"
96
96
  method_option :tags, type: :array, desc: "tags"
@@ -100,7 +100,7 @@ module Mihari
100
100
  end
101
101
  end
102
102
 
103
- desc "circl [DOMAIN|SHA1]", "CIRCL passive DNS/SSL lookup by a given domain / SHA1 certificate fingerprint"
103
+ desc "circl [DOMAIN|SHA1]", "CIRCL passive DNS/SSL lookup by a domain / SHA1 certificate fingerprint"
104
104
  method_option :title, type: :string, desc: "title"
105
105
  method_option :description, type: :string, desc: "description"
106
106
  method_option :tags, type: :array, desc: "tags"
@@ -110,7 +110,7 @@ module Mihari
110
110
  end
111
111
  end
112
112
 
113
- desc "passivetotal [IP|DOMAIN|EMAIL|SHA1]", "PassiveTotal lookup by a given ip / domain / email / SHA1 certificate fingerprint"
113
+ desc "passivetotal [IP|DOMAIN|EMAIL|SHA1]", "PassiveTotal lookup by an ip / domain / email / SHA1 certificate fingerprint"
114
114
  method_option :title, type: :string, desc: "title"
115
115
  method_option :description, type: :string, desc: "description"
116
116
  method_option :tags, type: :array, desc: "tags"
@@ -120,7 +120,7 @@ module Mihari
120
120
  end
121
121
  end
122
122
 
123
- desc "zoomeye [QUERY]", "ZoomEye lookup by a given query"
123
+ desc "zoomeye [QUERY]", "ZoomEye search by a query"
124
124
  method_option :title, type: :string, desc: "title"
125
125
  method_option :description, type: :string, desc: "description"
126
126
  method_option :tags, type: :array, desc: "tags"
@@ -131,7 +131,7 @@ module Mihari
131
131
  end
132
132
  end
133
133
 
134
- desc "binaryedge [QUERY]", "BinaryEdge lookup by a given query"
134
+ desc "binaryedge [QUERY]", "BinaryEdge host search by a query"
135
135
  method_option :title, type: :string, desc: "title"
136
136
  method_option :description, type: :string, desc: "description"
137
137
  method_option :tags, type: :array, desc: "tags"
@@ -16,7 +16,7 @@ module Mihari
16
16
  end
17
17
 
18
18
  def run(**params)
19
- retry_on_timeout { emit(params) }
19
+ retry_on_error { emit(params) }
20
20
  end
21
21
 
22
22
  def emit(*)
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Mihari
4
4
  module Retriable
5
- def retry_on_timeout(times: 3, interval: 10)
5
+ def retry_on_error(times: 3, interval: 10)
6
6
  try = 0
7
7
  begin
8
8
  try += 1
9
9
  yield
10
- rescue Timeout::Error => _e
10
+ rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError, Timeout::Error => _e
11
11
  sleep interval
12
12
  retry if try < times
13
13
  raise
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "0.13.1"
4
+ VERSION = "0.13.2"
5
5
  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: 0.13.1
4
+ version: 0.13.2
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-10-28 00:00:00.000000000 Z
11
+ date: 2019-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler