Sha256: 9a241f6e16fa4f89a8bfd16d9ee697fea160407203ebf504200f084cc861fb8d

Contents?: true

Size: 1.38 KB

Versions: 32

Compression:

Stored size: 1.38 KB

Contents

module CMSScanner
  class Error < StandardError
  end

  # Target Down Error
  class TargetDownError < Error
    attr_reader :response

    def initialize(response)
      @response = response
    end

    def to_s
      "The url supplied '#{response.request.url}' seems to be down (#{response.return_message})"
    end
  end

  # HTTP Authentication Required Error
  class HTTPAuthRequiredError < Error
    # :nocov:
    def to_s
      'HTTP authentication required (or was invalid), please provide it with --http-auth'
    end
    # :nocov:
  end

  # Proxy Authentication Required Error
  class ProxyAuthRequiredError < Error
    # :nocov:
    def to_s
      'Proxy authentication required (or was invalid), please provide it with --proxy-auth'
    end
    # :nocov:
  end

  # Access Forbidden Error
  class AccessForbiddenError < Error
    # :nocov:
    def to_s
      'The target is responding with a 403, this might be due to a WAF. ' \
      'Please re-try with --random-user-agent'
    end
    # :nocov:
  end

  # HTTP Redirect Error
  class HTTPRedirectError < Error
    attr_reader :redirect_uri

    # @param [ String ] url
    def initialize(url)
      @redirect_uri = Addressable::URI.parse(url).normalize
    end

    def to_s
      "The URL supplied redirects to #{redirect_uri}. Use the --ignore-main-redirect "\
      'option to ignore the redirection and scan the target.'
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cms_scanner-0.0.41.4 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.41.3 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.41.2 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.41.1 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.41.0 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.40.3 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.40.2 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.40.1 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.40 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.39.4 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.39.3 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.39.2 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.39.1 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.39.0 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.38.4 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.38.3 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.38.2 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.38.1 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.38.0 lib/cms_scanner/errors/http.rb
cms_scanner-0.0.37.12 lib/cms_scanner/errors/http.rb