Sha256: 9768d83a7e94aeadce494cd93cdf6ba22551f52bc2499575a52eebdc4bf5a104

Contents?: true

Size: 1.03 KB

Versions: 22

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module Users
      # Since WP 5.5, /wp-sitemap-users-1.xml is generated and contains
      # the usernames of accounts who made a post
      class AuthorSitemap < CMSScanner::Finders::Finder
        # @param [ Hash ] opts
        #
        # @return [ Array<User> ]
        def aggressive(_opts = {})
          found = []

          Browser.get(sitemap_url).html.xpath('//url/loc').each do |user_tag|
            username = user_tag.text.to_s[%r{/author/([^/]+)/}, 1]

            next unless username && !username.strip.empty?

            found << Model::User.new(username,
                                     found_by: found_by,
                                     confidence: 100,
                                     interesting_entries: [sitemap_url])
          end

          found
        end

        # @return [ String ] The URL of the sitemap
        def sitemap_url
          @sitemap_url ||= target.url('wp-sitemap-users-1.xml')
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
wpscan-3.8.28 app/finders/users/author_sitemap.rb
wpscan-3.8.27 app/finders/users/author_sitemap.rb
wpscan-3.8.26 app/finders/users/author_sitemap.rb
wpscan-3.8.25 app/finders/users/author_sitemap.rb
wpscan-3.8.24 app/finders/users/author_sitemap.rb
wpscan-3.8.22 app/finders/users/author_sitemap.rb
wpscan-3.8.21 app/finders/users/author_sitemap.rb
wpscan-3.8.20 app/finders/users/author_sitemap.rb
wpscan-3.8.19 app/finders/users/author_sitemap.rb
wpscan-3.8.18 app/finders/users/author_sitemap.rb
wpscan-3.8.17 app/finders/users/author_sitemap.rb
wpscan-3.8.16 app/finders/users/author_sitemap.rb
wpscan-3.8.15 app/finders/users/author_sitemap.rb
wpscan-3.8.14 app/finders/users/author_sitemap.rb
wpscan-3.8.13 app/finders/users/author_sitemap.rb
wpscan-3.8.12 app/finders/users/author_sitemap.rb
wpscan-3.8.11 app/finders/users/author_sitemap.rb
wpscan-3.8.10 app/finders/users/author_sitemap.rb
wpscan-3.8.9 app/finders/users/author_sitemap.rb
wpscan-3.8.8 app/finders/users/author_sitemap.rb