Files
beef/extensions/dns/dns.rb
soh_cah_toa fdd1048f1a Implemented basic nameserver and configured it to run on BeEF startup.
It's worth noting that RubyDNS currently displays a lot of messy
output. This needs to be addressed before moving any further.
2013-05-03 22:37:42 -04:00

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