Exception: WPScan::Error::AccessForbidden

Inherits:
Standard
  • Object
show all
Defined in:
lib/wpscan/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)


85
86
87
# File 'lib/wpscan/errors/http.rb', line 85

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.



82
83
84
# File 'lib/wpscan/errors/http.rb', line 82

def random_user_agent_used
  @random_user_agent_used
end

Instance Method Details

#to_sObject



89
90
91
92
93
94
95
96
97
# File 'lib/wpscan/errors/http.rb', line 89

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