Adds --exclude-usernames option
This commit is contained in:
@@ -170,6 +170,12 @@ module WPScan
|
||||
['--users-detection MODE',
|
||||
'Use the supplied mode to enumerate Users, instead of the global (--detection-mode) mode.'],
|
||||
choices: %w[mixed passive aggressive], normalize: :to_sym, advanced: true
|
||||
),
|
||||
OptRegexp.new(
|
||||
[
|
||||
'--exclude-usernames REGEXP_OR_STRING',
|
||||
'Exclude usernames matching the Regexp/string (case insensitive). Regexp delimiters are not required.'
|
||||
], options: Regexp::IGNORECASE
|
||||
)
|
||||
]
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,7 +10,7 @@ module WPScan
|
||||
module Finders
|
||||
# Specific Finders container to filter the version detected
|
||||
# and remove the one with low confidence to avoid false
|
||||
# positive when there is not enought information to accurately
|
||||
# positive when there is not enough information to accurately
|
||||
# determine it.
|
||||
class WpVersionFinders < UniqueFinders
|
||||
def filter_findings
|
||||
|
||||
@@ -76,7 +76,7 @@ describe WPScan::Controller::Enumeration do
|
||||
config_backups_list config_backups_detection
|
||||
db_exports_list db_exports_detection
|
||||
medias_detection
|
||||
users_list users_detection]
|
||||
users_list users_detection exclude_usernames]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user