Fixes #1628
This commit is contained in:
@@ -21,9 +21,7 @@ describe WPScan::Controller::Aliases do
|
||||
describe 'parsed_options' do
|
||||
context 'when no --stealthy supplied' do
|
||||
it 'contains the correct options' do
|
||||
expect(WPScan::ParsedCli.options).to include(
|
||||
detection_mode: :mixed, plugins_version_detection: :mixed
|
||||
)
|
||||
expect(WPScan::ParsedCli.options).to include(detection_mode: :mixed)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,9 +29,7 @@ describe WPScan::Controller::Aliases do
|
||||
let(:cli_args) { "#{super()} --stealthy" }
|
||||
|
||||
it 'contains the correct options' do
|
||||
expect(WPScan::ParsedCli.options).to include(
|
||||
random_user_agent: true, detection_mode: :passive, plugins_version_detection: :passive
|
||||
)
|
||||
expect(WPScan::ParsedCli.options).to include(random_user_agent: true, detection_mode: :passive)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ describe WPScan::Controller::Enumeration do
|
||||
let(:type) { t }
|
||||
let(:detection_mode) { :mixed }
|
||||
|
||||
context 'when vulnerable' do
|
||||
context 'when vulnerable and mixed detection' do
|
||||
let(:cli_args) { "#{super()} -e v#{type[0]}" }
|
||||
|
||||
it 'returns the expected string' do
|
||||
@@ -37,7 +37,7 @@ describe WPScan::Controller::Enumeration do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when all' do
|
||||
context 'when all and passive detection' do
|
||||
let(:cli_args) { "#{super()} -e a#{type[0]}" }
|
||||
let(:detection_mode) { :passive }
|
||||
|
||||
@@ -46,7 +46,7 @@ describe WPScan::Controller::Enumeration do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when most popular' do
|
||||
context 'when most popular and aggressive detection' do
|
||||
let(:cli_args) { "#{super()} -e #{type[0]}" }
|
||||
let(:detection_mode) { :aggressive }
|
||||
|
||||
@@ -58,14 +58,6 @@ describe WPScan::Controller::Enumeration do
|
||||
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
|
||||
it 'contains the correct options' do
|
||||
expect(controller.cli_options.map(&:to_sym)).to eql(
|
||||
@@ -104,17 +96,6 @@ describe WPScan::Controller::Enumeration do
|
||||
|
||||
describe '#run' 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
|
||||
let(:cli_args) { "#{super()} --passwords some-file.txt" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user