Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/spec/app/finders/interesting_findings/wp_cron_spec.rb
1483 views
1
# frozen_string_literal: true
2
3
describe WPScan::Finders::InterestingFindings::WPCron do
4
subject(:finder) { described_class.new(target) }
5
let(:target) { WPScan::Target.new(url) }
6
let(:url) { 'http://ex.lo/' }
7
let(:wp_content) { 'wp-content' }
8
9
before { expect(target).to receive(:sub_dir).at_least(1).and_return(false) }
10
11
describe '#aggressive' do
12
before { stub_request(:get, finder.wp_cron_url).to_return(status: status) }
13
14
context 'when 200' do
15
let(:status) { 200 }
16
17
it 'returns the InterestingFinding' do
18
expect(finder.aggressive).to eql WPScan::Model::WPCron.new(
19
finder.wp_cron_url,
20
confidence: 60,
21
found_by: described_class::DIRECT_ACCESS
22
)
23
end
24
end
25
26
context 'otherwise' do
27
let(:status) { 403 }
28
29
its(:aggressive) { should be_nil }
30
end
31
end
32
end
33
34