osakana 0.1.1 → 0.2.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: 303bb2d4c36f7b3ebb54d28cf028a4ce4bdd009b11e97e33b1f062647bf88f9c
4
- data.tar.gz: cc6aab40337c4b4e9387aaf485f347e3cce8c90f37940eed21ba5033f6247068
3
+ metadata.gz: 4a36b2afaaeb73fd437d075f95903bacf4e28ed927422a95cf87f7c98cb216f2
4
+ data.tar.gz: 52395094710b52e1dde84e68ce074b224d179e8446b7a01c81b2f04641926432
5
5
  SHA512:
6
- metadata.gz: 1d07344dc2e5d7360e5e3f3232c9be654b0a08c8bc272e3a87f02f79a4d6b46b5d1e2930a87c3977916815fd71ed7cb5862f78ac9bf7d4004855369900af07cf
7
- data.tar.gz: f6088f5e39d04d8a5e308751f2a56b81108e1eead76cb8fec07e1ff456c6188ea5befc94b0d8d8573a812afe442a4535ffc6ba2e46bca0d3847a55492f2e0ce9
6
+ metadata.gz: 265bf8082b7a6c47d892b010632c607099e90fa6388969a958ac9163b74aa5c7ddfdf68aeb809b4533036aa496899cb9a742a5f49bc69bcd39ac3340f1359481
7
+ data.tar.gz: 2ac1a0f3fb6dcd958fe0d92f758e43503f946bd305aed8e81d1f290ebabaeaf449867704d2c1a3a237237cc701d178de20a9c987c70a2fc0041fc5451b4af356
data/README.md CHANGED
@@ -8,6 +8,7 @@ Osakana is a Swiss army knife tool for my phishing research.
8
8
 
9
9
  ## Features
10
10
 
11
+ - [Ayashige](https://github.com/ninoseki/ayashige) lookup
11
12
  - Censys lookup
12
13
  - Check newly registered domains on DNPedia by keyword
13
14
  - Slack integration
@@ -27,6 +28,7 @@ gem install osakana
27
28
  ```shell
28
29
  $ osakana
29
30
  Commands:
31
+ osakana ayashige_lookup [KEYWORD] # lookup on Ayashige by a given keyword
30
32
  osakana censys_lookup [QUERY] # lookup on Censys by a given query
31
33
  osakana check_newly_domains [KEYWORD] # check newly registered domains on DNPedia by a given keyword
32
34
  osakana help [COMMAND] # Describe available commands or one specific command
@@ -4,6 +4,7 @@ require "osakana/version"
4
4
 
5
5
  require "osakana/website"
6
6
 
7
+ require "osakana/ayashige"
7
8
  require "osakana/censys"
8
9
  require "osakana/dnpedia"
9
10
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "http"
4
+ require "json"
5
+
6
+ module Osakana
7
+ class Ayashige
8
+ BASE_URL = "https://ayashige.herokuapp.com/feed"
9
+
10
+ def lookup(keyword)
11
+ res = HTTP.get(BASE_URL)
12
+ return [] unless res.code == 200
13
+
14
+ websites = []
15
+ json = JSON.parse(res.body.to_s)
16
+ json.each do |item|
17
+ domain = item.dig("domain") || ""
18
+ updated_on = item.dig("updated_on") || ""
19
+ next unless domain.include?(keyword)
20
+
21
+ websites << Website.new(domain: domain, date: updated_on)
22
+ end
23
+ websites
24
+ end
25
+
26
+ def self.lookup(keyword)
27
+ new.lookup(keyword)
28
+ end
29
+ end
30
+ end
@@ -14,6 +14,11 @@ module Osakana
14
14
  Monitor.censys_lookup(query)
15
15
  end
16
16
 
17
+ desc "ayashige_lookup [KEYWORD]", "lookup on Ayashige by a given keyword"
18
+ def ayashige_lookup(keyword)
19
+ Monitor.ayashige_lookup(keyword)
20
+ end
21
+
17
22
  no_commands do
18
23
  def with_error_handling
19
24
  yield
@@ -13,5 +13,11 @@ module Osakana
13
13
  attachements = websites.map(&:to_attachement)
14
14
  Notifier.notify("Censys query: #{query}", attachements)
15
15
  end
16
+
17
+ def self.ayashige_lookup(keyword)
18
+ websites = Ayashige.lookup(keyword)
19
+ attachements = websites.map(&:to_attachement)
20
+ Notifier.notify("Ayashige keyword: #{keyword}", attachements)
21
+ end
16
22
  end
17
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Osakana
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osakana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.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: 2019-02-21 00:00:00.000000000 Z
11
+ date: 2019-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -183,6 +183,7 @@ files:
183
183
  - bin/setup
184
184
  - exe/osakana
185
185
  - lib/osakana.rb
186
+ - lib/osakana/ayashige.rb
186
187
  - lib/osakana/censys.rb
187
188
  - lib/osakana/cli.rb
188
189
  - lib/osakana/dnpedia.rb