Implemented default DNS address/port/protocol values.

Even though it is unlikely that a user would remove these options from
the DNS config file, it is still good practice to have these safeguards
in place.
This commit is contained in:
soh_cah_toa
2014-04-25 10:32:19 -04:00
parent 1d5afbb81e
commit 82e4b1eac7

View File

@@ -29,9 +29,9 @@ module BeEF
dns_config = BeEF::Core::Configuration.instance.get('beef.extension.dns')
dns = BeEF::Extension::Dns::Server.instance
protocol = dns_config['protocol'].to_sym
address = dns_config['address']
port = dns_config['port']
protocol = dns_config['protocol'].to_sym rescue :udp
address = dns_config['address'] || '127.0.0.1'
port = dns_config['port'] || 5300
interfaces = [[protocol, address, port]]
Thread.new { EventMachine.next_tick { dns.run(:listen => interfaces) } }