class Intrigue::Ident::Check::Base
Public Class Methods
inherited(base)
click to toggle source
# File lib/checks/base.rb, line 6 def self.inherited(base) CheckFactory.register(base) end
Private Instance Methods
_body(content)
click to toggle source
# File lib/checks/base.rb, line 12 def _body(content) content["details"]["hidden_response_data"] || "" end
_first_body_capture(content, regex, filter=[])
click to toggle source
# File lib/checks/base.rb, line 22 def _first_body_capture(content, regex, filter=[]) return nil unless content["details"]["hidden_response_data"] x = content["details"]["hidden_response_data"].match(regex) if x x = x.captures.first.strip filter.each{|f| x.gsub!(f,"") } x = x.strip return x if x.length > 0 end nil end
_first_body_match(content, regex)
click to toggle source
matching helpers
# File lib/checks/base.rb, line 17 def _first_body_match(content, regex) return nil unless content["details"]["hidden_response_data"] content["details"]["hidden_response_data"].match(regex) end
_first_header_capture(content,regex, filter=[])
click to toggle source
# File lib/checks/base.rb, line 39 def _first_header_capture(content,regex, filter=[]) return nil unless content["details"]["headers"] x = content["details"]["headers"].join("\n").match(regex) if x x = x.captures.first filter.each{|f| x.gsub!(f,"") } x = x.strip return x if x.length > 0 end nil end
_first_header_match(content, regex)
click to toggle source
# File lib/checks/base.rb, line 34 def _first_header_match(content, regex) return nil unless content["details"]["headers"] content["details"]["headers"].match(regex).first end