mihari 0.2.2 → 0.2.3

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: fca44bdfc7be51ca91f0daa4e7761b6f430e63c7eeb185b9a285180f38f9e688
4
- data.tar.gz: acb42896cad9c436b0ee2fefc4d086fa44f299574244ae373e79c93a1496bba6
3
+ metadata.gz: 7f889278f38a0195476bada5552aed27fc7b4525d18d09ea72d2c866cd88bce0
4
+ data.tar.gz: 0de84d6148ae7cfeb16cd624a87fb4a52c6ea1c1129f791a7bf65ac39b74ef84
5
5
  SHA512:
6
- metadata.gz: 05b97240bb7e59483e8d5ecb68cb77c27ee41deebd42d9c948b796d550e41362cca972b8cea152b16f1c3b546bb14e95c7a0a74b5d3b9f8bd2f1c29f941220d7
7
- data.tar.gz: 6e55ab64c2b43cd9efa20ee631b615ce834868461aef220fbba8bb1a873240a488b6e2f9ec88c29e4918ffcc1c286fbec47897a8e65948f81a12fe992de7cb0a
6
+ metadata.gz: 2ba40effb75947195ac0d52f5e7564977839f884c1e22fca155416a9f0a67d503c1aca8cbc5156cb620ebfa9c0ca53f06b454d0e3d03b929827c3569e23559a3
7
+ data.tar.gz: a5d99d000c47909f224696cf026091763ea064dc835596ae0f3f196bddd5c15513d98ce6dc8788ad0e6a3aa6516f7299058c6f725f228224564b4fb07645b586
@@ -9,11 +9,12 @@ module Mihari
9
9
  attr_reader :title
10
10
  attr_reader :description
11
11
  attr_reader :query
12
+ attr_reader :tags
12
13
 
13
14
  CENSYS_ID_KEY = "CENSYS_ID"
14
15
  CENSYS_SECRET_KEY = "CENSYS_SECRET"
15
16
 
16
- def initialize(query)
17
+ def initialize(query, tags: [])
17
18
  super()
18
19
 
19
20
  raise ArgumentError, "#{CENSYS_ID_KEY} and #{CENSYS_SECRET_KEY} are required" unless valid?
@@ -22,6 +23,7 @@ module Mihari
22
23
  @query = query
23
24
  @title = "Censys lookup"
24
25
  @description = "Query: #{query}"
26
+ @tags = tags
25
27
  end
26
28
 
27
29
  def artifacts
@@ -9,14 +9,16 @@ module Mihari
9
9
  attr_reader :title
10
10
  attr_reader :description
11
11
  attr_reader :query
12
+ attr_reader :tags
12
13
 
13
- def initialize(query)
14
+ def initialize(query, tags: [])
14
15
  super()
15
16
 
16
17
  @api = ::Onyphe::API.new
17
18
  @query = query
18
19
  @title = "Onyphe lookup"
19
20
  @description = "Query: #{query}"
21
+ @tags = tags
20
22
  end
21
23
 
22
24
  def artifacts
@@ -9,14 +9,16 @@ module Mihari
9
9
  attr_reader :title
10
10
  attr_reader :description
11
11
  attr_reader :query
12
+ attr_reader :tags
12
13
 
13
- def initialize(query)
14
+ def initialize(query, tags: [])
14
15
  super()
15
16
 
16
17
  @api = ::Shodan::API.new
17
18
  @query = query
18
19
  @title = "Shodan lookup"
19
20
  @description = "Query: #{query}"
21
+ @tags = tags
20
22
  end
21
23
 
22
24
  def artifacts
data/lib/mihari/cli.rb CHANGED
@@ -6,25 +6,31 @@ require "json"
6
6
  module Mihari
7
7
  class CLI < Thor
8
8
  desc "censys [QUERY]", "Censys IPv4 lookup by a given query"
9
+ method_option :tags, type: :array, default: [], desc: "tags"
9
10
  def censys(query)
11
+ tags = options.dig("tags") || []
10
12
  with_error_handling do
11
- censys = Analyzers::Censys.new(query)
13
+ censys = Analyzers::Censys.new(query, tags: tags)
12
14
  censys.run
13
15
  end
14
16
  end
15
17
 
16
18
  desc "shodan [QUERY]", "Shodan host lookup by a given query"
19
+ method_option :tags, type: :array, desc: "tags"
17
20
  def shodan(query)
21
+ tags = options.dig("tags") || []
18
22
  with_error_handling do
19
- shodan = Analyzers::Shodan.new(query)
23
+ shodan = Analyzers::Shodan.new(query, tags: tags)
20
24
  shodan.run
21
25
  end
22
26
  end
23
27
 
24
28
  desc "onyphe [QUERY]", "Onyphe datascan lookup by a given query"
29
+ method_option :tags, type: :array, default: [], desc: "tags"
25
30
  def onyphe(query)
31
+ tags = options.dig("tags") || []
26
32
  with_error_handling do
27
- onyphe = Analyzers::Onyphe.new(query)
33
+ onyphe = Analyzers::Onyphe.new(query, tags: tags)
28
34
  onyphe.run
29
35
  end
30
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
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.2.2
4
+ version: 0.2.3
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-09 00:00:00.000000000 Z
11
+ date: 2019-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler