Exception: WPScan::Error::WpAuthFailed

Inherits:
Standard
  • Object
show all
Defined in:
lib/wpscan/errors/wp_auth.rb

Overview

Raised when authenticated requests to the WP REST API are rejected.

Instance Method Summary collapse

Constructor Details

#initialize(code, url) ⇒ WpAuthFailed

Returns a new instance of WpAuthFailed.



7
8
9
10
11
# File 'lib/wpscan/errors/wp_auth.rb', line 7

def initialize(code, url)
  super()
  @code = code
  @url  = url
end

Instance Method Details

#to_sObject



13
14
15
16
17
18
19
# File 'lib/wpscan/errors/wp_auth.rb', line 13

def to_s
  "Authenticated REST API request to #{@url} returned HTTP #{@code}. " \
    'WordPress core does NOT accept regular account passwords on /wp-json over Basic Auth. ' \
    'The password passed to --wp-auth must be a WordPress Application Password ' \
    '(WP >= 5.6): in wp-admin go to Users -> Profile -> Application Passwords, ' \
    'create one, and use the generated 24-character string (keep the spaces) as the password.'
end