Adds --exclude-usernames option

This commit is contained in:
erwanlr
2021-03-22 16:35:33 +01:00
parent f887f8baa4
commit 87c2f82b80
4 changed files with 22 additions and 2 deletions

View File

@@ -11,6 +11,16 @@ require_relative 'users/yoast_seo_author_sitemap'
module WPScan
module Finders
# Specific Finders container to filter the usernames found
# and remove the ones matching ParsedCli.exclude_username if supplied
class UsersFinders < SameTypeFinders
def filter_findings
findings.delete_if { |user| ParsedCli.exclude_usernames.match?(user.username) } if ParsedCli.exclude_usernames
findings
end
end
module Users
# Users Finder
class Base
@@ -28,6 +38,10 @@ module WPScan
Users::AuthorIdBruteForcing.new(target) <<
Users::LoginErrorMessages.new(target)
end
def finders
@finders ||= Finders::UsersFinders.new
end
end
end
end