Updates rubocop
This commit is contained in:
@@ -7,6 +7,8 @@ AllCops:
|
||||
- 'vendor/**/*'
|
||||
Layout/LineLength:
|
||||
Max: 120
|
||||
Lint/MissingSuper:
|
||||
Enabled: false
|
||||
Lint/UriEscapeUnescape:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
@@ -24,6 +26,8 @@ Metrics/MethodLength:
|
||||
Max: 20
|
||||
Exclude:
|
||||
- 'app/controllers/enumeration/cli_options.rb'
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 11
|
||||
Style/ClassVars:
|
||||
Enabled: false
|
||||
Style/Documentation:
|
||||
@@ -33,3 +37,5 @@ Style/FormatStringToken:
|
||||
Style/NumericPredicate:
|
||||
Exclude:
|
||||
- 'app/controllers/vuln_api.rb'
|
||||
Style/OptionalBooleanParameter:
|
||||
Enabled: false
|
||||
|
||||
@@ -4,7 +4,7 @@ describe WPScan::Finders::InterestingFindings::EmergencyPwdResetScript do
|
||||
subject(:finder) { described_class.new(target) }
|
||||
let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) }
|
||||
let(:url) { 'http://ex.lo/' }
|
||||
let(:file_url) { url + 'emergency.php' }
|
||||
let(:file_url) { "#{url}emergency.php" }
|
||||
let(:fixtures) { FINDERS_FIXTURES.join('interesting_findings', 'emergency_pwd_reset_script') }
|
||||
|
||||
before do
|
||||
|
||||
@@ -4,7 +4,7 @@ describe WPScan::Finders::InterestingFindings::UploadSQLDump do
|
||||
subject(:finder) { described_class.new(target) }
|
||||
let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) }
|
||||
let(:url) { 'http://ex.lo/' }
|
||||
let(:dump_url) { url + 'wp-content/uploads/dump.sql' }
|
||||
let(:dump_url) { "#{url}wp-content/uploads/dump.sql" }
|
||||
let(:fixtures) { FINDERS_FIXTURES.join('interesting_findings', 'upload_sql_dump') }
|
||||
let(:wp_content) { 'wp-content' }
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ describe WPScan::Finders::Medias::AttachmentBruteForcing do
|
||||
describe '#target_urls' do
|
||||
it 'returns the expected urls' do
|
||||
expect(finder.target_urls(range: (1..2))).to eql(
|
||||
url + '?attachment_id=1' => 1,
|
||||
url + '?attachment_id=2' => 2
|
||||
"#{url}?attachment_id=1" => 1,
|
||||
"#{url}?attachment_id=2" => 2
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,8 +13,8 @@ describe WPScan::Finders::Users::AuthorIdBruteForcing do
|
||||
describe '#target_urls' do
|
||||
it 'returns the correct URLs' do
|
||||
expect(finder.target_urls(range: (1..2))).to eql(
|
||||
url + '?author=1' => 1,
|
||||
url + '?author=2' => 2
|
||||
"#{url}?author=1" => 1,
|
||||
"#{url}?author=2" => 2
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ describe WPScan::Finders::WpVersion::Readme do
|
||||
let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) }
|
||||
let(:url) { 'http://ex.lo/' }
|
||||
let(:fixtures) { FINDERS_FIXTURES.join('wp_version', 'readme') }
|
||||
let(:readme_url) { url + 'readme.html' }
|
||||
let(:readme_url) { "#{url}readme.html" }
|
||||
|
||||
describe '#aggressive' do
|
||||
before { stub_request(:get, readme_url).to_return(body: File.read(fixtures.join(file))) }
|
||||
|
||||
@@ -81,7 +81,7 @@ WPScan::DB::DynamicFinders::Plugin.versions_finders_configs.each do |slug, confi
|
||||
found.each_with_index do |version, index|
|
||||
expected_version = expected.at(index)
|
||||
expected_ie = expected_version['interesting_entries'].map do |ie|
|
||||
ie.gsub(target.url + ',', ie_url + ',')
|
||||
ie.gsub("#{target.url},", "#{ie_url},")
|
||||
end
|
||||
|
||||
expect(version).to be_a WPScan::Model::Version
|
||||
@@ -111,7 +111,7 @@ WPScan::DB::DynamicFinders::Plugin.versions_finders_configs.each do |slug, confi
|
||||
found.each_with_index do |version, index|
|
||||
expected_version = expected.at(index)
|
||||
expected_ie = expected_version['interesting_entries'].map do |ie|
|
||||
ie.gsub(target.url + ',', ie_url + ',')
|
||||
ie.gsub("#{target.url},", "#{ie_url},")
|
||||
end
|
||||
|
||||
expect(version).to be_a WPScan::Model::Version
|
||||
|
||||
@@ -86,7 +86,7 @@ WPScan::DB::DynamicFinders::Theme.versions_finders_configs.each do |slug, config
|
||||
found.each_with_index do |version, index|
|
||||
expected_version = expected.at(index)
|
||||
expected_ie = expected_version['interesting_entries'].map do |ie|
|
||||
ie.gsub(target.url + ',', ie_url + ',')
|
||||
ie.gsub("#{target.url},", "#{ie_url},")
|
||||
end
|
||||
|
||||
expect(version).to be_a WPScan::Model::Version
|
||||
@@ -116,7 +116,7 @@ WPScan::DB::DynamicFinders::Theme.versions_finders_configs.each do |slug, config
|
||||
found.each_with_index do |version, index|
|
||||
expected_version = expected.at(index)
|
||||
expected_ie = expected_version['interesting_entries'].map do |ie|
|
||||
ie.gsub(target.url + ',', ie_url + ',')
|
||||
ie.gsub("#{target.url},", "#{ie_url},")
|
||||
end
|
||||
|
||||
expect(version).to be_a WPScan::Model::Version
|
||||
|
||||
@@ -100,7 +100,7 @@ shared_examples 'WordPress::CustomDirectories' do
|
||||
before { target.content_dir = dir }
|
||||
|
||||
its(:content_dir) { should eq dir.chomp('/') }
|
||||
its(:plugins_dir) { should eq dir.chomp('/') + '/plugins' }
|
||||
its(:plugins_dir) { should eq "#{dir.chomp('/')}/plugins" }
|
||||
end
|
||||
|
||||
context "when content_dir = #{dir} and plugins_dir = #{dir}" do
|
||||
|
||||
@@ -14,8 +14,8 @@ shared_examples 'App::Views::Enumeration::Medias' do
|
||||
end
|
||||
|
||||
context 'when medias found' do
|
||||
let(:m1) { media.new(target_url + '?attachment_id=1', found_by: 'Attachment Brute Forcing') }
|
||||
let(:m2) { media.new(target_url + '?attachment_id=5', found_by: 'Attachment Brute Forcing') }
|
||||
let(:m1) { media.new("#{target_url}?attachment_id=1", found_by: 'Attachment Brute Forcing') }
|
||||
let(:m2) { media.new("#{target_url}?attachment_id=5", found_by: 'Attachment Brute Forcing') }
|
||||
let(:medias) { [m1, m2] }
|
||||
let(:expected_view) { File.join(view, 'medias') }
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ shared_examples 'App::Views::Enumeration::Timthumbs' do
|
||||
end
|
||||
|
||||
context 'when timthumbs found' do
|
||||
let(:tt) { timthumb.new(target_url + 'tt.php', found_by: 'Known Locations') }
|
||||
let(:tt2) { timthumb.new(target_url + 'tt2.php', found_by: 'Known Locations') }
|
||||
let(:tt) { timthumb.new("#{target_url}tt.php", found_by: 'Known Locations') }
|
||||
let(:tt2) { timthumb.new("#{target_url}tt2.php", found_by: 'Known Locations') }
|
||||
let(:timthumbs) { [tt, tt2] }
|
||||
|
||||
context 'when not vulnerable' do
|
||||
|
||||
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
||||
s.add_development_dependency 'rake', '~> 13.0'
|
||||
s.add_development_dependency 'rspec', '~> 3.9.0'
|
||||
s.add_development_dependency 'rspec-its', '~> 1.3.0'
|
||||
s.add_development_dependency 'rubocop', '~> 0.88.0'
|
||||
s.add_development_dependency 'rubocop', '~> 0.89.0'
|
||||
s.add_development_dependency 'rubocop-performance', '~> 1.7.0'
|
||||
s.add_development_dependency 'simplecov', '~> 0.18.2'
|
||||
s.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
|
||||
|
||||
Reference in New Issue
Block a user