Files
beef/lib/filter/init.rb
wade@bindshell.net 49647ff8b4 filter areas broken up into the their own files
git-svn-id: https://beef.googlecode.com/svn/trunk@534 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
2010-11-16 12:15:12 +00:00

41 lines
1.2 KiB
Ruby

module BeEF
module Filter
# verify the page title string is valid
def self.is_valid_pagetitle?(str)
return false if not str.is_a? String
return false if BeEF::Filter.has_non_printable_char?(str)
return false if str.length > 50
true
end
# check the browser type value - for example, 'FF'
def self.is_valid_browsername?(str)
return false if not BeEF::Filter.is_non_empty_string?(str)
return false if str.length > 2
return false if BeEF::Filter.has_non_printable_char?(str)
true
end
# verify the browser version string is valid
def self.is_valid_browserversion?(str)
return false if not BeEF::Filter.is_non_empty_string?(str)
return false if BeEF::Filter.has_non_printable_char?(str)
return false if not BeEF::Filter.is_valid_float?(str)
return false if str.length > 10
true
end
# verify the browser/UA string is valid
def self.is_valid_browserstring?(str)
return false if not BeEF::Filter.is_non_empty_string?(str)
return false if BeEF::Filter.has_non_printable_char?(str)
return false if str.length > 200
true
end
end
end