Exception: CMSScanner::Error::AccessForbidden

Inherits:
Standard
  • Object
show all
Defined in:
lib/cms_scanner/errors/http.rb

Overview

Access Forbidden Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(random_user_agent_used) ⇒ AccessForbidden

Returns a new instance of AccessForbidden.

Parameters:

  • random_user_agent_used (Boolean)


41
42
43
# File 'lib/cms_scanner/errors/http.rb', line 41

def initialize(random_user_agent_used)
  @random_user_agent_used = random_user_agent_used
end

Instance Attribute Details

#random_user_agent_usedObject (readonly)

Returns the value of attribute random_user_agent_used.



38
39
40
# File 'lib/cms_scanner/errors/http.rb', line 38

def random_user_agent_used
  @random_user_agent_used
end

Instance Method Details

#to_sObject



45
46
47
48
49
50
51
52
53
# File 'lib/cms_scanner/errors/http.rb', line 45

def to_s
  msg = if random_user_agent_used
          'Well... --random-user-agent didn\'t work, use --force to skip this check if needed.'
        else
          'Please re-try with --random-user-agent'
        end

  "The target is responding with a 403, this might be due to a WAF. #{msg}"
end