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 +4 -4
- data/README.md +2 -0
- data/lib/osakana.rb +1 -0
- data/lib/osakana/ayashige.rb +30 -0
- data/lib/osakana/cli.rb +5 -0
- data/lib/osakana/monitor.rb +6 -0
- data/lib/osakana/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a36b2afaaeb73fd437d075f95903bacf4e28ed927422a95cf87f7c98cb216f2
|
4
|
+
data.tar.gz: 52395094710b52e1dde84e68ce074b224d179e8446b7a01c81b2f04641926432
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/osakana.rb
CHANGED
@@ -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
|
data/lib/osakana/cli.rb
CHANGED
@@ -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
|
data/lib/osakana/monitor.rb
CHANGED
@@ -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
|
data/lib/osakana/version.rb
CHANGED
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.
|
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-
|
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
|