diff --git a/extensions/dns/dns.rb b/extensions/dns/dns.rb index 43782af8f..d1ed4d4d1 100644 --- a/extensions/dns/dns.rb +++ b/extensions/dns/dns.rb @@ -63,8 +63,14 @@ module BeEF # @return [Hash] hash representation of rule (empty hash if rule wasn't found) def get_rule(id) @lock.synchronize do - rule = @database.get(id) - rule.nil? ? {} : to_hash(rule) + if BeEF::Filters.hexs_only?(id) && + !BeEF::Filters.has_null?(id) && + !BeEF::Filters.has_non_printable_char?(id) && + id.length == 8 + + rule = @database.get(id) + rule.nil? ? {} : to_hash(rule) + end end end