passive-dns 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -29,7 +29,7 @@ module PassiveDNS
29
29
  ######### FIX BLANKS FOR MX
30
30
 
31
31
  end
32
- res << PDNSResult.new('BFK',response_time,r[0],r[2],r[1],nil,nil,nil)
32
+ res << PDNSResult.new('BFK',response_time,r[0],r[2],r[1])
33
33
  end
34
34
  end
35
35
  res
@@ -35,9 +35,9 @@ module PassiveDNS
35
35
  record['rdata'] = [record['rdata']] if record['rdata'].class == String
36
36
  record['rdata'].each do |rdata|
37
37
  if record['time_first']
38
- res << PDNSResult.new('ISC',response_time,record['rrname'],rdata,record['rrtype'],0,Time.at(record['time_first'].to_i).utc.strftime("%Y-%m-%dT%H:%M:%SZ"),Time.at(record['time_last'].to_i).utc.strftime("%Y-%m-%dT%H:%M:%SZ"))
38
+ res << PDNSResult.new('ISC',response_time,record['rrname'],rdata,record['rrtype'],0,Time.at(record['time_first'].to_i).utc.strftime("%Y-%m-%dT%H:%M:%SZ"),Time.at(record['time_last'].to_i).utc.strftime("%Y-%m-%dT%H:%M:%SZ"),record['count'])
39
39
  else
40
- res << PDNSResult.new('ISC',response_time,record['rrname'],rdata,record['rrtype'],nil,nil,nil)
40
+ res << PDNSResult.new('ISC',response_time,record['rrname'],rdata,record['rrtype'])
41
41
  end
42
42
  end
43
43
  end
@@ -70,6 +70,7 @@ module PassiveDNS
70
70
  t1 = Time.now
71
71
  response = http.request(request)
72
72
  t2 = Time.now
73
+ $stderr.puts response if @debug
73
74
  parse_json(response.body,t2-t1)
74
75
  }
75
76
  rescue Timeout::Error => e
@@ -11,7 +11,7 @@ require 'getoptlong'
11
11
  require 'sqlite3'
12
12
 
13
13
  module PassiveDNS
14
- class PDNSResult < Struct.new(:source, :response_time, :query, :answer, :rrtype, :ttl, :firstseen, :lastseen); end
14
+ class PDNSResult < Struct.new(:source, :response_time, :query, :answer, :rrtype, :ttl, :firstseen, :lastseen, :count); end
15
15
  class PDNSQueueEntry < Struct.new(:query, :state, :level); end
16
16
  class PDNSToolState
17
17
  attr_accessor :debug
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Chris Lee
@@ -36,13 +36,14 @@ cert_chain:
36
36
  6yhklP75
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-03-19 00:00:00 -04:00
39
+ date: 2012-07-17 00:00:00 -04:00
40
40
  default_executable: pdnstool
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
+ prerelease: false
44
+ type: :runtime
43
45
  name: json
44
- requirement: &id001 !ruby/object:Gem::Requirement
45
- none: false
46
+ version_requirements: &id001 !ruby/object:Gem::Requirement
46
47
  requirements:
47
48
  - - ">="
48
49
  - !ruby/object:Gem::Version
@@ -51,13 +52,12 @@ dependencies:
51
52
  - 4
52
53
  - 3
53
54
  version: 1.4.3
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: *id001
55
+ requirement: *id001
57
56
  - !ruby/object:Gem::Dependency
57
+ prerelease: false
58
+ type: :runtime
58
59
  name: sqlite3
59
- requirement: &id002 !ruby/object:Gem::Requirement
60
- none: false
60
+ version_requirements: &id002 !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
@@ -66,69 +66,64 @@ dependencies:
66
66
  - 3
67
67
  - 3
68
68
  version: 1.3.3
69
- type: :runtime
70
- prerelease: false
71
- version_requirements: *id002
69
+ requirement: *id002
72
70
  - !ruby/object:Gem::Dependency
71
+ prerelease: false
72
+ type: :development
73
73
  name: shoulda
74
- requirement: &id003 !ruby/object:Gem::Requirement
75
- none: false
74
+ version_requirements: &id003 !ruby/object:Gem::Requirement
76
75
  requirements:
77
76
  - - ">="
78
77
  - !ruby/object:Gem::Version
79
78
  segments:
80
79
  - 0
81
80
  version: "0"
82
- type: :development
83
- prerelease: false
84
- version_requirements: *id003
81
+ requirement: *id003
85
82
  - !ruby/object:Gem::Dependency
83
+ prerelease: false
84
+ type: :development
86
85
  name: bundler
87
- requirement: &id004 !ruby/object:Gem::Requirement
88
- none: false
86
+ version_requirements: &id004 !ruby/object:Gem::Requirement
89
87
  requirements:
90
88
  - - ~>
91
89
  - !ruby/object:Gem::Version
92
90
  segments:
93
91
  - 1
94
- - 0
95
- - 0
96
- version: 1.0.0
97
- type: :development
98
- prerelease: false
99
- version_requirements: *id004
92
+ - 1
93
+ - 5
94
+ version: 1.1.5
95
+ requirement: *id004
100
96
  - !ruby/object:Gem::Dependency
97
+ prerelease: false
98
+ type: :development
101
99
  name: jeweler
102
- requirement: &id005 !ruby/object:Gem::Requirement
103
- none: false
100
+ version_requirements: &id005 !ruby/object:Gem::Requirement
104
101
  requirements:
105
102
  - - ~>
106
103
  - !ruby/object:Gem::Version
107
104
  segments:
108
105
  - 1
109
- - 5
110
- - 2
111
- version: 1.5.2
112
- type: :development
113
- prerelease: false
114
- version_requirements: *id005
106
+ - 8
107
+ - 4
108
+ version: 1.8.4
109
+ requirement: *id005
115
110
  - !ruby/object:Gem::Dependency
111
+ prerelease: false
112
+ type: :development
116
113
  name: simplecov
117
- requirement: &id006 !ruby/object:Gem::Requirement
118
- none: false
114
+ version_requirements: &id006 !ruby/object:Gem::Requirement
119
115
  requirements:
120
116
  - - ">="
121
117
  - !ruby/object:Gem::Version
122
118
  segments:
123
119
  - 0
124
120
  version: "0"
125
- type: :development
126
- prerelease: false
127
- version_requirements: *id006
121
+ requirement: *id006
128
122
  - !ruby/object:Gem::Dependency
123
+ prerelease: false
124
+ type: :runtime
129
125
  name: json
130
- requirement: &id007 !ruby/object:Gem::Requirement
131
- none: false
126
+ version_requirements: &id007 !ruby/object:Gem::Requirement
132
127
  requirements:
133
128
  - - ">"
134
129
  - !ruby/object:Gem::Version
@@ -137,13 +132,12 @@ dependencies:
137
132
  - 4
138
133
  - 3
139
134
  version: 1.4.3
140
- type: :runtime
141
- prerelease: false
142
- version_requirements: *id007
135
+ requirement: *id007
143
136
  - !ruby/object:Gem::Dependency
137
+ prerelease: false
138
+ type: :runtime
144
139
  name: sqlite3
145
- requirement: &id008 !ruby/object:Gem::Requirement
146
- none: false
140
+ version_requirements: &id008 !ruby/object:Gem::Requirement
147
141
  requirements:
148
142
  - - ">="
149
143
  - !ruby/object:Gem::Version
@@ -152,9 +146,7 @@ dependencies:
152
146
  - 3
153
147
  - 3
154
148
  version: 1.3.3
155
- type: :runtime
156
- prerelease: false
157
- version_requirements: *id008
149
+ requirement: *id008
158
150
  description: This provides interfaces to various passive DNS databases to do the query and to normalize the responses. The query tool also allows for recursive queries, using an SQLite3 database to keep state.
159
151
  email: rubygems@chrislee.dhs.org
160
152
  executables:
@@ -175,8 +167,6 @@ files:
175
167
  - lib/util/structformatter.rb
176
168
  - LICENSE.txt
177
169
  - README.rdoc
178
- - test/helper.rb
179
- - test/test_passive-dns.rb
180
170
  has_rdoc: true
181
171
  homepage: https://rubygems.org/gems/passive-dns
182
172
  licenses:
@@ -187,16 +177,13 @@ rdoc_options: []
187
177
  require_paths:
188
178
  - lib
189
179
  required_ruby_version: !ruby/object:Gem::Requirement
190
- none: false
191
180
  requirements:
192
181
  - - ">="
193
182
  - !ruby/object:Gem::Version
194
- hash: 2792024255355768910
195
183
  segments:
196
184
  - 0
197
185
  version: "0"
198
186
  required_rubygems_version: !ruby/object:Gem::Requirement
199
- none: false
200
187
  requirements:
201
188
  - - ">="
202
189
  - !ruby/object:Gem::Version
@@ -206,10 +193,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
193
  requirements: []
207
194
 
208
195
  rubyforge_project:
209
- rubygems_version: 1.3.7
196
+ rubygems_version: 1.3.6
210
197
  signing_key:
211
198
  specification_version: 3
212
199
  summary: Query passive DNS databases
213
- test_files:
214
- - test/helper.rb
215
- - test/test_passive-dns.rb
200
+ test_files: []
201
+
metadata.gz.sig CHANGED
Binary file
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'passive-dns'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,70 +0,0 @@
1
- require 'helper'
2
-
3
- class TestPassiveDnsQuery < Test::Unit::TestCase
4
- should "instantiate BFK Client" do
5
- assert_not_nil(PassiveDNS::BFKClient.new)
6
- end
7
-
8
- should "instantiate DNSParse Client" do
9
- assert_not_nil(PassiveDNS::DNSParse.new)
10
- end
11
-
12
- should "instantiate ISC Client" do
13
- assert_not_nil(PassiveDNS::ISC.new)
14
- end
15
-
16
- should "instantiate CERT-EE Client" do
17
- assert_not_nil(PassiveDNS::CERTEE.new)
18
- end
19
-
20
- should "instantiate Passive DNS State" do
21
- assert_not_nil(PassiveDNS::PDNSToolState.new)
22
- end
23
-
24
- should "instantiate Passive DNS State database" do
25
- if File.exists?("test/test.sqlite3")
26
- File.unlink("test/test.sqlite3")
27
- end
28
- assert_not_nil(PassiveDNS::PDNSToolStateDB.new("test/test.sqlite3"))
29
- if File.exists?("test/test.sqlite3")
30
- File.unlink("test/test.sqlite3")
31
- end
32
- end
33
-
34
- should "query BFK" do
35
- rows = PassiveDNS::BFKClient.new.lookup("example.org");
36
- assert_not_nil(rows)
37
- assert_not_nil(rows.to_s)
38
- assert_not_nil(rows.to_xml)
39
- assert_not_nil(rows.to_json)
40
- assert_not_nil(rows.to_yaml)
41
- end
42
-
43
- should "query DNSParse" do
44
- rows = PassiveDNS::DNSParse.new.lookup("example.org");
45
- assert_not_nil(rows)
46
- assert_not_nil(rows.to_s)
47
- assert_not_nil(rows.to_xml)
48
- assert_not_nil(rows.to_json)
49
- assert_not_nil(rows.to_yaml)
50
- end
51
-
52
- should "query ISC" do
53
- rows = PassiveDNS::ISC.new.lookup("example.org");
54
- assert_not_nil(rows)
55
- assert_not_nil(rows.to_s)
56
- assert_not_nil(rows.to_xml)
57
- assert_not_nil(rows.to_json)
58
- assert_not_nil(rows.to_yaml)
59
- end
60
-
61
- should "query CERTEE" do
62
- rows = PassiveDNS::CERTEE.new.lookup("sim.cert.ee");
63
- assert_not_nil(rows)
64
- assert_not_nil(rows.to_s)
65
- assert_not_nil(rows.to_xml)
66
- assert_not_nil(rows.to_json)
67
- assert_not_nil(rows.to_yaml)
68
- end
69
-
70
- end