Class: Dap::Filter::FilterDecodeDNSVersionReply
- Inherits:
-
Object
- Object
- Dap::Filter::FilterDecodeDNSVersionReply
- Includes:
- BaseDecoder
- Defined in:
- lib/dap/filter/udp.rb
Overview
Decode a DNS bind.version probe response ( zmap: dns_53.pkt )
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from BaseDecoder
Methods included from Base
Instance Method Details
#decode(data) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/dap/filter/udp.rb', line 43 def decode(data) begin r = Net::DNS::Packet.parse(data) return if not r # XXX: This can throw an exception on bad data vers = r.answer.map{|x| x.txt.strip rescue nil }.reject{|x| x.nil? }.first return if not vers return { "dns_version" => vers } rescue ::Exception { } end end |