passive-dns 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/bin/pdnstool +1 -0
- data/lib/pdns/bfkclient.rb +1 -1
- data/lib/pdns/dnsparse.rb +4 -3
- data/test/test_passive-dns.rb +1 -1
- metadata +39 -49
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/bin/pdnstool
CHANGED
data/lib/pdns/bfkclient.rb
CHANGED
@@ -8,7 +8,7 @@ module PassiveDNS
|
|
8
8
|
end
|
9
9
|
@@base = "http://www.bfk.de/bfk_dnslogger.html?query="
|
10
10
|
def parse(page,response_time)
|
11
|
-
line = page.split(/<table/).grep(/ id=\"logger\"/)
|
11
|
+
line = page.unpack('C*').pack('U*').split(/<table/).grep(/ id=\"logger\"/)
|
12
12
|
return [] unless line.length > 0
|
13
13
|
line = line[0].gsub(/[\t\n]/,'').gsub(/<\/table.*/,'')
|
14
14
|
rows = line.split(/<tr.*?>/)
|
data/lib/pdns/dnsparse.rb
CHANGED
@@ -55,8 +55,10 @@ module PassiveDNS
|
|
55
55
|
def lookup(label)
|
56
56
|
$stderr.puts "DEBUG: DNSParse.lookup(#{label})" if @debug
|
57
57
|
Timeout::timeout(240) {
|
58
|
-
year = Time.now.strftime("%Y")
|
59
|
-
|
58
|
+
year = Time.now.strftime("%Y").to_i
|
59
|
+
month = Time.now.strftime("%m").to_i
|
60
|
+
url = "#{@base}#{label}&year=#{year - 1}"
|
61
|
+
url = "#{@base}#{label}&year=#{year}" if month > 3
|
60
62
|
if label =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/
|
61
63
|
url.gsub!(/query\.php/,'cidr.php')
|
62
64
|
elsif label =~ /\*$/
|
@@ -66,7 +68,6 @@ module PassiveDNS
|
|
66
68
|
url = URI.parse url
|
67
69
|
http = Net::HTTP.new(url.host, url.port)
|
68
70
|
http.use_ssl = (url.scheme == 'https')
|
69
|
-
http.ca_file = "#{ENV['HOME']}/bin/data/cacert.pem"
|
70
71
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
71
72
|
http.verify_depth = 5
|
72
73
|
request = Net::HTTP::Get.new(url.path+"?"+url.query)
|
data/test/test_passive-dns.rb
CHANGED
@@ -59,7 +59,7 @@ class TestPassiveDnsQuery < Test::Unit::TestCase
|
|
59
59
|
end
|
60
60
|
|
61
61
|
should "query CERTEE" do
|
62
|
-
rows = PassiveDNS::CERTEE.new.lookup("
|
62
|
+
rows = PassiveDNS::CERTEE.new.lookup("sim.cert.ee");
|
63
63
|
assert_not_nil(rows)
|
64
64
|
assert_not_nil(rows.to_s)
|
65
65
|
assert_not_nil(rows.to_xml)
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passive-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Chris Lee
|
@@ -37,133 +36,125 @@ cert_chain:
|
|
37
36
|
6yhklP75
|
38
37
|
-----END CERTIFICATE-----
|
39
38
|
|
40
|
-
date:
|
39
|
+
date: 2012-03-19 00:00:00 -04:00
|
41
40
|
default_executable: pdnstool
|
42
41
|
dependencies:
|
43
42
|
- !ruby/object:Gem::Dependency
|
44
|
-
|
43
|
+
name: json
|
44
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
45
45
|
none: false
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
hash: 1
|
50
49
|
segments:
|
51
50
|
- 1
|
52
51
|
- 4
|
53
52
|
- 3
|
54
53
|
version: 1.4.3
|
55
|
-
requirement: *id001
|
56
|
-
prerelease: false
|
57
|
-
name: json
|
58
54
|
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: *id001
|
59
57
|
- !ruby/object:Gem::Dependency
|
60
|
-
|
58
|
+
name: sqlite3
|
59
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
61
60
|
none: false
|
62
61
|
requirements:
|
63
62
|
- - ">="
|
64
63
|
- !ruby/object:Gem::Version
|
65
|
-
hash: 29
|
66
64
|
segments:
|
67
65
|
- 1
|
68
66
|
- 3
|
69
67
|
- 3
|
70
68
|
version: 1.3.3
|
71
|
-
requirement: *id002
|
72
|
-
prerelease: false
|
73
|
-
name: sqlite3
|
74
69
|
type: :runtime
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: *id002
|
75
72
|
- !ruby/object:Gem::Dependency
|
76
|
-
|
73
|
+
name: shoulda
|
74
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
77
75
|
none: false
|
78
76
|
requirements:
|
79
77
|
- - ">="
|
80
78
|
- !ruby/object:Gem::Version
|
81
|
-
hash: 3
|
82
79
|
segments:
|
83
80
|
- 0
|
84
81
|
version: "0"
|
85
|
-
requirement: *id003
|
86
|
-
prerelease: false
|
87
|
-
name: shoulda
|
88
82
|
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: *id003
|
89
85
|
- !ruby/object:Gem::Dependency
|
90
|
-
|
86
|
+
name: bundler
|
87
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
91
88
|
none: false
|
92
89
|
requirements:
|
93
90
|
- - ~>
|
94
91
|
- !ruby/object:Gem::Version
|
95
|
-
hash: 23
|
96
92
|
segments:
|
97
93
|
- 1
|
98
94
|
- 0
|
99
95
|
- 0
|
100
96
|
version: 1.0.0
|
101
|
-
requirement: *id004
|
102
|
-
prerelease: false
|
103
|
-
name: bundler
|
104
97
|
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: *id004
|
105
100
|
- !ruby/object:Gem::Dependency
|
106
|
-
|
101
|
+
name: jeweler
|
102
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
107
103
|
none: false
|
108
104
|
requirements:
|
109
105
|
- - ~>
|
110
106
|
- !ruby/object:Gem::Version
|
111
|
-
hash: 7
|
112
107
|
segments:
|
113
108
|
- 1
|
114
109
|
- 5
|
115
110
|
- 2
|
116
111
|
version: 1.5.2
|
117
|
-
requirement: *id005
|
118
|
-
prerelease: false
|
119
|
-
name: jeweler
|
120
112
|
type: :development
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: *id005
|
121
115
|
- !ruby/object:Gem::Dependency
|
122
|
-
|
116
|
+
name: simplecov
|
117
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
123
118
|
none: false
|
124
119
|
requirements:
|
125
120
|
- - ">="
|
126
121
|
- !ruby/object:Gem::Version
|
127
|
-
hash: 3
|
128
122
|
segments:
|
129
123
|
- 0
|
130
124
|
version: "0"
|
131
|
-
requirement: *id006
|
132
|
-
prerelease: false
|
133
|
-
name: rcov
|
134
125
|
type: :development
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: *id006
|
135
128
|
- !ruby/object:Gem::Dependency
|
136
|
-
|
129
|
+
name: json
|
130
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
137
131
|
none: false
|
138
132
|
requirements:
|
139
133
|
- - ">"
|
140
134
|
- !ruby/object:Gem::Version
|
141
|
-
hash: 1
|
142
135
|
segments:
|
143
136
|
- 1
|
144
137
|
- 4
|
145
138
|
- 3
|
146
139
|
version: 1.4.3
|
147
|
-
requirement: *id007
|
148
|
-
prerelease: false
|
149
|
-
name: json
|
150
140
|
type: :runtime
|
141
|
+
prerelease: false
|
142
|
+
version_requirements: *id007
|
151
143
|
- !ruby/object:Gem::Dependency
|
152
|
-
|
144
|
+
name: sqlite3
|
145
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
153
146
|
none: false
|
154
147
|
requirements:
|
155
148
|
- - ">="
|
156
149
|
- !ruby/object:Gem::Version
|
157
|
-
hash: 29
|
158
150
|
segments:
|
159
151
|
- 1
|
160
152
|
- 3
|
161
153
|
- 3
|
162
154
|
version: 1.3.3
|
163
|
-
requirement: *id008
|
164
|
-
prerelease: false
|
165
|
-
name: sqlite3
|
166
155
|
type: :runtime
|
156
|
+
prerelease: false
|
157
|
+
version_requirements: *id008
|
167
158
|
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.
|
168
159
|
email: rubygems@chrislee.dhs.org
|
169
160
|
executables:
|
@@ -200,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
191
|
requirements:
|
201
192
|
- - ">="
|
202
193
|
- !ruby/object:Gem::Version
|
203
|
-
hash:
|
194
|
+
hash: 2792024255355768910
|
204
195
|
segments:
|
205
196
|
- 0
|
206
197
|
version: "0"
|
@@ -209,14 +200,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
200
|
requirements:
|
210
201
|
- - ">="
|
211
202
|
- !ruby/object:Gem::Version
|
212
|
-
hash: 3
|
213
203
|
segments:
|
214
204
|
- 0
|
215
205
|
version: "0"
|
216
206
|
requirements: []
|
217
207
|
|
218
208
|
rubyforge_project:
|
219
|
-
rubygems_version: 1.
|
209
|
+
rubygems_version: 1.3.7
|
220
210
|
signing_key:
|
221
211
|
specification_version: 3
|
222
212
|
summary: Query passive DNS databases
|
metadata.gz.sig
CHANGED
Binary file
|