It's worth noting that RubyDNS currently displays a lot of messy output. This needs to be addressed before moving any further.
34 lines
641 B
Ruby
34 lines
641 B
Ruby
#
|
|
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
|
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
|
# See the file 'doc/COPYING' for copying permission
|
|
#
|
|
module BeEF
|
|
module Extension
|
|
module DNS
|
|
|
|
class DNS
|
|
|
|
UPSTREAM = RubyDNS::Resolver.new([[:udp, '8.8.8.8', 53], [:tcp, '8.8.8.8', 53]])
|
|
|
|
def initialize(address, port)
|
|
@address = address
|
|
@port = port
|
|
|
|
run_server
|
|
end
|
|
|
|
def run_server
|
|
RubyDNS::run_server(:listen => [[:udp, @address, @port]]) do
|
|
otherwise do |transaction|
|
|
transaction.passthrough!(UPSTREAM)
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|