passivedns-client 1.3.1 → 1.3.2
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 +4 -4
- data/lib/passivedns/client/tcpiputils.rb +6 -1
- data/lib/passivedns/client/version.rb +1 -1
- data/test/test_passivedns-client.rb +30 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cde5271625d34d5936db557dd2d91d7a4eff23bd
|
4
|
+
data.tar.gz: b119c8deccbc64b2b174cdb58af80e399e420e33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7558c0115c300fbb8f6fead3ae4035dacbd9262d273599c541c1e8ed82aa29f0db1b072fc9f3256c9bc469ef87d3446f8d02d2360b84e4c9a2133aacc5c9c6a4
|
7
|
+
data.tar.gz: db8efada307bb6d5df8a8eacf6138a8e60b08b5cc85bf7db80e564e406b87bb6fc7c34f3aca743546ef11ff066bff5f8eefeb2f1ab984a479493ee7ccc5467aa
|
@@ -40,6 +40,10 @@ To obtain an API Key, go to http://www.tcpiputils.com/premium-access and purchas
|
|
40
40
|
data.each do |rec|
|
41
41
|
recs << PDNSResult.new("tcpiputils", delta, question, rec["dns"], "MX", nil, nil, rec["updatedate"], nil)
|
42
42
|
end
|
43
|
+
when "domains"
|
44
|
+
data.each do |rec|
|
45
|
+
recs << PDNSResult.new("tcpiputils", delta, rec, question, "A", nil, nil, nil, nil)
|
46
|
+
end
|
43
47
|
end
|
44
48
|
end
|
45
49
|
recs
|
@@ -47,7 +51,8 @@ To obtain an API Key, go to http://www.tcpiputils.com/premium-access and purchas
|
|
47
51
|
|
48
52
|
def lookup(label, limit=nil)
|
49
53
|
$stderr.puts "DEBUG: TCPIPUtils.lookup(#{label})" if @debug
|
50
|
-
|
54
|
+
type = (label.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)) ? "domainneighbors" : "domainipdnshistory"
|
55
|
+
url = "https://www.utlsapi.com/api.php?version=1.0&apikey=#{@apikey}&type=#{type}&q=#{label}"
|
51
56
|
recs = []
|
52
57
|
Timeout::timeout(240) {
|
53
58
|
url = URI.parse url
|
@@ -47,6 +47,12 @@ class TestPassiveDnsQuery < Test::Unit::TestCase
|
|
47
47
|
assert_not_nil(rows.to_json)
|
48
48
|
assert_not_nil(rows.to_yaml)
|
49
49
|
assert_equal(3, rows.length)
|
50
|
+
rows = PassiveDNS::BFK.new.lookup("8.8.8.8")
|
51
|
+
assert_not_nil(rows)
|
52
|
+
assert_not_nil(rows.to_s)
|
53
|
+
assert_not_nil(rows.to_xml)
|
54
|
+
assert_not_nil(rows.to_json)
|
55
|
+
assert_not_nil(rows.to_yaml)
|
50
56
|
end
|
51
57
|
|
52
58
|
def test_CERTEE
|
@@ -62,6 +68,12 @@ class TestPassiveDnsQuery < Test::Unit::TestCase
|
|
62
68
|
assert_not_nil(rows.to_json)
|
63
69
|
assert_not_nil(rows.to_yaml)
|
64
70
|
assert_equal(3, rows.length)
|
71
|
+
rows = PassiveDNS::CERTEE.new.lookup("8.8.8.8")
|
72
|
+
assert_not_nil(rows)
|
73
|
+
assert_not_nil(rows.to_s)
|
74
|
+
assert_not_nil(rows.to_xml)
|
75
|
+
assert_not_nil(rows.to_json)
|
76
|
+
assert_not_nil(rows.to_yaml)
|
65
77
|
end
|
66
78
|
|
67
79
|
def test_DNSDB
|
@@ -76,6 +88,12 @@ class TestPassiveDnsQuery < Test::Unit::TestCase
|
|
76
88
|
assert_not_nil(rows.to_json)
|
77
89
|
assert_not_nil(rows.to_yaml)
|
78
90
|
assert_equal(3, rows.length) # this will fail since DNSDB has an off by one error
|
91
|
+
rows = PassiveDNS::DNSDB.new.lookup("8.8.8.8")
|
92
|
+
assert_not_nil(rows)
|
93
|
+
assert_not_nil(rows.to_s)
|
94
|
+
assert_not_nil(rows.to_xml)
|
95
|
+
assert_not_nil(rows.to_json)
|
96
|
+
assert_not_nil(rows.to_yaml)
|
79
97
|
end
|
80
98
|
|
81
99
|
def test_VirusTotal
|
@@ -90,6 +108,12 @@ class TestPassiveDnsQuery < Test::Unit::TestCase
|
|
90
108
|
assert_not_nil(rows.to_json)
|
91
109
|
assert_not_nil(rows.to_yaml)
|
92
110
|
assert_equal(3, rows.length)
|
111
|
+
rows = PassiveDNS::VirusTotal.new.lookup("8.8.8.8")
|
112
|
+
assert_not_nil(rows)
|
113
|
+
assert_not_nil(rows.to_s)
|
114
|
+
assert_not_nil(rows.to_xml)
|
115
|
+
assert_not_nil(rows.to_json)
|
116
|
+
assert_not_nil(rows.to_yaml)
|
93
117
|
end
|
94
118
|
|
95
119
|
def test_TCPIPUtils
|
@@ -110,5 +134,11 @@ class TestPassiveDnsQuery < Test::Unit::TestCase
|
|
110
134
|
assert_not_nil(rows.to_json)
|
111
135
|
assert_not_nil(rows.to_yaml)
|
112
136
|
assert_equal(3, rows.length)
|
137
|
+
rows = PassiveDNS::TCPIPUtils.new.lookup("8.8.8.8")
|
138
|
+
assert_not_nil(rows)
|
139
|
+
assert_not_nil(rows.to_s)
|
140
|
+
assert_not_nil(rows.to_xml)
|
141
|
+
assert_not_nil(rows.to_json)
|
142
|
+
assert_not_nil(rows.to_yaml)
|
113
143
|
end
|
114
144
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passivedns-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chrislee35
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|