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