Checks if the wp-login.php is available before attacking it - Fixes #1519

This commit is contained in:
erwanlr
2020-07-16 10:22:45 +02:00
parent 97c995b64c
commit ff574b046c
5 changed files with 75 additions and 19 deletions

View File

@@ -246,6 +246,12 @@ shared_examples WPScan::Target::Platform::WordPress do
its(:login_url) { should eql target.url('wp-login.php') }
end
context 'when a 404' do
before { stub_request(:get, target.url('wp-login.php')).to_return(status: 404) }
its(:login_url) { should eql false }
end
context 'when a redirection occured' do
before do
expect(WPScan::Browser).to receive(:get_and_follow_location)