passivedns-client 2.1.7 → 2.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +34 -49
- data/Rakefile +0 -0
- data/lib/passivedns/client.rb +6 -0
- data/lib/passivedns/client/cli.rb +14 -11
- data/lib/passivedns/client/provider/circl.rb +22 -6
- data/lib/passivedns/client/provider/dnsdb.rb +3 -2
- data/lib/passivedns/client/provider/passivetotal.rb +8 -3
- data/lib/passivedns/client/provider/riskiq.rb +22 -6
- data/lib/passivedns/client/provider/virustotal.rb +17 -3
- data/lib/passivedns/client/state.rb +2 -1
- data/lib/passivedns/client/version.rb +1 -1
- data/passivedns-client.gemspec +6 -6
- data/test/test_cli.rb +57 -43
- data/test/test_passivedns-client.rb +73 -166
- metadata +23 -28
- data/lib/passivedns/client/provider/bfk.rb +0 -107
- data/lib/passivedns/client/provider/cn360.rb +0 -111
- data/lib/passivedns/client/provider/mnemonic.rb +0 -111
- data/lib/passivedns/client/provider/tcpiputils.rb +0 -128
@@ -205,11 +205,12 @@ module PassiveDNS # :nodoc:
|
|
205
205
|
# creates an SQLite3-based Passive DNS Client state
|
206
206
|
# only argument is the filename of the sqlite3 database
|
207
207
|
def initialize(sqlitedb=nil)
|
208
|
+
@debug = false
|
208
209
|
puts "PDNSToolState initialize #{sqlitedb}" if @debug
|
209
210
|
@level = 0
|
210
211
|
@sqlitedb = sqlitedb
|
211
212
|
raise "Cannot use this class without a database file" unless @sqlitedb
|
212
|
-
unless File.
|
213
|
+
unless File.exist?(@sqlitedb)
|
213
214
|
newdb = true
|
214
215
|
end
|
215
216
|
@sqlitedbh = SQLite3::Database.new(@sqlitedb)
|
data/passivedns-client.gemspec
CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency 'json'
|
22
|
-
spec.add_runtime_dependency 'sqlite3'
|
23
|
-
spec.add_runtime_dependency 'structformatter'
|
24
|
-
spec.add_runtime_dependency 'configparser'
|
25
|
-
spec.add_development_dependency "minitest"
|
26
|
-
spec.add_development_dependency "bundler"
|
21
|
+
spec.add_runtime_dependency 'json'
|
22
|
+
spec.add_runtime_dependency 'sqlite3'
|
23
|
+
spec.add_runtime_dependency 'structformatter'
|
24
|
+
spec.add_runtime_dependency 'configparser'
|
25
|
+
spec.add_development_dependency "minitest"
|
26
|
+
spec.add_development_dependency "bundler"
|
27
27
|
spec.add_development_dependency "rake"
|
28
28
|
|
29
29
|
#spec.signing_key = "#{File.dirname(__FILE__)}/../gem-private_key.pem"
|
data/test/test_cli.rb
CHANGED
@@ -13,26 +13,22 @@ require_relative '../lib/passivedns/client/cli.rb'
|
|
13
13
|
class TestCLI < Minitest::Test
|
14
14
|
def test_letter_map
|
15
15
|
letter_map = PassiveDNS::CLI.get_letter_map
|
16
|
-
assert_equal("
|
16
|
+
assert_equal("cdprv", letter_map.keys.sort.join(""))
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_help_text
|
20
20
|
helptext = PassiveDNS::CLI.run(["--help"])
|
21
21
|
helptext.gsub!(/Usage: .*?\[/, "Usage: [")
|
22
22
|
assert_equal(
|
23
|
-
"Usage: [-d [
|
23
|
+
"Usage: [-d [cdprv]] [-g|-v|-m|-c|-x|-y|-j|-t] [-os <sep>] [-f <file>] [-r#|-w#|-v] [-l <count>] [--config <file>] <ip|domain|cidr>
|
24
24
|
Passive DNS Providers
|
25
|
-
-
|
26
|
-
-d3 use 360.cn
|
27
|
-
-db use BFK.de
|
25
|
+
-dcdprv uses all of the available passive dns database
|
28
26
|
-dc use CIRCL
|
29
27
|
-dd use DNSDB
|
30
|
-
-dm use Mnemonic
|
31
28
|
-dp use PassiveTotal
|
32
29
|
-dr use RiskIQ
|
33
|
-
-dt use TCPIPUtils
|
34
30
|
-dv use VirusTotal
|
35
|
-
-
|
31
|
+
-dvr uses VirusTotal and RiskIQ (for example)
|
36
32
|
|
37
33
|
Output Formatting
|
38
34
|
-g link-nodal GDF visualization definition
|
@@ -51,6 +47,9 @@ State and Recursion
|
|
51
47
|
-w# specifies the amount of time to wait, in seconds, between queries (Default: 0)
|
52
48
|
-l <count> limits the number of records returned per passive dns database queried.
|
53
49
|
|
50
|
+
Specifying a Configuration File
|
51
|
+
--config <file> specifies a config file. default: #{ENV['HOME']}/.passivedns-client
|
52
|
+
|
54
53
|
Getting Help
|
55
54
|
-h hello there. This option produces this helpful help information on how to access help.
|
56
55
|
-v debugging information
|
@@ -59,7 +58,7 @@ Getting Help
|
|
59
58
|
|
60
59
|
def test_provider_parsing
|
61
60
|
options_target = {
|
62
|
-
:pdnsdbs => ["
|
61
|
+
:pdnsdbs => ["virustotal"],
|
63
62
|
:format => "text",
|
64
63
|
:sep => "\t",
|
65
64
|
:recursedepth => 1,
|
@@ -68,30 +67,21 @@ Getting Help
|
|
68
67
|
:debug => false,
|
69
68
|
:sqlitedb => nil,
|
70
69
|
:limit => nil,
|
71
|
-
:help => false
|
70
|
+
:help => false,
|
71
|
+
:configfile => "#{ENV['HOME']}/.passivedns-client"
|
72
72
|
}
|
73
73
|
|
74
74
|
options, items = PassiveDNS::CLI.parse_command_line([])
|
75
75
|
assert_equal(options_target, options)
|
76
76
|
assert_equal([], items)
|
77
|
-
|
78
|
-
options_target[:pdnsdbs] = ["
|
79
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
80
|
-
assert_equal(options_target, options)
|
81
|
-
assert_equal([], items)
|
82
|
-
|
83
|
-
options_target[:pdnsdbs] = ["bfk"]
|
84
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-db"])
|
85
|
-
assert_equal(options_target, options)
|
86
|
-
assert_equal([], items)
|
87
|
-
|
88
|
-
options_target[:pdnsdbs] = ["circl", "dnsdb", "mnemonic", "riskiq"]
|
89
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-dcdmr"])
|
77
|
+
|
78
|
+
options_target[:pdnsdbs] = ["circl", "dnsdb", "riskiq"]
|
79
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dcdr"])
|
90
80
|
assert_equal(options_target, options)
|
91
81
|
assert_equal([], items)
|
92
82
|
|
93
|
-
options_target[:pdnsdbs] = ["passivetotal", "
|
94
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
83
|
+
options_target[:pdnsdbs] = ["passivetotal", "virustotal"]
|
84
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv"])
|
95
85
|
assert_equal(options_target, options)
|
96
86
|
assert_equal([], items)
|
97
87
|
|
@@ -99,7 +89,7 @@ Getting Help
|
|
99
89
|
|
100
90
|
def test_output_parsing
|
101
91
|
options_target = {
|
102
|
-
:pdnsdbs => ["passivetotal", "
|
92
|
+
:pdnsdbs => ["passivetotal", "virustotal"],
|
103
93
|
:format => "text",
|
104
94
|
:sep => "\t",
|
105
95
|
:recursedepth => 1,
|
@@ -108,52 +98,53 @@ Getting Help
|
|
108
98
|
:debug => false,
|
109
99
|
:sqlitedb => nil,
|
110
100
|
:limit => nil,
|
111
|
-
:help => false
|
101
|
+
:help => false,
|
102
|
+
:configfile => "#{ENV['HOME']}/.passivedns-client"
|
112
103
|
}
|
113
104
|
|
114
105
|
options_target[:sep] = ","
|
115
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
106
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-c", "8.8.8.8"])
|
116
107
|
assert_equal(options_target, options)
|
117
108
|
assert_equal(["8.8.8.8"], items)
|
118
109
|
|
119
110
|
options_target[:sep] = "|"
|
120
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
111
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-s", "|", "8.8.8.8"])
|
121
112
|
assert_equal(options_target, options)
|
122
113
|
assert_equal(["8.8.8.8"], items)
|
123
114
|
|
124
115
|
options_target[:sep] = "\t"
|
125
116
|
|
126
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
117
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-t", "8.8.8.8"])
|
127
118
|
assert_equal(options_target, options)
|
128
119
|
assert_equal(["8.8.8.8"], items)
|
129
120
|
|
130
121
|
options_target[:format] = "json"
|
131
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
122
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-j", "8.8.8.8"])
|
132
123
|
assert_equal(options_target, options)
|
133
124
|
assert_equal(["8.8.8.8"], items)
|
134
125
|
|
135
126
|
options_target[:format] = "xml"
|
136
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
127
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-x", "8.8.8.8"])
|
137
128
|
assert_equal(options_target, options)
|
138
129
|
assert_equal(["8.8.8.8"], items)
|
139
130
|
|
140
131
|
options_target[:format] = "yaml"
|
141
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
132
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-y", "8.8.8.8"])
|
142
133
|
assert_equal(options_target, options)
|
143
134
|
assert_equal(["8.8.8.8"], items)
|
144
135
|
|
145
136
|
options_target[:format] = "gdf"
|
146
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
137
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-g", "8.8.8.8"])
|
147
138
|
assert_equal(options_target, options)
|
148
139
|
assert_equal(["8.8.8.8"], items)
|
149
140
|
|
150
141
|
options_target[:format] = "graphviz"
|
151
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
142
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-z", "8.8.8.8"])
|
152
143
|
assert_equal(options_target, options)
|
153
144
|
assert_equal(["8.8.8.8"], items)
|
154
145
|
|
155
146
|
options_target[:format] = "graphml"
|
156
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
147
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-m", "8.8.8.8"])
|
157
148
|
assert_equal(options_target, options)
|
158
149
|
assert_equal(["8.8.8.8"], items)
|
159
150
|
|
@@ -162,7 +153,7 @@ Getting Help
|
|
162
153
|
|
163
154
|
def test_help_debug_parsing
|
164
155
|
options_target = {
|
165
|
-
:pdnsdbs => ["passivetotal", "
|
156
|
+
:pdnsdbs => ["passivetotal", "virustotal"],
|
166
157
|
:format => "text",
|
167
158
|
:sep => "\t",
|
168
159
|
:recursedepth => 1,
|
@@ -171,22 +162,23 @@ Getting Help
|
|
171
162
|
:debug => false,
|
172
163
|
:sqlitedb => nil,
|
173
164
|
:limit => nil,
|
174
|
-
:help => true
|
165
|
+
:help => true,
|
166
|
+
:configfile => "#{ENV['HOME']}/.passivedns-client"
|
175
167
|
}
|
176
168
|
|
177
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
169
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-h", "8.8.8.8"])
|
178
170
|
assert_equal(options_target, options)
|
179
171
|
assert_equal(["8.8.8.8"], items)
|
180
172
|
|
181
173
|
options_target[:debug] = true
|
182
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
174
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-h", "-v", "8.8.8.8"])
|
183
175
|
assert_equal(options_target, options)
|
184
176
|
assert_equal(["8.8.8.8"], items)
|
185
177
|
end
|
186
178
|
|
187
179
|
def test_state_recursion_parsing
|
188
180
|
options_target = {
|
189
|
-
:pdnsdbs => ["passivetotal", "
|
181
|
+
:pdnsdbs => ["passivetotal", "virustotal"],
|
190
182
|
:format => "text",
|
191
183
|
:sep => "\t",
|
192
184
|
:recursedepth => 5,
|
@@ -195,11 +187,33 @@ Getting Help
|
|
195
187
|
:debug => false,
|
196
188
|
:sqlitedb => "test.db",
|
197
189
|
:limit => 10,
|
198
|
-
:help => false
|
190
|
+
:help => false,
|
191
|
+
:configfile => "#{ENV['HOME']}/.passivedns-client"
|
199
192
|
}
|
200
193
|
|
201
|
-
options, items = PassiveDNS::CLI.parse_command_line(["-
|
194
|
+
options, items = PassiveDNS::CLI.parse_command_line(["-dpv", "-f", "test.db", "-r", "5", "-w", "30", "-l", "10", "8.8.8.8"])
|
202
195
|
assert_equal(options_target, options)
|
203
196
|
assert_equal(["8.8.8.8"], items)
|
204
197
|
end
|
198
|
+
|
199
|
+
def test_configuration_file
|
200
|
+
options_target = {
|
201
|
+
:pdnsdbs => ["virustotal"],
|
202
|
+
:format => "text",
|
203
|
+
:sep => "\t",
|
204
|
+
:recursedepth => 1,
|
205
|
+
:wait => 0,
|
206
|
+
:res => nil,
|
207
|
+
:debug => false,
|
208
|
+
:sqlitedb => nil,
|
209
|
+
:limit => nil,
|
210
|
+
:help => false,
|
211
|
+
:configfile => "#{ENV['HOME']}/.passivedns-client"
|
212
|
+
}
|
213
|
+
|
214
|
+
options, items = PassiveDNS::CLI.parse_command_line(["--config", "#{ENV['HOME']}/.passivedns-client"])
|
215
|
+
assert_equal(options_target, options)
|
216
|
+
assert_equal([], items)
|
217
|
+
|
218
|
+
end
|
205
219
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
unless Kernel.respond_to?(:require_relative)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
module Kernel
|
3
|
+
def require_relative(path)
|
4
|
+
require File.join(File.dirname(caller[0]), path.to_str)
|
5
|
+
end
|
6
|
+
end
|
7
7
|
end
|
8
8
|
|
9
9
|
require_relative 'helper'
|
@@ -22,59 +22,40 @@ class TestPassiveDnsQuery < Minitest::Test
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
def test_instantiate_Nonexisting_Client
|
26
|
+
assert_raises RuntimeError do
|
27
|
+
PassiveDNS::Client.new(['doesnotexist'])
|
28
|
+
end
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
PassiveDNS::Client.new(['
|
51
|
-
d = PassiveDNS::Provider::
|
31
|
+
def test_instantiate_All_Clients
|
32
|
+
PassiveDNS::Client.new()
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_instantiate_Passive_DNS_State
|
36
|
+
refute_nil(PassiveDNS::PDNSToolState.new)
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_instantiate_Passive_DNS_State_database
|
40
|
+
if File.exist?("test/test.sqlite3")
|
41
|
+
File.unlink("test/test.sqlite3")
|
42
|
+
end
|
43
|
+
refute_nil(PassiveDNS::PDNSToolStateDB.new("test/test.sqlite3"))
|
44
|
+
if File.exist?("test/test.sqlite3")
|
45
|
+
File.unlink("test/test.sqlite3")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_DNSDB
|
50
|
+
PassiveDNS::Client.new(['dnsdb'])
|
51
|
+
d = PassiveDNS::Provider::DNSDB.new(@cp['dnsdb'] || {})
|
52
52
|
refute_nil(d)
|
53
|
-
|
54
|
-
refute_nil(rows)
|
55
|
-
refute_nil(rows.to_s)
|
56
|
-
refute_nil(rows.to_xml)
|
57
|
-
refute_nil(rows.to_json)
|
58
|
-
refute_nil(rows.to_yaml)
|
59
|
-
assert_equal(3, rows.length)
|
60
|
-
rows = d.lookup("8.8.8.8")
|
53
|
+
rows = d.lookup("example.org",3)
|
61
54
|
refute_nil(rows)
|
62
55
|
refute_nil(rows.to_s)
|
63
56
|
refute_nil(rows.to_xml)
|
64
57
|
refute_nil(rows.to_json)
|
65
58
|
refute_nil(rows.to_yaml)
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_DNSDB
|
69
|
-
PassiveDNS::Client.new(['dnsdb'])
|
70
|
-
d = PassiveDNS::Provider::DNSDB.new(@cp['dnsdb'] || {})
|
71
|
-
refute_nil(d)
|
72
|
-
rows = d.lookup("example.org",3)
|
73
|
-
refute_nil(rows)
|
74
|
-
refute_nil(rows.to_s)
|
75
|
-
refute_nil(rows.to_xml)
|
76
|
-
refute_nil(rows.to_json)
|
77
|
-
refute_nil(rows.to_yaml)
|
78
59
|
assert_equal(3, rows.length) # this will fail since DNSDB has an off by one error
|
79
60
|
rows = d.lookup("8.8.8.8")
|
80
61
|
refute_nil(rows)
|
@@ -82,18 +63,18 @@ class TestPassiveDnsQuery < Minitest::Test
|
|
82
63
|
refute_nil(rows.to_xml)
|
83
64
|
refute_nil(rows.to_json)
|
84
65
|
refute_nil(rows.to_yaml)
|
85
|
-
|
66
|
+
end
|
86
67
|
|
87
|
-
|
88
|
-
|
68
|
+
def test_VirusTotal
|
69
|
+
PassiveDNS::Client.new(['virustotal'])
|
89
70
|
d = PassiveDNS::Provider::VirusTotal.new(@cp['virustotal'] || {})
|
90
71
|
refute_nil(d)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
72
|
+
rows = d.lookup("google.com",3)
|
73
|
+
refute_nil(rows)
|
74
|
+
refute_nil(rows.to_s)
|
75
|
+
refute_nil(rows.to_xml)
|
76
|
+
refute_nil(rows.to_json)
|
77
|
+
refute_nil(rows.to_yaml)
|
97
78
|
assert_equal(3, rows.length)
|
98
79
|
rows = d.lookup("8.8.8.8")
|
99
80
|
refute_nil(rows)
|
@@ -101,11 +82,11 @@ class TestPassiveDnsQuery < Minitest::Test
|
|
101
82
|
refute_nil(rows.to_xml)
|
102
83
|
refute_nil(rows.to_json)
|
103
84
|
refute_nil(rows.to_yaml)
|
104
|
-
|
85
|
+
end
|
105
86
|
|
106
|
-
def
|
107
|
-
PassiveDNS::Client.new(['
|
108
|
-
d = PassiveDNS::Provider::
|
87
|
+
def test_passivetotal
|
88
|
+
PassiveDNS::Client.new(['passivetotal'])
|
89
|
+
d = PassiveDNS::Provider::PassiveTotal.new(@cp['passivetotal'] || {})
|
109
90
|
refute_nil(d)
|
110
91
|
rows = d.lookup("example.org")
|
111
92
|
refute_nil(rows)
|
@@ -113,12 +94,13 @@ class TestPassiveDnsQuery < Minitest::Test
|
|
113
94
|
refute_nil(rows.to_xml)
|
114
95
|
refute_nil(rows.to_json)
|
115
96
|
refute_nil(rows.to_yaml)
|
116
|
-
rows = d.lookup("example.org",3)
|
97
|
+
rows = d.lookup("example.org", 3)
|
117
98
|
refute_nil(rows)
|
118
99
|
refute_nil(rows.to_s)
|
119
100
|
refute_nil(rows.to_xml)
|
120
101
|
refute_nil(rows.to_json)
|
121
102
|
refute_nil(rows.to_yaml)
|
103
|
+
puts(rows)
|
122
104
|
assert_equal(3, rows.length)
|
123
105
|
rows = d.lookup("8.8.8.8")
|
124
106
|
refute_nil(rows)
|
@@ -127,10 +109,10 @@ class TestPassiveDnsQuery < Minitest::Test
|
|
127
109
|
refute_nil(rows.to_json)
|
128
110
|
refute_nil(rows.to_yaml)
|
129
111
|
end
|
130
|
-
|
131
|
-
def
|
132
|
-
PassiveDNS::Client.new(['
|
133
|
-
d = PassiveDNS::Provider::
|
112
|
+
|
113
|
+
def test_circl
|
114
|
+
PassiveDNS::Client.new(['circl'])
|
115
|
+
d = PassiveDNS::Provider::CIRCL.new(@cp['circl'] || {})
|
134
116
|
refute_nil(d)
|
135
117
|
rows = d.lookup("example.org")
|
136
118
|
refute_nil(rows)
|
@@ -151,105 +133,30 @@ class TestPassiveDnsQuery < Minitest::Test
|
|
151
133
|
refute_nil(rows.to_xml)
|
152
134
|
refute_nil(rows.to_json)
|
153
135
|
refute_nil(rows.to_yaml)
|
154
|
-
|
155
|
-
|
156
|
-
def test_nmemonic
|
157
|
-
PassiveDNS::Client.new(['mnemonic'])
|
158
|
-
d = PassiveDNS::Provider::Mnemonic.new(@cp['mnemonic'] || {})
|
159
|
-
refute_nil(d)
|
160
|
-
rows = d.lookup("example.org")
|
161
|
-
refute_nil(rows)
|
162
|
-
refute_nil(rows.to_s)
|
163
|
-
refute_nil(rows.to_xml)
|
164
|
-
refute_nil(rows.to_json)
|
165
|
-
refute_nil(rows.to_yaml)
|
166
|
-
rows = d.lookup("example.org",3)
|
167
|
-
refute_nil(rows)
|
168
|
-
refute_nil(rows.to_s)
|
169
|
-
refute_nil(rows.to_xml)
|
170
|
-
refute_nil(rows.to_json)
|
171
|
-
refute_nil(rows.to_yaml)
|
172
|
-
assert_equal(3, rows.length)
|
173
|
-
rows = d.lookup("8.8.8.8")
|
174
|
-
refute_nil(rows)
|
175
|
-
refute_nil(rows.to_s)
|
176
|
-
refute_nil(rows.to_xml)
|
177
|
-
refute_nil(rows.to_json)
|
178
|
-
refute_nil(rows.to_yaml)
|
179
|
-
end
|
180
|
-
|
181
|
-
def test_passivetotal
|
182
|
-
PassiveDNS::Client.new(['passivetotal'])
|
183
|
-
d = PassiveDNS::Provider::PassiveTotal.new(@cp['passivetotal'] || {})
|
184
|
-
refute_nil(d)
|
185
|
-
rows = d.lookup("example.org")
|
186
|
-
refute_nil(rows)
|
187
|
-
refute_nil(rows.to_s)
|
188
|
-
refute_nil(rows.to_xml)
|
189
|
-
refute_nil(rows.to_json)
|
190
|
-
refute_nil(rows.to_yaml)
|
191
|
-
rows = d.lookup("example.org",3)
|
192
|
-
refute_nil(rows)
|
193
|
-
refute_nil(rows.to_s)
|
194
|
-
refute_nil(rows.to_xml)
|
195
|
-
refute_nil(rows.to_json)
|
196
|
-
refute_nil(rows.to_yaml)
|
197
|
-
assert_equal(3, rows.length)
|
198
|
-
rows = d.lookup("8.8.8.8")
|
199
|
-
refute_nil(rows)
|
200
|
-
refute_nil(rows.to_s)
|
201
|
-
refute_nil(rows.to_xml)
|
202
|
-
refute_nil(rows.to_json)
|
203
|
-
refute_nil(rows.to_yaml)
|
204
|
-
end
|
205
|
-
|
206
|
-
def test_circl
|
207
|
-
PassiveDNS::Client.new(['circl'])
|
208
|
-
d = PassiveDNS::Provider::CIRCL.new(@cp['circl'] || {})
|
209
|
-
refute_nil(d)
|
210
|
-
rows = d.lookup("example.org")
|
211
|
-
refute_nil(rows)
|
212
|
-
refute_nil(rows.to_s)
|
213
|
-
refute_nil(rows.to_xml)
|
214
|
-
refute_nil(rows.to_json)
|
215
|
-
refute_nil(rows.to_yaml)
|
216
|
-
rows = d.lookup("example.org",3)
|
217
|
-
refute_nil(rows)
|
218
|
-
refute_nil(rows.to_s)
|
219
|
-
refute_nil(rows.to_xml)
|
220
|
-
refute_nil(rows.to_json)
|
221
|
-
refute_nil(rows.to_yaml)
|
222
|
-
assert_equal(3, rows.length)
|
223
|
-
rows = d.lookup("8.8.8.8")
|
224
|
-
refute_nil(rows)
|
225
|
-
refute_nil(rows.to_s)
|
226
|
-
refute_nil(rows.to_xml)
|
227
|
-
refute_nil(rows.to_json)
|
228
|
-
refute_nil(rows.to_yaml)
|
229
|
-
end
|
136
|
+
end
|
230
137
|
|
231
138
|
def test_riskiq
|
232
|
-
|
139
|
+
PassiveDNS::Client.new(['riskiq'])
|
233
140
|
d = PassiveDNS::Provider::RiskIQ.new(@cp['riskiq'] || {})
|
234
141
|
refute_nil(d)
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
142
|
+
rows = d.lookup("example.org")
|
143
|
+
refute_nil(rows)
|
144
|
+
refute_nil(rows.to_s)
|
145
|
+
refute_nil(rows.to_xml)
|
146
|
+
refute_nil(rows.to_json)
|
147
|
+
refute_nil(rows.to_yaml)
|
148
|
+
rows = d.lookup("example.org",3)
|
149
|
+
refute_nil(rows)
|
150
|
+
refute_nil(rows.to_s)
|
151
|
+
refute_nil(rows.to_xml)
|
152
|
+
refute_nil(rows.to_json)
|
153
|
+
refute_nil(rows.to_yaml)
|
154
|
+
assert_equal(3, rows.length)
|
155
|
+
rows = d.lookup("8.8.8.8")
|
156
|
+
refute_nil(rows)
|
157
|
+
refute_nil(rows.to_s)
|
158
|
+
refute_nil(rows.to_xml)
|
159
|
+
refute_nil(rows.to_json)
|
160
|
+
refute_nil(rows.to_yaml)
|
161
|
+
end
|
255
162
|
end
|