From 8c2eb63840e8fde6e7bdedf93bd370369626178c Mon Sep 17 00:00:00 2001 From: Mikica Ivosevic Date: Tue, 28 Jul 2015 12:41:09 +0200 Subject: [PATCH] update wp_target.rb Refactor if else statement - wp_content_dir (credits: ethicalhack3r) --- lib/wpscan/wp_target.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/wpscan/wp_target.rb b/lib/wpscan/wp_target.rb index 81d573bd..bd4d9e8c 100644 --- a/lib/wpscan/wp_target.rb +++ b/lib/wpscan/wp_target.rb @@ -49,11 +49,7 @@ class WpTarget < WebSite fail "The target is responding with a 403, this might be due to a WAF or a plugin.\n" \ 'You should try to supply a valid user-agent via the --user-agent option or use the --random-agent option' if response.code == 403 - if wp_content_dir - dir = wp_content_dir - else - dir = 'wp-content' - end + dir = wp_content_dir ? wp_content_dir : 'wp-content' if response.body =~ /["'][^"']*\/#{Regexp.escape(dir)}\/[^"']*["']/i wordpress = true