Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b46ecb3c9 |
@@ -6,8 +6,7 @@ module WPScan
|
|||||||
class Aliases < CMSScanner::Controller::Base
|
class Aliases < CMSScanner::Controller::Base
|
||||||
def cli_options
|
def cli_options
|
||||||
[
|
[
|
||||||
OptAlias.new(['--stealthy'],
|
OptAlias.new(['--stealthy'], alias_for: '--random-user-agent --detection-mode passive')
|
||||||
alias_for: '--random-user-agent --detection-mode passive --plugins-version-detection passive')
|
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ module WPScan
|
|||||||
value_if_empty: '1-100')
|
value_if_empty: '1-100')
|
||||||
},
|
},
|
||||||
value_if_empty: 'vp,vt,tt,cb,dbe,u,m',
|
value_if_empty: 'vp,vt,tt,cb,dbe,u,m',
|
||||||
incompatible: [%i[vp ap p], %i[vt at t]],
|
incompatible: [%i[vp ap p], %i[vt at t]]
|
||||||
default: { all_plugins: true, config_backups: true }
|
|
||||||
),
|
),
|
||||||
OptRegexp.new(
|
OptRegexp.new(
|
||||||
[
|
[
|
||||||
@@ -52,7 +51,7 @@ module WPScan
|
|||||||
OptChoice.new(
|
OptChoice.new(
|
||||||
['--plugins-detection MODE',
|
['--plugins-detection MODE',
|
||||||
'Use the supplied mode to enumerate Plugins.'],
|
'Use the supplied mode to enumerate Plugins.'],
|
||||||
choices: %w[mixed passive aggressive], normalize: :to_sym, default: :passive
|
choices: %w[mixed passive aggressive], normalize: :to_sym
|
||||||
),
|
),
|
||||||
OptBoolean.new(
|
OptBoolean.new(
|
||||||
['--plugins-version-all',
|
['--plugins-version-all',
|
||||||
@@ -63,7 +62,7 @@ module WPScan
|
|||||||
OptChoice.new(
|
OptChoice.new(
|
||||||
['--plugins-version-detection MODE',
|
['--plugins-version-detection MODE',
|
||||||
'Use the supplied mode to check plugins\' versions.'],
|
'Use the supplied mode to check plugins\' versions.'],
|
||||||
choices: %w[mixed passive aggressive], normalize: :to_sym, default: :mixed
|
choices: %w[mixed passive aggressive], normalize: :to_sym
|
||||||
),
|
),
|
||||||
OptInteger.new(
|
OptInteger.new(
|
||||||
['--plugins-threshold THRESHOLD',
|
['--plugins-threshold THRESHOLD',
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ module WPScan
|
|||||||
# If the --enumerate is used, the default value is handled by the Option
|
# If the --enumerate is used, the default value is handled by the Option
|
||||||
# However, when using --passwords alone, the default has to be set by the code below
|
# However, when using --passwords alone, the default has to be set by the code below
|
||||||
def enum_users_range
|
def enum_users_range
|
||||||
ParsedCli.enumerate[:users] || cli_enum_choices[0].choices[:u].validate(nil)
|
ParsedCli.enumerate&.dig(:users) || cli_enum_choices[0].choices[:u].validate(nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
# Version
|
# Version
|
||||||
module WPScan
|
module WPScan
|
||||||
VERSION = '3.8.17'
|
VERSION = '3.9.0-dev'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ describe WPScan::Controller::Aliases do
|
|||||||
describe 'parsed_options' do
|
describe 'parsed_options' do
|
||||||
context 'when no --stealthy supplied' do
|
context 'when no --stealthy supplied' do
|
||||||
it 'contains the correct options' do
|
it 'contains the correct options' do
|
||||||
expect(WPScan::ParsedCli.options).to include(
|
expect(WPScan::ParsedCli.options).to include(detection_mode: :mixed)
|
||||||
detection_mode: :mixed, plugins_version_detection: :mixed
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -31,9 +29,7 @@ describe WPScan::Controller::Aliases do
|
|||||||
let(:cli_args) { "#{super()} --stealthy" }
|
let(:cli_args) { "#{super()} --stealthy" }
|
||||||
|
|
||||||
it 'contains the correct options' do
|
it 'contains the correct options' do
|
||||||
expect(WPScan::ParsedCli.options).to include(
|
expect(WPScan::ParsedCli.options).to include(random_user_agent: true, detection_mode: :passive)
|
||||||
random_user_agent: true, detection_mode: :passive, plugins_version_detection: :passive
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ describe WPScan::Controller::Enumeration do
|
|||||||
let(:type) { t }
|
let(:type) { t }
|
||||||
let(:detection_mode) { :mixed }
|
let(:detection_mode) { :mixed }
|
||||||
|
|
||||||
context 'when vulnerable' do
|
context 'when vulnerable and mixed detection' do
|
||||||
let(:cli_args) { "#{super()} -e v#{type[0]}" }
|
let(:cli_args) { "#{super()} -e v#{type[0]}" }
|
||||||
|
|
||||||
it 'returns the expected string' do
|
it 'returns the expected string' do
|
||||||
@@ -37,7 +37,7 @@ describe WPScan::Controller::Enumeration do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when all' do
|
context 'when all and passive detection' do
|
||||||
let(:cli_args) { "#{super()} -e a#{type[0]}" }
|
let(:cli_args) { "#{super()} -e a#{type[0]}" }
|
||||||
let(:detection_mode) { :passive }
|
let(:detection_mode) { :passive }
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ describe WPScan::Controller::Enumeration do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when most popular' do
|
context 'when most popular and aggressive detection' do
|
||||||
let(:cli_args) { "#{super()} -e #{type[0]}" }
|
let(:cli_args) { "#{super()} -e #{type[0]}" }
|
||||||
let(:detection_mode) { :aggressive }
|
let(:detection_mode) { :aggressive }
|
||||||
|
|
||||||
@@ -58,14 +58,6 @@ describe WPScan::Controller::Enumeration do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#default_opts' do
|
|
||||||
context 'when no --enumerate' do
|
|
||||||
it 'contains the correct version_detection' do
|
|
||||||
expect(controller.default_opts('plugins')[:version_detection]).to include(mode: :mixed)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#cli_options' do
|
describe '#cli_options' do
|
||||||
it 'contains the correct options' do
|
it 'contains the correct options' do
|
||||||
expect(controller.cli_options.map(&:to_sym)).to eql(
|
expect(controller.cli_options.map(&:to_sym)).to eql(
|
||||||
@@ -104,17 +96,6 @@ describe WPScan::Controller::Enumeration do
|
|||||||
|
|
||||||
describe '#run' do
|
describe '#run' do
|
||||||
context 'when no :enumerate' do
|
context 'when no :enumerate' do
|
||||||
before do
|
|
||||||
expect(controller).to receive(:enum_plugins)
|
|
||||||
expect(controller).to receive(:enum_config_backups)
|
|
||||||
|
|
||||||
expect(WPScan::ParsedCli.plugins_detection).to eql :passive
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'calls enum_plugins and enum_config_backups' do
|
|
||||||
controller.run
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when --passwords supplied but no --username or --usernames' do
|
context 'when --passwords supplied but no --username or --usernames' do
|
||||||
let(:cli_args) { "#{super()} --passwords some-file.txt" }
|
let(:cli_args) { "#{super()} --passwords some-file.txt" }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user