From adc58412617b3dec073b2b30dec4dbdd7a8245df Mon Sep 17 00:00:00 2001 From: lp1 Date: Thu, 25 Oct 2018 18:09:04 +0200 Subject: [PATCH 1/2] Fixed too restrictive pattern matching on target.wordpress_hosted attribute --- lib/wpscan/target/platform/wordpress.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wpscan/target/platform/wordpress.rb b/lib/wpscan/target/platform/wordpress.rb index e6d88118..ba98b11b 100644 --- a/lib/wpscan/target/platform/wordpress.rb +++ b/lib/wpscan/target/platform/wordpress.rb @@ -41,7 +41,7 @@ module WPScan end def wordpress_hosted? - uri.host =~ /wordpress.com$/i ? true : false + uri.host =~ /\.wordpress\.com$/i ? true : false end # @param [ String ] username From 4afc756ccdc506e0d16885aad2aacec2fd37a23c Mon Sep 17 00:00:00 2001 From: lp1 Date: Mon, 29 Oct 2018 11:02:46 +0100 Subject: [PATCH 2/2] Added spec for the new regex --- spec/shared_examples/target/platform/wordpress.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/shared_examples/target/platform/wordpress.rb b/spec/shared_examples/target/platform/wordpress.rb index 2ada2fea..6f2ca601 100644 --- a/spec/shared_examples/target/platform/wordpress.rb +++ b/spec/shared_examples/target/platform/wordpress.rb @@ -37,5 +37,11 @@ shared_examples WPScan::Target::Platform::WordPress do its(:wordpress_hosted?) { should be true } end + + context 'when the target host doesn\'t matches' do + let(:url) { 'http://ex-wordpress.com' } + + its(:wordpress_hosted?) { should be false } + end end end