Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.9.0 #1637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

3.9.0 #1637

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/controllers/aliases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ module Controller
class Aliases < CMSScanner::Controller::Base
def cli_options
[
OptAlias.new(['--stealthy'],
alias_for: '--random-user-agent --detection-mode passive --plugins-version-detection passive')
OptAlias.new(['--stealthy'], alias_for: '--random-user-agent --detection-mode passive')
]
end
end
Expand Down
7 changes: 3 additions & 4 deletions app/controllers/enumeration/cli_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def cli_enum_choices
value_if_empty: '1-100')
},
value_if_empty: 'vp,vt,tt,cb,dbe,u,m',
incompatible: [%i[vp ap p], %i[vt at t]],
default: { all_plugins: true, config_backups: true }
incompatible: [%i[vp ap p], %i[vt at t]]
),
OptRegexp.new(
[
Expand All @@ -52,7 +51,7 @@ def cli_plugins_opts
OptChoice.new(
['--plugins-detection MODE',
'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(
['--plugins-version-all',
Expand All @@ -63,7 +62,7 @@ def cli_plugins_opts
OptChoice.new(
['--plugins-version-detection MODE',
'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(
['--plugins-threshold THRESHOLD',
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/enumeration/enum_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def enum_users
# 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
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
Expand Down
2 changes: 1 addition & 1 deletion lib/wpscan/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Version
module WPScan
VERSION = '3.8.17'
VERSION = '3.9.0-dev'
end
8 changes: 2 additions & 6 deletions spec/app/controllers/aliases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@
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

context 'when --stealthy supplied' 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
Expand Down
25 changes: 3 additions & 22 deletions spec/app/controllers/enumeration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
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
@expected = "Enumerating Vulnerable #{type.capitalize} (via Passive and Aggressive Methods)"
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 }

Expand All @@ -46,7 +46,7 @@
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 }

Expand All @@ -58,14 +58,6 @@
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(
Expand Down Expand Up @@ -104,17 +96,6 @@

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" }

Expand Down