rogue_one 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/rogue_one/detector.rb +11 -11
- data/lib/rogue_one/version.rb +1 -1
- data/rogue_one.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2be63346579c5afc83b8c8a8c04ffaa1a14c1469c2f5d8200c633dfd5b7512bc
|
4
|
+
data.tar.gz: f2bf7c83bfe4d19136b74a6994929b65a5cb3ef14296b516c3e52d1cc6d5c10f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23e2e93ef262b70634870673fc12eef1cd65cb7e908aff42d18201d46258026478800ad6e72c6c0e29b876054a2a0b9ede7eebd542cbed59b43b0f807c0a0c6f
|
7
|
+
data.tar.gz: bf4b3647dae1a1b198c321d71766774bdca758fb0d39c87a4ea6043159b29c68e9588cd142ae5e7c548b4b796657058f38340b3aae8a8df7e7600c665484cffc
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Rogue one: a rogue DNS detector
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rogue_one.svg)](https://badge.fury.io/rb/rogue_one)
|
3
4
|
[![Build Status](https://travis-ci.org/ninoseki/rogue_one.svg?branch=master)](https://travis-ci.org/ninoseki/rogue_one)
|
4
5
|
[![Coverage Status](https://coveralls.io/repos/github/ninoseki/rogue_one/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/rogue_one?branch=master)
|
5
6
|
|
data/lib/rogue_one/detector.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "yaml"
|
4
|
+
require "parallel"
|
4
5
|
|
5
6
|
module RogueOne
|
6
7
|
class Detector
|
@@ -10,16 +11,15 @@ module RogueOne
|
|
10
11
|
|
11
12
|
def initialize(target:)
|
12
13
|
@target = target
|
13
|
-
@memo =
|
14
|
+
@memo = {}
|
14
15
|
end
|
15
16
|
|
16
17
|
def report
|
17
|
-
|
18
|
+
@report ||= [].tap do |out|
|
19
|
+
inspect
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
landing_pages: landing_pages
|
22
|
-
}
|
21
|
+
out << { verdict: verdict, landing_pages: landing_pages }
|
22
|
+
end.first
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -39,14 +39,14 @@ module RogueOne
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def inspect
|
42
|
-
top_100_domains
|
42
|
+
results = Parallel.map(top_100_domains) do |domain|
|
43
43
|
normal_result = normal_resolver.dig(domain, "A")
|
44
44
|
target_result = target_resolver.dig(domain, "A")
|
45
45
|
|
46
|
-
if normal_result != target_result
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
target_result if target_result && normal_result != target_result
|
47
|
+
end.compact
|
48
|
+
|
49
|
+
@memo = results.group_by(&:itself).map { |k, v| [k, v.length] }.to_h
|
50
50
|
end
|
51
51
|
|
52
52
|
def top_100_domains
|
data/lib/rogue_one/version.rb
CHANGED
data/rogue_one.gemspec
CHANGED
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.1.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-04-
|
11
|
+
date: 2019-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.8'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: parallel
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.17'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.17'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: thor
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|