Changed output format for RubyDNS to be "BeEF-compliant".
RubyDNS's logger now uses BeEF's print-related functions. Debug messages regarding queries can be enabled using --verbose.
This commit is contained in:
@@ -20,3 +20,4 @@ end
|
||||
|
||||
require 'extensions/dns/api'
|
||||
require 'extensions/dns/dns'
|
||||
require 'extensions/dns/ruby'
|
||||
|
||||
7
extensions/dns/ruby.rb
Normal file
7
extensions/dns/ruby.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
require 'extensions/dns/ruby/logger'
|
||||
require 'extensions/dns/ruby/rubydns'
|
||||
23
extensions/dns/ruby/logger.rb
Normal file
23
extensions/dns/ruby/logger.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
|
||||
# Overrives the logger used by RubyDNS to use BeEF's print_info() and friends
|
||||
class Logger
|
||||
|
||||
def debug(msg)
|
||||
print_debug "DNS Server: #{msg}"
|
||||
end
|
||||
|
||||
def info(msg)
|
||||
print_info "DNS Server: #{msg}"
|
||||
end
|
||||
|
||||
def error(msg)
|
||||
print_error "DNS Server: #{msg}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
31
extensions/dns/ruby/rubydns.rb
Normal file
31
extensions/dns/ruby/rubydns.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# 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 RubyDNS
|
||||
|
||||
# Overrides RubyDNS::run_server() to behave exactly the same, minus the output
|
||||
def self.run_server(options = {}, &block)
|
||||
server = RubyDNS::Server.new(&block)
|
||||
|
||||
options[:listen] ||= [[:udp, "0.0.0.0", 53], [:tcp, "0.0.0.0", 53]]
|
||||
|
||||
EventMachine.run do
|
||||
server.fire(:setup)
|
||||
|
||||
options[:listen].each do |spec|
|
||||
if spec[0] == :udp
|
||||
EventMachine.open_datagram_socket(spec[1], spec[2], UDPHandler, server)
|
||||
elsif spec[0] == :tcp
|
||||
EventMachine.start_server(spec[1], spec[2], TCPHandler, server)
|
||||
end
|
||||
end
|
||||
|
||||
server.fire(:start)
|
||||
end
|
||||
|
||||
server.fire(:stop)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user