rogue_one 0.1.3 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +48 -6
- data/images/eyecatch.png +0 -0
- data/lib/rogue_one.rb +3 -0
- data/lib/rogue_one/cli.rb +13 -2
- data/lib/rogue_one/data/alexa_100.yml +101 -0
- data/lib/rogue_one/data/fortune_100.yml +101 -0
- data/lib/rogue_one/detector.rb +110 -13
- data/lib/rogue_one/domain_list.rb +29 -0
- data/lib/rogue_one/ping.rb +33 -0
- data/lib/rogue_one/resolver.rb +10 -2
- data/lib/rogue_one/version.rb +1 -1
- data/rogue_one.gemspec +7 -7
- metadata +24 -20
- data/lib/rogue_one/data/top_100.yml +0 -101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a66b70adea810f6e952e08294a0323dc2be06c23d7ccbc28739045829696aae5
|
4
|
+
data.tar.gz: 5d41ff1fa13254071aecef1cbf70168d818a963207922be4d44f134d9bb42f0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08f2049c42ac79a9a0256ae2f99761748660fa3bd1981f680196540e4525db9b4e8dbba54264d35cc2b7b5773b96441886a0a7acb4900e1626cd42c34089304
|
7
|
+
data.tar.gz: a4cffb3b9d5c92f90ac267201417c459b334d38aa82a0631a43c7db15552bed00d11cc9f37291904f48bfad08c33f4bc7d051bf3946acf4c35fcdc9a7e927567
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,25 @@
|
|
1
|
-
# Rogue one
|
1
|
+
# Rogue one
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/rogue_one.svg)](https://badge.fury.io/rb/rogue_one)
|
4
|
-
[![Build Status](https://travis-ci.
|
4
|
+
[![Build Status](https://travis-ci.com/ninoseki/rogue_one.svg?branch=master)](https://travis-ci.com/ninoseki/rogue_one)
|
5
|
+
[![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/rogue_one/badge)](https://www.codefactor.io/repository/github/ninoseki/rogue_one)
|
5
6
|
[![Coverage Status](https://coveralls.io/repos/github/ninoseki/rogue_one/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/rogue_one?branch=master)
|
6
7
|
|
8
|
+
A PoC tool for analyzing a rogue DNS server.
|
9
|
+
|
10
|
+
This tool could be used for checking maliciousness of a DNS server and extracting landing pages.
|
11
|
+
|
12
|
+
## How it works
|
13
|
+
|
14
|
+
![image](./images/eyecatch.png)
|
15
|
+
|
16
|
+
IPv4 space is vast. But an attacker could secure a few numbers of IP addresses for landing pages.
|
17
|
+
It means you can (probably) find malicious landing pages by using the following methods.
|
18
|
+
|
19
|
+
- Resolving a bunch of domains by using a DNS server.
|
20
|
+
- Finding frequent IPv4s from the resolutions. They might be landing pages.
|
21
|
+
- If a DNS server has landing pages, it might be a rogue one.
|
22
|
+
|
7
23
|
## Installation
|
8
24
|
|
9
25
|
```bash
|
@@ -18,6 +34,21 @@ Commands:
|
|
18
34
|
rogue_one help [COMMAND] # Describe available commands or one specific command
|
19
35
|
rogue_one report [DNS_SERVER] # Show a report of a given DNS server
|
20
36
|
|
37
|
+
$ rogue_one help report
|
38
|
+
Usage:
|
39
|
+
rogue_one report [DNS_SERVER]
|
40
|
+
|
41
|
+
Options:
|
42
|
+
[--default-list=DEFAULT_LIST] # A default list of top 100 domains (Alexa or Fortune)
|
43
|
+
# Default: alexa
|
44
|
+
[--custom-list=CUSTOM_LIST] # A path to a custom list of domains
|
45
|
+
[--threshold=N] # Threshold value for determining malicious or not
|
46
|
+
[--verbose], [--no-verbose]
|
47
|
+
|
48
|
+
Show a report of a given DNS server
|
49
|
+
|
50
|
+
Show a report of a given DNS server
|
51
|
+
|
21
52
|
$ rogue_one report 1.1.1.1
|
22
53
|
{
|
23
54
|
"verdict": "benign one",
|
@@ -35,12 +66,23 @@ $ rogue_one report 1.53.252.215
|
|
35
66
|
"61.230.102.66"
|
36
67
|
]
|
37
68
|
}
|
69
|
+
|
70
|
+
$ rogue_one report 171.244.3.111 --custom-list tmp/roaming.yml
|
71
|
+
{
|
72
|
+
"verdict": "rogue one",
|
73
|
+
"landing_pages": [
|
74
|
+
"154.223.53.53",
|
75
|
+
"58.82.243.9"
|
76
|
+
]
|
77
|
+
}
|
78
|
+
# Note: a custom list should be an array of domains in YAML format.
|
38
79
|
```
|
39
80
|
|
40
|
-
| Key | Desc.
|
41
|
-
|
42
|
-
| verdict | A detection result (`rogue one` or `benign one`)
|
43
|
-
| landing_pages | An array of IP of landing pages
|
81
|
+
| Key | Desc. |
|
82
|
+
|---------------|--------------------------------------------------------------------------|
|
83
|
+
| verdict | A detection result (`rogue one` or `benign one`) |
|
84
|
+
| landing_pages | An array of IP of landing pages |
|
85
|
+
| results | DNS resolution results (only available if --verbose option is specified) |
|
44
86
|
|
45
87
|
## Notes
|
46
88
|
|
data/images/eyecatch.png
ADDED
Binary file
|
data/lib/rogue_one.rb
CHANGED
data/lib/rogue_one/cli.rb
CHANGED
@@ -6,9 +6,19 @@ require "json"
|
|
6
6
|
module RogueOne
|
7
7
|
class CLI < Thor
|
8
8
|
desc "report [DNS_SERVER]", "Show a report of a given DNS server"
|
9
|
+
method_option :default_list, type: :string, default: "alexa", desc: "A default list of top 100 domains (Alexa or Fortune)"
|
10
|
+
method_option :custom_list, type: :string, desc: "A path to a custom list of domains"
|
11
|
+
method_option :threshold, type: :numeric, desc: "Threshold value for determining malicious or not"
|
12
|
+
method_option :verbose, type: :boolean
|
9
13
|
def report(dns_server)
|
10
14
|
with_error_handling do
|
11
|
-
|
15
|
+
Ping.pong? dns_server
|
16
|
+
|
17
|
+
default_list = options["default_list"].downcase
|
18
|
+
custom_list = options["custom_list"]
|
19
|
+
threshold = options["threshold"]
|
20
|
+
verbose = options["verbose"]
|
21
|
+
detector = Detector.new(target: dns_server, default_list: default_list, custom_list: custom_list, threshold: threshold, verbose: verbose)
|
12
22
|
puts JSON.pretty_generate(detector.report)
|
13
23
|
end
|
14
24
|
end
|
@@ -17,7 +27,8 @@ module RogueOne
|
|
17
27
|
def with_error_handling
|
18
28
|
yield
|
19
29
|
rescue StandardError => e
|
20
|
-
|
30
|
+
message = { error: e.to_s }
|
31
|
+
puts JSON.pretty_generate(message)
|
21
32
|
end
|
22
33
|
end
|
23
34
|
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
---
|
2
|
+
- google.com
|
3
|
+
- youtube.com
|
4
|
+
- tmall.com
|
5
|
+
- baidu.com
|
6
|
+
- qq.com
|
7
|
+
- sohu.com
|
8
|
+
- facebook.com
|
9
|
+
- login.tmall.com
|
10
|
+
- wikipedia.org
|
11
|
+
- taobao.com
|
12
|
+
- yahoo.com
|
13
|
+
- jd.com
|
14
|
+
- 360.cn
|
15
|
+
- amazon.com
|
16
|
+
- sina.com.cn
|
17
|
+
- weibo.com
|
18
|
+
- pages.tmall.com
|
19
|
+
- reddit.com
|
20
|
+
- live.com
|
21
|
+
- vk.com
|
22
|
+
- okezone.com
|
23
|
+
- netflix.com
|
24
|
+
- blogspot.com
|
25
|
+
- office.com
|
26
|
+
- csdn.net
|
27
|
+
- alipay.com
|
28
|
+
- xinhuanet.com
|
29
|
+
- stackoverflow.com
|
30
|
+
- yahoo.co.jp
|
31
|
+
- instagram.com
|
32
|
+
- google.com.hk
|
33
|
+
- aliexpress.com
|
34
|
+
- microsoft.com
|
35
|
+
- babytree.com
|
36
|
+
- naver.com
|
37
|
+
- twitter.com
|
38
|
+
- bing.com
|
39
|
+
- livejasmin.com
|
40
|
+
- amazon.co.jp
|
41
|
+
- tribunnews.com
|
42
|
+
- ebay.com
|
43
|
+
- salesforce.com
|
44
|
+
- twitch.tv
|
45
|
+
- google.co.in
|
46
|
+
- force.com
|
47
|
+
- microsoftonline.com
|
48
|
+
- apple.com
|
49
|
+
- tianya.cn
|
50
|
+
- adobe.com
|
51
|
+
- pornhub.com
|
52
|
+
- msn.com
|
53
|
+
- zhanqi.tv
|
54
|
+
- dropbox.com
|
55
|
+
- linkedin.com
|
56
|
+
- yandex.ru
|
57
|
+
- wordpress.com
|
58
|
+
- myshopify.com
|
59
|
+
- amazon.in
|
60
|
+
- mail.ru
|
61
|
+
- panda.tv
|
62
|
+
- imdb.com
|
63
|
+
- caijing.com.cn
|
64
|
+
- china.com.cn
|
65
|
+
- mama.cn
|
66
|
+
- amazonaws.com
|
67
|
+
- google.com.br
|
68
|
+
- trello.com
|
69
|
+
- bongacams.com
|
70
|
+
- google.de
|
71
|
+
- medium.com
|
72
|
+
- google.co.jp
|
73
|
+
- soso.com
|
74
|
+
- booking.com
|
75
|
+
- w3schools.com
|
76
|
+
- amazon.co.uk
|
77
|
+
- spotify.com
|
78
|
+
- amazon.de
|
79
|
+
- rednet.cn
|
80
|
+
- bbc.com
|
81
|
+
- detail.tmall.com
|
82
|
+
- xvideos.com
|
83
|
+
- espn.com
|
84
|
+
- detik.com
|
85
|
+
- github.com
|
86
|
+
- cnn.com
|
87
|
+
- instructure.com
|
88
|
+
- ok.ru
|
89
|
+
- indeed.com
|
90
|
+
- yy.com
|
91
|
+
- tumblr.com
|
92
|
+
- huanqiu.com
|
93
|
+
- stackexchange.com
|
94
|
+
- nytimes.com
|
95
|
+
- imgur.com
|
96
|
+
- soundcloud.com
|
97
|
+
- whatsapp.com
|
98
|
+
- rakuten.co.jp
|
99
|
+
- nih.gov
|
100
|
+
- sogou.com
|
101
|
+
- google.cn
|
@@ -0,0 +1,101 @@
|
|
1
|
+
---
|
2
|
+
- walmart.com
|
3
|
+
- exxonmobil.com
|
4
|
+
- berkshirehathaway.com
|
5
|
+
- apple.com
|
6
|
+
- unitedhealthgroup.com
|
7
|
+
- mckesson.com
|
8
|
+
- cvshealth.com
|
9
|
+
- amazon.com
|
10
|
+
- att.com
|
11
|
+
- gm.com
|
12
|
+
- ford.com
|
13
|
+
- amerisourcebergen.com
|
14
|
+
- chevron.com
|
15
|
+
- cardinalhealth.com
|
16
|
+
- costco.com
|
17
|
+
- verizon.com
|
18
|
+
- kroger.com
|
19
|
+
- ge.com
|
20
|
+
- walgreensbootsalliance.com
|
21
|
+
- jpmorganchase.com
|
22
|
+
- fanniemae.com
|
23
|
+
- abc.xyz
|
24
|
+
- homedepot.com
|
25
|
+
- bankofamerica.com
|
26
|
+
- express-scripts.com
|
27
|
+
- wellsfargo.com
|
28
|
+
- boeing.com
|
29
|
+
- phillips66.com
|
30
|
+
- antheminc.com
|
31
|
+
- microsoft.com
|
32
|
+
- valero.com
|
33
|
+
- citigroup.com
|
34
|
+
- comcastcorporation.com
|
35
|
+
- ibm.com
|
36
|
+
- delltechnologies.com
|
37
|
+
- statefarm.com
|
38
|
+
- jnj.com
|
39
|
+
- freddiemac.com
|
40
|
+
- target.com
|
41
|
+
- lowes.com
|
42
|
+
- marathonpetroleum.com
|
43
|
+
- pg.com
|
44
|
+
- metlife.com
|
45
|
+
- ups.com
|
46
|
+
- pepsico.com
|
47
|
+
- intel.com
|
48
|
+
- dow-dupont.com
|
49
|
+
- adm.com
|
50
|
+
- aetna.com
|
51
|
+
- fedex.com
|
52
|
+
- utc.com
|
53
|
+
- prudential.com
|
54
|
+
- albertsons.com
|
55
|
+
- sysco.com
|
56
|
+
- disney.com
|
57
|
+
- humana.com
|
58
|
+
- pfizer.com
|
59
|
+
- hp.com
|
60
|
+
- lockheedmartin.com
|
61
|
+
- aig.com
|
62
|
+
- centene.com
|
63
|
+
- cisco.com
|
64
|
+
- hcahealthcare.com
|
65
|
+
- energytransfer.com
|
66
|
+
- caterpillar.com
|
67
|
+
- nationwide.com
|
68
|
+
- morganstanley.com
|
69
|
+
- libertymutual.com
|
70
|
+
- newyorklife.com
|
71
|
+
- gs.com
|
72
|
+
- aa.com
|
73
|
+
- bestbuy.com
|
74
|
+
- cigna.com
|
75
|
+
- charter.com
|
76
|
+
- delta.com
|
77
|
+
- facebook.com
|
78
|
+
- honeywell.com
|
79
|
+
- merck.com
|
80
|
+
- allstate.com
|
81
|
+
- tysonfoods.com
|
82
|
+
- united.com
|
83
|
+
- oracle.com
|
84
|
+
- techdata.com
|
85
|
+
- tiaa.org
|
86
|
+
- tjx.com
|
87
|
+
- americanexpress.com
|
88
|
+
- coca-colacompany.com
|
89
|
+
- publix.com
|
90
|
+
- nike.com
|
91
|
+
- andeavor.com
|
92
|
+
- wfscorp.com
|
93
|
+
- exeloncorp.com
|
94
|
+
- massmutual.com
|
95
|
+
- riteaid.com
|
96
|
+
- conocophillips.com
|
97
|
+
- chsinc.com
|
98
|
+
- 3m.com
|
99
|
+
- timewarner.com
|
100
|
+
- generaldynamics.com
|
101
|
+
- usaa.com
|
data/lib/rogue_one/detector.rb
CHANGED
@@ -1,23 +1,45 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "async"
|
4
|
+
require "async/barrier"
|
5
|
+
require "async/dns"
|
6
|
+
require "async/reactor"
|
7
|
+
require "async/semaphore"
|
8
|
+
require "resolv"
|
3
9
|
require "yaml"
|
4
|
-
require "
|
10
|
+
require "etc"
|
5
11
|
|
6
12
|
module RogueOne
|
7
13
|
class Detector
|
8
14
|
attr_reader :target
|
15
|
+
attr_reader :default_list
|
16
|
+
attr_reader :custom_list
|
17
|
+
attr_reader :verbose
|
18
|
+
attr_reader :max_concurrency
|
9
19
|
|
10
20
|
GOOGLE_PUBLIC_DNS = "8.8.8.8"
|
11
21
|
|
12
|
-
def initialize(target:)
|
22
|
+
def initialize(target:, default_list: "alexa", custom_list: nil, threshold: nil, verbose: false)
|
13
23
|
@target = target
|
24
|
+
@default_list = default_list
|
25
|
+
@custom_list = custom_list
|
26
|
+
@threshold = threshold
|
27
|
+
@verbose = verbose
|
28
|
+
|
29
|
+
@max_concurrency = Etc.nprocessors * 2
|
14
30
|
@memo = {}
|
31
|
+
@verbose_memo = nil
|
15
32
|
end
|
16
33
|
|
17
34
|
def report
|
18
35
|
inspect
|
19
36
|
|
20
|
-
{
|
37
|
+
{
|
38
|
+
verdict: verdict,
|
39
|
+
landing_pages: landing_pages,
|
40
|
+
results: results,
|
41
|
+
meta: meta
|
42
|
+
}.compact
|
21
43
|
end
|
22
44
|
|
23
45
|
private
|
@@ -30,35 +52,110 @@ module RogueOne
|
|
30
52
|
!landing_pages.empty?
|
31
53
|
end
|
32
54
|
|
55
|
+
def threshold
|
56
|
+
@threshold ||= (domains.length.to_f / 10.0).ceil
|
57
|
+
end
|
58
|
+
|
59
|
+
def meta
|
60
|
+
return nil unless verbose
|
61
|
+
|
62
|
+
{ threshold: threshold }
|
63
|
+
end
|
64
|
+
|
33
65
|
def landing_pages
|
34
66
|
@memo.map do |ip, count|
|
35
|
-
count >
|
67
|
+
count > threshold ? ip : nil
|
36
68
|
end.compact.sort
|
37
69
|
end
|
38
70
|
|
71
|
+
def results
|
72
|
+
return nil unless verbose
|
73
|
+
|
74
|
+
{
|
75
|
+
resolutions: resolutions,
|
76
|
+
occurrences: occurrences
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
def resolutions
|
81
|
+
(@verbose_memo || {}).sort_by { |_, v| v }.to_h
|
82
|
+
end
|
83
|
+
|
84
|
+
def occurrences
|
85
|
+
@memo.sort_by{ |_, v| -v }.to_h
|
86
|
+
end
|
87
|
+
|
39
88
|
def inspect
|
40
89
|
return unless @memo.empty?
|
41
90
|
|
42
|
-
|
43
|
-
|
44
|
-
|
91
|
+
# read domains outside of the async blocks
|
92
|
+
domains
|
93
|
+
|
94
|
+
normal = bulk_resolve(normal_resolver, domains)
|
95
|
+
resolutions = bulk_resolve(target_resolver, domains)
|
96
|
+
|
97
|
+
results = resolutions.map do |domain, addresses|
|
98
|
+
normal_addresses = normal.dig(domain) || []
|
99
|
+
address = (addresses || []).first
|
100
|
+
[domain, address] if address && !normal_addresses.include?(address)
|
101
|
+
end.compact.to_h
|
45
102
|
|
46
|
-
|
47
|
-
|
103
|
+
@memo = results.values.group_by(&:itself).map { |k, v| [k, v.length] }.to_h
|
104
|
+
@verbose_memo = results if verbose
|
105
|
+
end
|
106
|
+
|
107
|
+
def domains
|
108
|
+
@domains ||= custom_list ? custom_domains : top_100_domains
|
109
|
+
end
|
48
110
|
|
49
|
-
|
111
|
+
def custom_domains
|
112
|
+
read_domains custom_list
|
50
113
|
end
|
51
114
|
|
52
115
|
def top_100_domains
|
53
|
-
|
116
|
+
case default_list
|
117
|
+
when "alexa"
|
118
|
+
read_domains File.expand_path("./data/alexa_100.yml", __dir__)
|
119
|
+
when "fortune"
|
120
|
+
read_domains File.expand_path("./data/fortune_100.yml", __dir__)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def read_domains(path)
|
125
|
+
list = DomainList.new(path)
|
126
|
+
return list.domains if list.valid?
|
127
|
+
|
128
|
+
raise ArgumentError, "Inputted an invalid list. #{path} is not eixst." unless list.exists?
|
129
|
+
raise ArgumentError, "Inputted an invalid list. Please input a list as an YAML file." unless list.valid_format?
|
130
|
+
end
|
131
|
+
|
132
|
+
def bulk_resolve(resolver, domains)
|
133
|
+
results = []
|
134
|
+
Async do
|
135
|
+
barrier = Async::Barrier.new
|
136
|
+
semaphore = Async::Semaphore.new(max_concurrency, parent: barrier)
|
137
|
+
|
138
|
+
domains.each do |domain|
|
139
|
+
semaphore.async do
|
140
|
+
addresses = []
|
141
|
+
begin
|
142
|
+
addresses = resolver.addresses_for(domain, Resolv::DNS::Resource::IN::A, { retries: 1 }).map(&:to_s)
|
143
|
+
rescue Async::DNS::ResolutionFailure
|
144
|
+
# do nothing
|
145
|
+
end
|
146
|
+
results << [domain, addresses]
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
results.to_h
|
54
151
|
end
|
55
152
|
|
56
153
|
def normal_resolver
|
57
|
-
|
154
|
+
Async::DNS::Resolver.new([[:udp, GOOGLE_PUBLIC_DNS, 53], [:tcp, GOOGLE_PUBLIC_DNS, 53]])
|
58
155
|
end
|
59
156
|
|
60
157
|
def target_resolver
|
61
|
-
|
158
|
+
Async::DNS::Resolver.new([[:udp, target, 53], [:tcp, target, 53]])
|
62
159
|
end
|
63
160
|
end
|
64
161
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaml"
|
4
|
+
|
5
|
+
module RogueOne
|
6
|
+
class DomainList
|
7
|
+
attr_reader :path
|
8
|
+
|
9
|
+
def initialize(path)
|
10
|
+
@path = path.to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
def valid?
|
14
|
+
exists? && valid_format?
|
15
|
+
end
|
16
|
+
|
17
|
+
def domains
|
18
|
+
@domains ||= exists? ? YAML.safe_load(File.read(path)) : nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def exists?
|
22
|
+
File.exist?(path)
|
23
|
+
end
|
24
|
+
|
25
|
+
def valid_format?
|
26
|
+
domains.is_a? Array
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "resolv"
|
4
|
+
|
5
|
+
module RogueOne
|
6
|
+
class Ping
|
7
|
+
attr_reader :resolver
|
8
|
+
attr_reader :nameserver
|
9
|
+
|
10
|
+
def initialize(nameserver)
|
11
|
+
@nameserver = nameserver
|
12
|
+
@resolver = Resolv::DNS.new(nameserver: [nameserver])
|
13
|
+
@resolver.timeouts = 5
|
14
|
+
end
|
15
|
+
|
16
|
+
def get_a_record
|
17
|
+
resolver.getresource("example.com", Resolv::DNS::Resource::IN::A)
|
18
|
+
rescue Resolv::ResolvError => _e
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
22
|
+
def pong?
|
23
|
+
result = get_a_record
|
24
|
+
raise Error, "DNS resolve error: there is no resopnse from #{nameserver}" unless result
|
25
|
+
|
26
|
+
true
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.pong?(target)
|
30
|
+
new(target).pong?
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/rogue_one/resolver.rb
CHANGED
@@ -10,9 +10,15 @@ module RogueOne
|
|
10
10
|
@nameserver = nameserver
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def get_resource(domain, type)
|
14
14
|
_resolver.getresource(domain, resource_by_type(type)).address.to_s
|
15
|
-
rescue Resolv::ResolvError =>
|
15
|
+
rescue Resolv::ResolvError => _e
|
16
|
+
nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_resources(domain, type)
|
20
|
+
_resolver.getresources(domain, resource_by_type(type)).map { |r| r.address.to_s }
|
21
|
+
rescue Resolv::ResolvError => _e
|
16
22
|
nil
|
17
23
|
end
|
18
24
|
|
@@ -20,6 +26,8 @@ module RogueOne
|
|
20
26
|
|
21
27
|
def _resolver
|
22
28
|
@_resolver ||= Resolv::DNS.new(nameserver: [nameserver])
|
29
|
+
@_resolver.timeouts = 5
|
30
|
+
@_resolver
|
23
31
|
end
|
24
32
|
|
25
33
|
def resource_by_type(type)
|
data/lib/rogue_one/version.rb
CHANGED
data/rogue_one.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ["Manabu Niseki"]
|
11
11
|
spec.email = ["manabu.niseki@gmail.com"]
|
12
12
|
|
13
|
-
spec.summary = "
|
14
|
-
spec.description =
|
13
|
+
spec.summary = "A rogue DNS detector"
|
14
|
+
spec.description = "A rogue DNS detector"
|
15
15
|
spec.homepage = "https://github.com/ninoseki/rogue_one"
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
@@ -24,11 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 2.
|
27
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
28
28
|
spec.add_development_dependency "coveralls", "~> 0.8"
|
29
|
-
spec.add_development_dependency "rake", "~>
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.9"
|
31
31
|
|
32
|
-
spec.add_dependency "
|
33
|
-
spec.add_dependency "thor", "~> 0
|
32
|
+
spec.add_dependency "async-dns", "~> 1.2"
|
33
|
+
spec.add_dependency "thor", "~> 1.0"
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rogue_one
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: coveralls
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,57 +44,57 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.9'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.9'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: async-dns
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
75
|
+
version: '1.2'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: thor
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
89
|
+
version: '1.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0
|
97
|
-
description:
|
96
|
+
version: '1.0'
|
97
|
+
description: A rogue DNS detector
|
98
98
|
email:
|
99
99
|
- manabu.niseki@gmail.com
|
100
100
|
executables:
|
@@ -112,10 +112,14 @@ files:
|
|
112
112
|
- bin/console
|
113
113
|
- bin/setup
|
114
114
|
- exe/rogue_one
|
115
|
+
- images/eyecatch.png
|
115
116
|
- lib/rogue_one.rb
|
116
117
|
- lib/rogue_one/cli.rb
|
117
|
-
- lib/rogue_one/data/
|
118
|
+
- lib/rogue_one/data/alexa_100.yml
|
119
|
+
- lib/rogue_one/data/fortune_100.yml
|
118
120
|
- lib/rogue_one/detector.rb
|
121
|
+
- lib/rogue_one/domain_list.rb
|
122
|
+
- lib/rogue_one/ping.rb
|
119
123
|
- lib/rogue_one/resolver.rb
|
120
124
|
- lib/rogue_one/version.rb
|
121
125
|
- rogue_one.gemspec
|
@@ -123,7 +127,7 @@ homepage: https://github.com/ninoseki/rogue_one
|
|
123
127
|
licenses:
|
124
128
|
- MIT
|
125
129
|
metadata: {}
|
126
|
-
post_install_message:
|
130
|
+
post_install_message:
|
127
131
|
rdoc_options: []
|
128
132
|
require_paths:
|
129
133
|
- lib
|
@@ -138,8 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
142
|
- !ruby/object:Gem::Version
|
139
143
|
version: '0'
|
140
144
|
requirements: []
|
141
|
-
rubygems_version: 3.
|
142
|
-
signing_key:
|
145
|
+
rubygems_version: 3.1.2
|
146
|
+
signing_key:
|
143
147
|
specification_version: 4
|
144
|
-
summary:
|
148
|
+
summary: A rogue DNS detector
|
145
149
|
test_files: []
|
@@ -1,101 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- google.com
|
3
|
-
- facebook.com
|
4
|
-
- youtube.com
|
5
|
-
- yahoo.com
|
6
|
-
- baidu.com
|
7
|
-
- wikipedia.org
|
8
|
-
- qq.com
|
9
|
-
- taobao.com
|
10
|
-
- twitter.com
|
11
|
-
- amazon.com
|
12
|
-
- linkedin.com
|
13
|
-
- live.com
|
14
|
-
- google.co.in
|
15
|
-
- sina.com.cn
|
16
|
-
- hao123.com
|
17
|
-
- blogspot.com
|
18
|
-
- weibo.com
|
19
|
-
- tmall.com
|
20
|
-
- vk.com
|
21
|
-
- wordpress.com
|
22
|
-
- yahoo.co.jp
|
23
|
-
- sohu.com
|
24
|
-
- yandex.ru
|
25
|
-
- ebay.com
|
26
|
-
- google.de
|
27
|
-
- bing.com
|
28
|
-
- pinterest.com
|
29
|
-
- google.co.uk
|
30
|
-
- 163.com
|
31
|
-
- 360.cn
|
32
|
-
- google.fr
|
33
|
-
- ask.com
|
34
|
-
- instagram.com
|
35
|
-
- google.co.jp
|
36
|
-
- tumblr.com
|
37
|
-
- msn.com
|
38
|
-
- google.com.br
|
39
|
-
- mail.ru
|
40
|
-
- microsoft.com
|
41
|
-
- xvideos.com
|
42
|
-
- paypal.com
|
43
|
-
- google.ru
|
44
|
-
- soso.com
|
45
|
-
- adcash.com
|
46
|
-
- google.es
|
47
|
-
- google.it
|
48
|
-
- imdb.com
|
49
|
-
- apple.com
|
50
|
-
- imgur.com
|
51
|
-
- neobux.com
|
52
|
-
- craigslist.org
|
53
|
-
- amazon.co.jp
|
54
|
-
- t.co
|
55
|
-
- xhamster.com
|
56
|
-
- stackoverflow.com
|
57
|
-
- reddit.com
|
58
|
-
- google.com.mx
|
59
|
-
- google.com.hk
|
60
|
-
- cnn.com
|
61
|
-
- google.ca
|
62
|
-
- fc2.com
|
63
|
-
- go.com
|
64
|
-
- ifeng.com
|
65
|
-
- bbc.co.uk
|
66
|
-
- vube.com
|
67
|
-
- people.com.cn
|
68
|
-
- blogger.com
|
69
|
-
- aliexpress.com
|
70
|
-
- odnoklassniki.ru
|
71
|
-
- wordpress.org
|
72
|
-
- alibaba.com
|
73
|
-
- gmw.cn
|
74
|
-
- adobe.com
|
75
|
-
- huffingtonpost.com
|
76
|
-
- google.com.tr
|
77
|
-
- xinhuanet.com
|
78
|
-
- googleusercontent.com
|
79
|
-
- youku.com
|
80
|
-
- godaddy.com
|
81
|
-
- pornhub.com
|
82
|
-
- akamaihd.net
|
83
|
-
- thepiratebay.se
|
84
|
-
- kickass.to
|
85
|
-
- google.com.au
|
86
|
-
- amazon.de
|
87
|
-
- clkmon.com
|
88
|
-
- ebay.de
|
89
|
-
- alipay.com
|
90
|
-
- google.pl
|
91
|
-
- espn.go.com
|
92
|
-
- dailymotion.com
|
93
|
-
- about.com
|
94
|
-
- bp.blogspot.com
|
95
|
-
- blogspot.in
|
96
|
-
- netflix.com
|
97
|
-
- vimeo.com
|
98
|
-
- dailymail.co.uk
|
99
|
-
- redtube.com
|
100
|
-
- rakuten.co.jp
|
101
|
-
- conduit.com
|