Added ID filter checks to #get_rule.
This is ensures that ID validation occurs when using either the Ruby API or the RESTful API. Previously, validation was only done for the RESTful API.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user