Renamed /rules GET route to /ruleset for the sake of consistency.

Also added new "count" key to result that lists the number of rules.
This commit is contained in:
soh_cah_toa
2013-06-05 16:30:24 -04:00
parent 2f5133e11a
commit e56494d486

View File

@@ -25,10 +25,14 @@ module Dns
end
# Returns the entire current DNS ruleset
get '/rules' do
get '/ruleset' do
begin
ruleset = BeEF::Extension::Dns::Server.instance.get_ruleset
count = ruleset.length
result = {}
result[:rules] = BeEF::Extension::Dns::Server.instance.get_ruleset
result[:count] = count
result[:ruleset] = ruleset
result.to_json
rescue StandardError => e
print_error "Internal error while retrieving DNS ruleset (#{e.message})"