diff --git a/.rubocop.yml b/.rubocop.yml index 6d8218d1..d4b34b0a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -22,7 +22,5 @@ Metrics/CyclomaticComplexity: Max: 8 Style/Documentation: Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false Style/FormatStringToken: Enabled: false diff --git a/Gemfile b/Gemfile index 851fabc2..5f10ba8c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,4 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff --git a/app/app.rb b/app/app.rb index a703f64d..d3f49221 100644 --- a/app/app.rb +++ b/app/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'models' require_relative 'finders' require_relative 'controllers' diff --git a/app/controllers.rb b/app/controllers.rb index 1300ecd9..cd1ff486 100644 --- a/app/controllers.rb +++ b/app/controllers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'controllers/core' require_relative 'controllers/custom_directories' require_relative 'controllers/wp_version' diff --git a/app/controllers/aliases.rb b/app/controllers/aliases.rb index 2f9c58a6..15087131 100644 --- a/app/controllers/aliases.rb +++ b/app/controllers/aliases.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Controller to add the aliases in the CLI diff --git a/app/controllers/core.rb b/app/controllers/core.rb index a4927e0c..d9090b97 100644 --- a/app/controllers/core.rb +++ b/app/controllers/core.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Specific Core controller to include WordPress checks diff --git a/app/controllers/custom_directories.rb b/app/controllers/custom_directories.rb index 812aad53..1e956a5c 100644 --- a/app/controllers/custom_directories.rb +++ b/app/controllers/custom_directories.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Controller to ensure that the wp-content and wp-plugins diff --git a/app/controllers/enumeration.rb b/app/controllers/enumeration.rb index 7d8aa6ea..8a5abe6c 100644 --- a/app/controllers/enumeration.rb +++ b/app/controllers/enumeration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'enumeration/cli_options' require_relative 'enumeration/enum_methods' diff --git a/app/controllers/enumeration/cli_options.rb b/app/controllers/enumeration/cli_options.rb index 20032333..37ea4d7c 100644 --- a/app/controllers/enumeration/cli_options.rb +++ b/app/controllers/enumeration/cli_options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Enumeration CLI Options diff --git a/app/controllers/enumeration/enum_methods.rb b/app/controllers/enumeration/enum_methods.rb index b6187d7b..1bf6158e 100644 --- a/app/controllers/enumeration/enum_methods.rb +++ b/app/controllers/enumeration/enum_methods.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Enumeration Methods diff --git a/app/controllers/main_theme.rb b/app/controllers/main_theme.rb index 11f3c576..f3c0ce7b 100644 --- a/app/controllers/main_theme.rb +++ b/app/controllers/main_theme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Main Theme Controller diff --git a/app/controllers/password_attack.rb b/app/controllers/password_attack.rb index f7890a3f..4749f864 100644 --- a/app/controllers/password_attack.rb +++ b/app/controllers/password_attack.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Password Attack Controller diff --git a/app/controllers/wp_version.rb b/app/controllers/wp_version.rb index 5ea409c7..7e28d5f8 100644 --- a/app/controllers/wp_version.rb +++ b/app/controllers/wp_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Controller # Wp Version Controller diff --git a/app/finders.rb b/app/finders.rb index 002bd1d0..079e93d4 100644 --- a/app/finders.rb +++ b/app/finders.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'finders/interesting_findings' require_relative 'finders/wp_items' require_relative 'finders/wp_version' diff --git a/app/finders/config_backups.rb b/app/finders/config_backups.rb index 0afd2a16..1cf40659 100644 --- a/app/finders/config_backups.rb +++ b/app/finders/config_backups.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'config_backups/known_filenames' module WPScan diff --git a/app/finders/config_backups/known_filenames.rb b/app/finders/config_backups/known_filenames.rb index 54319441..deace44f 100644 --- a/app/finders/config_backups/known_filenames.rb +++ b/app/finders/config_backups/known_filenames.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module ConfigBackups diff --git a/app/finders/db_exports.rb b/app/finders/db_exports.rb index 8edccddb..3f5d78ee 100644 --- a/app/finders/db_exports.rb +++ b/app/finders/db_exports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'db_exports/known_locations' module WPScan diff --git a/app/finders/db_exports/known_locations.rb b/app/finders/db_exports/known_locations.rb index 8809bb53..6da23395 100644 --- a/app/finders/db_exports/known_locations.rb +++ b/app/finders/db_exports/known_locations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DbExports diff --git a/app/finders/interesting_findings.rb b/app/finders/interesting_findings.rb index a68e499f..fd0c91ed 100644 --- a/app/finders/interesting_findings.rb +++ b/app/finders/interesting_findings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'interesting_findings/readme' require_relative 'interesting_findings/wp_cron' require_relative 'interesting_findings/multisite' diff --git a/app/finders/interesting_findings/backup_db.rb b/app/finders/interesting_findings/backup_db.rb index 5b6e6fb6..7e742143 100644 --- a/app/finders/interesting_findings/backup_db.rb +++ b/app/finders/interesting_findings/backup_db.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/debug_log.rb b/app/finders/interesting_findings/debug_log.rb index aa581500..45d6c4a1 100644 --- a/app/finders/interesting_findings/debug_log.rb +++ b/app/finders/interesting_findings/debug_log.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/duplicator_installer_log.rb b/app/finders/interesting_findings/duplicator_installer_log.rb index e96966bf..c84dfc04 100644 --- a/app/finders/interesting_findings/duplicator_installer_log.rb +++ b/app/finders/interesting_findings/duplicator_installer_log.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/emergency_pwd_reset_script.rb b/app/finders/interesting_findings/emergency_pwd_reset_script.rb index 0f36b273..4f37c2e8 100644 --- a/app/finders/interesting_findings/emergency_pwd_reset_script.rb +++ b/app/finders/interesting_findings/emergency_pwd_reset_script.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/full_path_disclosure.rb b/app/finders/interesting_findings/full_path_disclosure.rb index 4c4463df..50c45a92 100644 --- a/app/finders/interesting_findings/full_path_disclosure.rb +++ b/app/finders/interesting_findings/full_path_disclosure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/mu_plugins.rb b/app/finders/interesting_findings/mu_plugins.rb index f4e2da4e..fc5db708 100644 --- a/app/finders/interesting_findings/mu_plugins.rb +++ b/app/finders/interesting_findings/mu_plugins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/multisite.rb b/app/finders/interesting_findings/multisite.rb index 0c2d02f6..e55d160e 100644 --- a/app/finders/interesting_findings/multisite.rb +++ b/app/finders/interesting_findings/multisite.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/readme.rb b/app/finders/interesting_findings/readme.rb index c742ed3b..d5436569 100644 --- a/app/finders/interesting_findings/readme.rb +++ b/app/finders/interesting_findings/readme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/registration.rb b/app/finders/interesting_findings/registration.rb index df9c206f..0fb693cf 100644 --- a/app/finders/interesting_findings/registration.rb +++ b/app/finders/interesting_findings/registration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/tmm_db_migrate.rb b/app/finders/interesting_findings/tmm_db_migrate.rb index fa649f2b..c1008dda 100644 --- a/app/finders/interesting_findings/tmm_db_migrate.rb +++ b/app/finders/interesting_findings/tmm_db_migrate.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/upload_directory_listing.rb b/app/finders/interesting_findings/upload_directory_listing.rb index 8fbfce37..f74be93c 100644 --- a/app/finders/interesting_findings/upload_directory_listing.rb +++ b/app/finders/interesting_findings/upload_directory_listing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/upload_sql_dump.rb b/app/finders/interesting_findings/upload_sql_dump.rb index b7a9dd84..94a1d2cd 100644 --- a/app/finders/interesting_findings/upload_sql_dump.rb +++ b/app/finders/interesting_findings/upload_sql_dump.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/interesting_findings/wp_cron.rb b/app/finders/interesting_findings/wp_cron.rb index 1e2ef342..53e5f588 100644 --- a/app/finders/interesting_findings/wp_cron.rb +++ b/app/finders/interesting_findings/wp_cron.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module InterestingFindings diff --git a/app/finders/main_theme.rb b/app/finders/main_theme.rb index b28a1937..d353d451 100644 --- a/app/finders/main_theme.rb +++ b/app/finders/main_theme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'main_theme/css_style' require_relative 'main_theme/woo_framework_meta_generator' require_relative 'main_theme/urls_in_homepage' diff --git a/app/finders/main_theme/css_style.rb b/app/finders/main_theme/css_style.rb index f4329e68..dbf50a0e 100644 --- a/app/finders/main_theme/css_style.rb +++ b/app/finders/main_theme/css_style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module MainTheme diff --git a/app/finders/main_theme/urls_in_homepage.rb b/app/finders/main_theme/urls_in_homepage.rb index 86a5b264..b424d2ff 100644 --- a/app/finders/main_theme/urls_in_homepage.rb +++ b/app/finders/main_theme/urls_in_homepage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module MainTheme diff --git a/app/finders/main_theme/woo_framework_meta_generator.rb b/app/finders/main_theme/woo_framework_meta_generator.rb index 81586c18..427dc83c 100644 --- a/app/finders/main_theme/woo_framework_meta_generator.rb +++ b/app/finders/main_theme/woo_framework_meta_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module MainTheme diff --git a/app/finders/medias.rb b/app/finders/medias.rb index 80b2ec7c..235ebb06 100644 --- a/app/finders/medias.rb +++ b/app/finders/medias.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'medias/attachment_brute_forcing' module WPScan diff --git a/app/finders/medias/attachment_brute_forcing.rb b/app/finders/medias/attachment_brute_forcing.rb index 6c19edb3..f9419ea4 100644 --- a/app/finders/medias/attachment_brute_forcing.rb +++ b/app/finders/medias/attachment_brute_forcing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Medias diff --git a/app/finders/passwords.rb b/app/finders/passwords.rb index d1432766..1d9c531f 100644 --- a/app/finders/passwords.rb +++ b/app/finders/passwords.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'passwords/wp_login' require_relative 'passwords/xml_rpc' require_relative 'passwords/xml_rpc_multicall' diff --git a/app/finders/passwords/wp_login.rb b/app/finders/passwords/wp_login.rb index 6f8c274d..39ea86fa 100644 --- a/app/finders/passwords/wp_login.rb +++ b/app/finders/passwords/wp_login.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Passwords diff --git a/app/finders/passwords/xml_rpc.rb b/app/finders/passwords/xml_rpc.rb index 0f28252e..1e50317d 100644 --- a/app/finders/passwords/xml_rpc.rb +++ b/app/finders/passwords/xml_rpc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Passwords diff --git a/app/finders/passwords/xml_rpc_multicall.rb b/app/finders/passwords/xml_rpc_multicall.rb index c1536204..e66b4fc6 100644 --- a/app/finders/passwords/xml_rpc_multicall.rb +++ b/app/finders/passwords/xml_rpc_multicall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Passwords diff --git a/app/finders/plugin_version.rb b/app/finders/plugin_version.rb index 274c3135..77c48d52 100644 --- a/app/finders/plugin_version.rb +++ b/app/finders/plugin_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'plugin_version/readme' module WPScan diff --git a/app/finders/plugin_version/readme.rb b/app/finders/plugin_version/readme.rb index b9db2b62..d703414d 100644 --- a/app/finders/plugin_version/readme.rb +++ b/app/finders/plugin_version/readme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module PluginVersion diff --git a/app/finders/plugins.rb b/app/finders/plugins.rb index 7fa347e9..2efc8e74 100644 --- a/app/finders/plugins.rb +++ b/app/finders/plugins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'plugins/urls_in_homepage' require_relative 'plugins/known_locations' # From the DynamicFinders diff --git a/app/finders/plugins/body_pattern.rb b/app/finders/plugins/body_pattern.rb index edbe5d99..8d11b50b 100644 --- a/app/finders/plugins/body_pattern.rb +++ b/app/finders/plugins/body_pattern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/comment.rb b/app/finders/plugins/comment.rb index fbe9444e..05d69d90 100644 --- a/app/finders/plugins/comment.rb +++ b/app/finders/plugins/comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/config_parser.rb b/app/finders/plugins/config_parser.rb index 6a7e8d4c..35882508 100644 --- a/app/finders/plugins/config_parser.rb +++ b/app/finders/plugins/config_parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/header_pattern.rb b/app/finders/plugins/header_pattern.rb index 6b90a0ae..cf2b6764 100644 --- a/app/finders/plugins/header_pattern.rb +++ b/app/finders/plugins/header_pattern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/javascript_var.rb b/app/finders/plugins/javascript_var.rb index 83caefbc..773f42c2 100644 --- a/app/finders/plugins/javascript_var.rb +++ b/app/finders/plugins/javascript_var.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/known_locations.rb b/app/finders/plugins/known_locations.rb index 63cfc347..92c75b5c 100644 --- a/app/finders/plugins/known_locations.rb +++ b/app/finders/plugins/known_locations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/query_parameter.rb b/app/finders/plugins/query_parameter.rb index 15d29279..da2ff7a2 100644 --- a/app/finders/plugins/query_parameter.rb +++ b/app/finders/plugins/query_parameter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/urls_in_homepage.rb b/app/finders/plugins/urls_in_homepage.rb index 0b0e2d9a..22334f9f 100644 --- a/app/finders/plugins/urls_in_homepage.rb +++ b/app/finders/plugins/urls_in_homepage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/plugins/xpath.rb b/app/finders/plugins/xpath.rb index 76cb80fb..fdddb4b9 100644 --- a/app/finders/plugins/xpath.rb +++ b/app/finders/plugins/xpath.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Plugins diff --git a/app/finders/theme_version.rb b/app/finders/theme_version.rb index ef126688..3e870386 100644 --- a/app/finders/theme_version.rb +++ b/app/finders/theme_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'theme_version/style' require_relative 'theme_version/woo_framework_meta_generator' diff --git a/app/finders/theme_version/style.rb b/app/finders/theme_version/style.rb index 55015369..4362ac6c 100644 --- a/app/finders/theme_version/style.rb +++ b/app/finders/theme_version/style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module ThemeVersion diff --git a/app/finders/theme_version/woo_framework_meta_generator.rb b/app/finders/theme_version/woo_framework_meta_generator.rb index 75124c5d..ef8e8433 100644 --- a/app/finders/theme_version/woo_framework_meta_generator.rb +++ b/app/finders/theme_version/woo_framework_meta_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module ThemeVersion diff --git a/app/finders/themes.rb b/app/finders/themes.rb index 738b223d..95cedffe 100644 --- a/app/finders/themes.rb +++ b/app/finders/themes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'themes/urls_in_homepage' require_relative 'themes/known_locations' diff --git a/app/finders/themes/known_locations.rb b/app/finders/themes/known_locations.rb index 11bd4549..a36d3cc8 100644 --- a/app/finders/themes/known_locations.rb +++ b/app/finders/themes/known_locations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Themes diff --git a/app/finders/themes/urls_in_homepage.rb b/app/finders/themes/urls_in_homepage.rb index 7354b713..4709bba0 100644 --- a/app/finders/themes/urls_in_homepage.rb +++ b/app/finders/themes/urls_in_homepage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Themes diff --git a/app/finders/timthumb_version.rb b/app/finders/timthumb_version.rb index 9571a1ee..a87445a0 100644 --- a/app/finders/timthumb_version.rb +++ b/app/finders/timthumb_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'timthumb_version/bad_request' module WPScan diff --git a/app/finders/timthumb_version/bad_request.rb b/app/finders/timthumb_version/bad_request.rb index b0e81de3..20f0f936 100644 --- a/app/finders/timthumb_version/bad_request.rb +++ b/app/finders/timthumb_version/bad_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module TimthumbVersion diff --git a/app/finders/timthumbs.rb b/app/finders/timthumbs.rb index a6271501..54009abb 100644 --- a/app/finders/timthumbs.rb +++ b/app/finders/timthumbs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'timthumbs/known_locations' module WPScan diff --git a/app/finders/timthumbs/known_locations.rb b/app/finders/timthumbs/known_locations.rb index 5935a30c..ba995157 100644 --- a/app/finders/timthumbs/known_locations.rb +++ b/app/finders/timthumbs/known_locations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Timthumbs diff --git a/app/finders/users.rb b/app/finders/users.rb index f9d5cbdc..9a520ddd 100644 --- a/app/finders/users.rb +++ b/app/finders/users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'users/author_posts' require_relative 'users/wp_json_api' require_relative 'users/oembed_api' diff --git a/app/finders/users/author_id_brute_forcing.rb b/app/finders/users/author_id_brute_forcing.rb index 20cb0789..725a7190 100644 --- a/app/finders/users/author_id_brute_forcing.rb +++ b/app/finders/users/author_id_brute_forcing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/users/author_posts.rb b/app/finders/users/author_posts.rb index fb427e21..61968d9c 100644 --- a/app/finders/users/author_posts.rb +++ b/app/finders/users/author_posts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/users/login_error_messages.rb b/app/finders/users/login_error_messages.rb index 148dee3f..4c0ef2ae 100644 --- a/app/finders/users/login_error_messages.rb +++ b/app/finders/users/login_error_messages.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/users/oembed_api.rb b/app/finders/users/oembed_api.rb index 13011158..ebe2eb13 100644 --- a/app/finders/users/oembed_api.rb +++ b/app/finders/users/oembed_api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/users/rss_generator.rb b/app/finders/users/rss_generator.rb index 97175bbf..1ee05361 100644 --- a/app/finders/users/rss_generator.rb +++ b/app/finders/users/rss_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/users/wp_json_api.rb b/app/finders/users/wp_json_api.rb index b78f038c..4affa32c 100644 --- a/app/finders/users/wp_json_api.rb +++ b/app/finders/users/wp_json_api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/users/yoast_seo_author_sitemap.rb b/app/finders/users/yoast_seo_author_sitemap.rb index 3bd2ac9f..55023ffa 100644 --- a/app/finders/users/yoast_seo_author_sitemap.rb +++ b/app/finders/users/yoast_seo_author_sitemap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module Users diff --git a/app/finders/wp_items.rb b/app/finders/wp_items.rb index 2e55f506..ded84746 100644 --- a/app/finders/wp_items.rb +++ b/app/finders/wp_items.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require_relative 'wp_items/urls_in_homepage' diff --git a/app/finders/wp_items/urls_in_homepage.rb b/app/finders/wp_items/urls_in_homepage.rb index 1f79e368..f69586d3 100644 --- a/app/finders/wp_items/urls_in_homepage.rb +++ b/app/finders/wp_items/urls_in_homepage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module WpItems diff --git a/app/finders/wp_version.rb b/app/finders/wp_version.rb index 44f0771d..5ed4719f 100644 --- a/app/finders/wp_version.rb +++ b/app/finders/wp_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'wp_version/rss_generator' require_relative 'wp_version/atom_generator' require_relative 'wp_version/rdf_generator' diff --git a/app/finders/wp_version/atom_generator.rb b/app/finders/wp_version/atom_generator.rb index 2267be55..e1357cf9 100644 --- a/app/finders/wp_version/atom_generator.rb +++ b/app/finders/wp_version/atom_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module WpVersion diff --git a/app/finders/wp_version/rdf_generator.rb b/app/finders/wp_version/rdf_generator.rb index 2a5b6e66..8a4e0f4f 100644 --- a/app/finders/wp_version/rdf_generator.rb +++ b/app/finders/wp_version/rdf_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module WpVersion diff --git a/app/finders/wp_version/readme.rb b/app/finders/wp_version/readme.rb index 26c62474..f40a8eee 100644 --- a/app/finders/wp_version/readme.rb +++ b/app/finders/wp_version/readme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module WpVersion diff --git a/app/finders/wp_version/rss_generator.rb b/app/finders/wp_version/rss_generator.rb index 0ea2effa..a92e0cb6 100644 --- a/app/finders/wp_version/rss_generator.rb +++ b/app/finders/wp_version/rss_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module WpVersion diff --git a/app/finders/wp_version/unique_fingerprinting.rb b/app/finders/wp_version/unique_fingerprinting.rb index 72c12aee..1eea532a 100644 --- a/app/finders/wp_version/unique_fingerprinting.rb +++ b/app/finders/wp_version/unique_fingerprinting.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module WpVersion diff --git a/app/models.rb b/app/models.rb index 4e8c008e..69e7395a 100644 --- a/app/models.rb +++ b/app/models.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model include CMSScanner::Model diff --git a/app/models/config_backup.rb b/app/models/config_backup.rb index e40161a3..7a54502a 100644 --- a/app/models/config_backup.rb +++ b/app/models/config_backup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # Config Backup diff --git a/app/models/db_export.rb b/app/models/db_export.rb index bde67da3..c983d2fd 100644 --- a/app/models/db_export.rb +++ b/app/models/db_export.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # DB Export diff --git a/app/models/interesting_finding.rb b/app/models/interesting_finding.rb index 848e8f72..61e44da6 100644 --- a/app/models/interesting_finding.rb +++ b/app/models/interesting_finding.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # Custom class to include the WPScan::References module diff --git a/app/models/media.rb b/app/models/media.rb index ef91ca4f..9d4e0cb7 100644 --- a/app/models/media.rb +++ b/app/models/media.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # Media diff --git a/app/models/plugin.rb b/app/models/plugin.rb index 1d7a16f6..0d854984 100644 --- a/app/models/plugin.rb +++ b/app/models/plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # WordPress Plugin diff --git a/app/models/theme.rb b/app/models/theme.rb index 06e88783..c5fe28a2 100644 --- a/app/models/theme.rb +++ b/app/models/theme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # WordPress Theme diff --git a/app/models/timthumb.rb b/app/models/timthumb.rb index 566c2e89..a4973752 100644 --- a/app/models/timthumb.rb +++ b/app/models/timthumb.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # Timthumb diff --git a/app/models/wp_item.rb b/app/models/wp_item.rb index f8d73032..fed847a4 100644 --- a/app/models/wp_item.rb +++ b/app/models/wp_item.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # WpItem (superclass of Plugin & Theme) diff --git a/app/models/wp_version.rb b/app/models/wp_version.rb index ba8ae63c..3cca1df3 100644 --- a/app/models/wp_version.rb +++ b/app/models/wp_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # WP Version diff --git a/app/models/xml_rpc.rb b/app/models/xml_rpc.rb index 97d2cdfc..0c065194 100644 --- a/app/models/xml_rpc.rb +++ b/app/models/xml_rpc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Model # Override of the CMSScanner::XMLRPC to include the references diff --git a/bin/wpscan b/bin/wpscan index ad10feae..b4f2d680 100755 --- a/bin/wpscan +++ b/bin/wpscan @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'wpscan' diff --git a/lib/wpscan.rb b/lib/wpscan.rb index 78f1345c..4229d7a2 100644 --- a/lib/wpscan.rb +++ b/lib/wpscan.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Gems # Believe it or not, active_support MUST be the first one, # otherwise encoding issues can happen when using JSON format. diff --git a/lib/wpscan/browser.rb b/lib/wpscan/browser.rb index 7bb07fb1..715b2bac 100644 --- a/lib/wpscan/browser.rb +++ b/lib/wpscan/browser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan # Custom Browser class Browser < CMSScanner::Browser diff --git a/lib/wpscan/controller.rb b/lib/wpscan/controller.rb index 1bd70fa4..7913c7d1 100644 --- a/lib/wpscan/controller.rb +++ b/lib/wpscan/controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan # Needed to load at least the Core controller # Otherwise, the following error will be raised: diff --git a/lib/wpscan/controllers.rb b/lib/wpscan/controllers.rb index 166c3759..97e3173e 100644 --- a/lib/wpscan/controllers.rb +++ b/lib/wpscan/controllers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan # Override to set the OptParser's summary width to 45 (instead of 40 from the CMSScanner) class Controllers < CMSScanner::Controllers diff --git a/lib/wpscan/db.rb b/lib/wpscan/db.rb index a6542ff2..e0e82783 100644 --- a/lib/wpscan/db.rb +++ b/lib/wpscan/db.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'db/wp_item' require_relative 'db/updater' require_relative 'db/wp_items' diff --git a/lib/wpscan/db/dynamic_finders/base.rb b/lib/wpscan/db/dynamic_finders/base.rb index 3844ea50..e4203688 100644 --- a/lib/wpscan/db/dynamic_finders/base.rb +++ b/lib/wpscan/db/dynamic_finders/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB module DynamicFinders diff --git a/lib/wpscan/db/dynamic_finders/plugin.rb b/lib/wpscan/db/dynamic_finders/plugin.rb index 16e25a95..9aaf8379 100644 --- a/lib/wpscan/db/dynamic_finders/plugin.rb +++ b/lib/wpscan/db/dynamic_finders/plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB module DynamicFinders diff --git a/lib/wpscan/db/dynamic_finders/theme.rb b/lib/wpscan/db/dynamic_finders/theme.rb index cc8d1f5a..8d8d9d4e 100644 --- a/lib/wpscan/db/dynamic_finders/theme.rb +++ b/lib/wpscan/db/dynamic_finders/theme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB module DynamicFinders diff --git a/lib/wpscan/db/dynamic_finders/wordpress.rb b/lib/wpscan/db/dynamic_finders/wordpress.rb index b47149d4..8896453f 100644 --- a/lib/wpscan/db/dynamic_finders/wordpress.rb +++ b/lib/wpscan/db/dynamic_finders/wordpress.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB module DynamicFinders diff --git a/lib/wpscan/db/fingerprints.rb b/lib/wpscan/db/fingerprints.rb index ef46c6b9..5e274179 100644 --- a/lib/wpscan/db/fingerprints.rb +++ b/lib/wpscan/db/fingerprints.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # Fingerprints class diff --git a/lib/wpscan/db/plugin.rb b/lib/wpscan/db/plugin.rb index 984980e9..62cd3628 100644 --- a/lib/wpscan/db/plugin.rb +++ b/lib/wpscan/db/plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # Plugin DB diff --git a/lib/wpscan/db/plugins.rb b/lib/wpscan/db/plugins.rb index ae70b46d..f8472ca3 100644 --- a/lib/wpscan/db/plugins.rb +++ b/lib/wpscan/db/plugins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # WP Plugins diff --git a/lib/wpscan/db/theme.rb b/lib/wpscan/db/theme.rb index 59646e69..9d919414 100644 --- a/lib/wpscan/db/theme.rb +++ b/lib/wpscan/db/theme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # Theme DB diff --git a/lib/wpscan/db/themes.rb b/lib/wpscan/db/themes.rb index 27eab10a..1eeb4aef 100644 --- a/lib/wpscan/db/themes.rb +++ b/lib/wpscan/db/themes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # WP Themes diff --git a/lib/wpscan/db/updater.rb b/lib/wpscan/db/updater.rb index 568158e4..9575d45b 100644 --- a/lib/wpscan/db/updater.rb +++ b/lib/wpscan/db/updater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # Class used to perform DB updates diff --git a/lib/wpscan/db/wp_item.rb b/lib/wpscan/db/wp_item.rb index a5d93bff..3ac34ac6 100644 --- a/lib/wpscan/db/wp_item.rb +++ b/lib/wpscan/db/wp_item.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # WpItem - super DB class for Plugin, Theme and Version diff --git a/lib/wpscan/db/wp_items.rb b/lib/wpscan/db/wp_items.rb index b7e08337..0cf4984c 100644 --- a/lib/wpscan/db/wp_items.rb +++ b/lib/wpscan/db/wp_items.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # WP Items diff --git a/lib/wpscan/db/wp_version.rb b/lib/wpscan/db/wp_version.rb index c74b3ad1..c03a74b4 100644 --- a/lib/wpscan/db/wp_version.rb +++ b/lib/wpscan/db/wp_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module DB # WP Version diff --git a/lib/wpscan/errors.rb b/lib/wpscan/errors.rb index 780456eb..08469ba9 100644 --- a/lib/wpscan/errors.rb +++ b/lib/wpscan/errors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Error include CMSScanner::Error diff --git a/lib/wpscan/errors/http.rb b/lib/wpscan/errors/http.rb index 55c67634..a18236fc 100644 --- a/lib/wpscan/errors/http.rb +++ b/lib/wpscan/errors/http.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Error # HTTP Error diff --git a/lib/wpscan/errors/update.rb b/lib/wpscan/errors/update.rb index f02d7a9c..f20e5dc4 100644 --- a/lib/wpscan/errors/update.rb +++ b/lib/wpscan/errors/update.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Error # Error raised when there is a missing DB file and --no-update supplied diff --git a/lib/wpscan/errors/wordpress.rb b/lib/wpscan/errors/wordpress.rb index fccc7b1e..16cc4c86 100644 --- a/lib/wpscan/errors/wordpress.rb +++ b/lib/wpscan/errors/wordpress.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Error # WordPress hosted (*.wordpress.com) diff --git a/lib/wpscan/errors/xmlrpc.rb b/lib/wpscan/errors/xmlrpc.rb index 0623c617..af68828c 100644 --- a/lib/wpscan/errors/xmlrpc.rb +++ b/lib/wpscan/errors/xmlrpc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Error # XML-RPC Not Detected diff --git a/lib/wpscan/finders.rb b/lib/wpscan/finders.rb index c191f5f6..224920bd 100644 --- a/lib/wpscan/finders.rb +++ b/lib/wpscan/finders.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'wpscan/finders/finder/wp_version/smart_url_checker' require 'wpscan/finders/dynamic_finder/finder' diff --git a/lib/wpscan/finders/dynamic_finder/finder.rb b/lib/wpscan/finders/dynamic_finder/finder.rb index 8d419bb2..60c42f94 100644 --- a/lib/wpscan/finders/dynamic_finder/finder.rb +++ b/lib/wpscan/finders/dynamic_finder/finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/body_pattern.rb b/lib/wpscan/finders/dynamic_finder/version/body_pattern.rb index 7afed0d1..ab035573 100644 --- a/lib/wpscan/finders/dynamic_finder/version/body_pattern.rb +++ b/lib/wpscan/finders/dynamic_finder/version/body_pattern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/comment.rb b/lib/wpscan/finders/dynamic_finder/version/comment.rb index 385a10d2..03fcd142 100644 --- a/lib/wpscan/finders/dynamic_finder/version/comment.rb +++ b/lib/wpscan/finders/dynamic_finder/version/comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/config_parser.rb b/lib/wpscan/finders/dynamic_finder/version/config_parser.rb index a8310a64..11edfaf1 100644 --- a/lib/wpscan/finders/dynamic_finder/version/config_parser.rb +++ b/lib/wpscan/finders/dynamic_finder/version/config_parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/finder.rb b/lib/wpscan/finders/dynamic_finder/version/finder.rb index 49cc25d4..bbf1b2c2 100644 --- a/lib/wpscan/finders/dynamic_finder/version/finder.rb +++ b/lib/wpscan/finders/dynamic_finder/version/finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/header_pattern.rb b/lib/wpscan/finders/dynamic_finder/version/header_pattern.rb index efa09f4f..d3992502 100644 --- a/lib/wpscan/finders/dynamic_finder/version/header_pattern.rb +++ b/lib/wpscan/finders/dynamic_finder/version/header_pattern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/javascript_var.rb b/lib/wpscan/finders/dynamic_finder/version/javascript_var.rb index 57dde9f6..5593c07a 100644 --- a/lib/wpscan/finders/dynamic_finder/version/javascript_var.rb +++ b/lib/wpscan/finders/dynamic_finder/version/javascript_var.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/query_parameter.rb b/lib/wpscan/finders/dynamic_finder/version/query_parameter.rb index 0e42274a..ba783edb 100644 --- a/lib/wpscan/finders/dynamic_finder/version/query_parameter.rb +++ b/lib/wpscan/finders/dynamic_finder/version/query_parameter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/version/xpath.rb b/lib/wpscan/finders/dynamic_finder/version/xpath.rb index f7e00c50..f4f26b4e 100644 --- a/lib/wpscan/finders/dynamic_finder/version/xpath.rb +++ b/lib/wpscan/finders/dynamic_finder/version/xpath.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/wp_item_version.rb b/lib/wpscan/finders/dynamic_finder/wp_item_version.rb index d411ae07..4e1da30d 100644 --- a/lib/wpscan/finders/dynamic_finder/wp_item_version.rb +++ b/lib/wpscan/finders/dynamic_finder/wp_item_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/wp_items/finder.rb b/lib/wpscan/finders/dynamic_finder/wp_items/finder.rb index f846e636..bd348550 100644 --- a/lib/wpscan/finders/dynamic_finder/wp_items/finder.rb +++ b/lib/wpscan/finders/dynamic_finder/wp_items/finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/dynamic_finder/wp_version.rb b/lib/wpscan/finders/dynamic_finder/wp_version.rb index 2af671df..1becdbad 100644 --- a/lib/wpscan/finders/dynamic_finder/wp_version.rb +++ b/lib/wpscan/finders/dynamic_finder/wp_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders module DynamicFinder diff --git a/lib/wpscan/finders/finder/wp_version/smart_url_checker.rb b/lib/wpscan/finders/finder/wp_version/smart_url_checker.rb index 054c689c..83f15ca5 100644 --- a/lib/wpscan/finders/finder/wp_version/smart_url_checker.rb +++ b/lib/wpscan/finders/finder/wp_version/smart_url_checker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan module Finders class Finder diff --git a/lib/wpscan/helper.rb b/lib/wpscan/helper.rb index 30273a25..0804d68d 100644 --- a/lib/wpscan/helper.rb +++ b/lib/wpscan/helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def read_json_file(file) JSON.parse(File.read(file)) rescue StandardError => e diff --git a/lib/wpscan/references.rb b/lib/wpscan/references.rb index 7dd2425d..103849dc 100644 --- a/lib/wpscan/references.rb +++ b/lib/wpscan/references.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan # References module (which should be included along with the CMSScanner::References) # to allow the use of the wpvulndb reference diff --git a/lib/wpscan/target.rb b/lib/wpscan/target.rb index 52422623..61e4ae66 100644 --- a/lib/wpscan/target.rb +++ b/lib/wpscan/target.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'wpscan/target/platform/wordpress' module WPScan diff --git a/lib/wpscan/target/platform/wordpress.rb b/lib/wpscan/target/platform/wordpress.rb index 134fe941..4828cbbd 100644 --- a/lib/wpscan/target/platform/wordpress.rb +++ b/lib/wpscan/target/platform/wordpress.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + %w[custom_directories].each do |required| require "wpscan/target/platform/wordpress/#{required}" end diff --git a/lib/wpscan/target/platform/wordpress/custom_directories.rb b/lib/wpscan/target/platform/wordpress/custom_directories.rb index 0aba4577..3db8231a 100644 --- a/lib/wpscan/target/platform/wordpress/custom_directories.rb +++ b/lib/wpscan/target/platform/wordpress/custom_directories.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan class Target < CMSScanner::Target module Platform @@ -111,9 +113,9 @@ module WPScan return @uri.to_s unless path if path =~ %r{wp\-content/plugins}i - path.gsub!('wp-content/plugins', plugins_dir) + path = +path.gsub('wp-content/plugins', plugins_dir) elsif path =~ /wp\-content/i - path.gsub!('wp-content', content_dir) + path = +path.gsub('wp-content', content_dir) elsif path[0] != '/' && sub_dir path = "#{sub_dir}/#{path}" end diff --git a/lib/wpscan/version.rb b/lib/wpscan/version.rb index 66b11496..cffaf2dc 100644 --- a/lib/wpscan/version.rb +++ b/lib/wpscan/version.rb @@ -1,4 +1,6 @@ +# frozen_string_literal: true + # Version module WPScan - VERSION = '3.4.5'.freeze + VERSION = '3.4.5' end diff --git a/lib/wpscan/vulnerability.rb b/lib/wpscan/vulnerability.rb index 4ddf1a54..f918c175 100644 --- a/lib/wpscan/vulnerability.rb +++ b/lib/wpscan/vulnerability.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan # Specific implementation class Vulnerability < CMSScanner::Vulnerability diff --git a/lib/wpscan/vulnerable.rb b/lib/wpscan/vulnerable.rb index ecbec0c0..b946df73 100644 --- a/lib/wpscan/vulnerable.rb +++ b/lib/wpscan/vulnerable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WPScan # Module to include in vulnerable WP item such as WpVersion. # the vulnerabilities method should be implemented diff --git a/spec/app/controllers/aliases_spec.rb b/spec/app/controllers/aliases_spec.rb index dd3ade32..97be5604 100644 --- a/spec/app/controllers/aliases_spec.rb +++ b/spec/app/controllers/aliases_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Controller::Aliases do subject(:controller) { described_class.new } let(:target_url) { 'http://ex.lo/' } diff --git a/spec/app/controllers/core_spec.rb b/spec/app/controllers/core_spec.rb index abb910bd..66c1050a 100644 --- a/spec/app/controllers/core_spec.rb +++ b/spec/app/controllers/core_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Controller::Core do subject(:core) { described_class.new } let(:target_url) { 'http://ex.lo/' } diff --git a/spec/app/controllers/custom_directories_spec.rb b/spec/app/controllers/custom_directories_spec.rb index 3b585c3c..5351de69 100644 --- a/spec/app/controllers/custom_directories_spec.rb +++ b/spec/app/controllers/custom_directories_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Controller::CustomDirectories do subject(:controller) { described_class.new } let(:target_url) { 'http://ex.lo/' } diff --git a/spec/app/controllers/enumeration_spec.rb b/spec/app/controllers/enumeration_spec.rb index 0c89a6a8..8374bb61 100644 --- a/spec/app/controllers/enumeration_spec.rb +++ b/spec/app/controllers/enumeration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Controller::Enumeration do subject(:controller) { described_class.new } let(:target_url) { 'http://wp.lab/' } diff --git a/spec/app/controllers/password_attack_spec.rb b/spec/app/controllers/password_attack_spec.rb index b2b524e0..83e85c53 100644 --- a/spec/app/controllers/password_attack_spec.rb +++ b/spec/app/controllers/password_attack_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Controller::PasswordAttack do subject(:controller) { described_class.new } let(:target_url) { 'http://ex.lo/' } diff --git a/spec/app/controllers/wp_version_spec.rb b/spec/app/controllers/wp_version_spec.rb index 1d9d0ccc..34ece8ae 100644 --- a/spec/app/controllers/wp_version_spec.rb +++ b/spec/app/controllers/wp_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def it_calls_the_formatter_with_the_correct_parameter(version) it 'calls the formatter with the correct parameter' do expect(controller.formatter).to receive(:output) diff --git a/spec/app/finders/config_backups/known_filenames_spec.rb b/spec/app/finders/config_backups/known_filenames_spec.rb index c96d53f4..876f465f 100644 --- a/spec/app/finders/config_backups/known_filenames_spec.rb +++ b/spec/app/finders/config_backups/known_filenames_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::ConfigBackups::KnownFilenames do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/config_backups_spec.rb b/spec/app/finders/config_backups_spec.rb index aeeca256..9cb8e6a6 100644 --- a/spec/app/finders/config_backups_spec.rb +++ b/spec/app/finders/config_backups_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::ConfigBackups::Base do subject(:config_backups) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/db_exports/known_locations_spec.rb b/spec/app/finders/db_exports/known_locations_spec.rb index b6475a23..48979864 100644 --- a/spec/app/finders/db_exports/known_locations_spec.rb +++ b/spec/app/finders/db_exports/known_locations_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DbExports::KnownLocations do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/db_exports_spec.rb b/spec/app/finders/db_exports_spec.rb index 1bd5e59b..a469bfdf 100644 --- a/spec/app/finders/db_exports_spec.rb +++ b/spec/app/finders/db_exports_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DbExports::Base do subject(:db_exports) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/interesting_findings/backup_db_spec.rb b/spec/app/finders/interesting_findings/backup_db_spec.rb index 988b5b0c..412c5871 100644 --- a/spec/app/finders/interesting_findings/backup_db_spec.rb +++ b/spec/app/finders/interesting_findings/backup_db_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::BackupDB do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/debug_log_spec.rb b/spec/app/finders/interesting_findings/debug_log_spec.rb index 8568b937..5ddeb294 100644 --- a/spec/app/finders/interesting_findings/debug_log_spec.rb +++ b/spec/app/finders/interesting_findings/debug_log_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::DebugLog do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/interesting_findings/duplicator_installer_log_spec.rb b/spec/app/finders/interesting_findings/duplicator_installer_log_spec.rb index d7c8e744..334bb9b3 100644 --- a/spec/app/finders/interesting_findings/duplicator_installer_log_spec.rb +++ b/spec/app/finders/interesting_findings/duplicator_installer_log_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::DuplicatorInstallerLog do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/emergency_pwd_reset_script_spec.rb b/spec/app/finders/interesting_findings/emergency_pwd_reset_script_spec.rb index 027116a2..93a20103 100644 --- a/spec/app/finders/interesting_findings/emergency_pwd_reset_script_spec.rb +++ b/spec/app/finders/interesting_findings/emergency_pwd_reset_script_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::EmergencyPwdResetScript do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/full_path_disclosure_spec.rb b/spec/app/finders/interesting_findings/full_path_disclosure_spec.rb index cb7520cc..ecd4d79c 100644 --- a/spec/app/finders/interesting_findings/full_path_disclosure_spec.rb +++ b/spec/app/finders/interesting_findings/full_path_disclosure_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::FullPathDisclosure do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/interesting_findings/mu_plugins_spec.rb b/spec/app/finders/interesting_findings/mu_plugins_spec.rb index 68d8494a..bf928a96 100644 --- a/spec/app/finders/interesting_findings/mu_plugins_spec.rb +++ b/spec/app/finders/interesting_findings/mu_plugins_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::MuPlugins do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/multisite_spec.rb b/spec/app/finders/interesting_findings/multisite_spec.rb index e61bb43e..937ce685 100644 --- a/spec/app/finders/interesting_findings/multisite_spec.rb +++ b/spec/app/finders/interesting_findings/multisite_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::Multisite do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/readme_spec.rb b/spec/app/finders/interesting_findings/readme_spec.rb index 27924f6f..01f00daf 100644 --- a/spec/app/finders/interesting_findings/readme_spec.rb +++ b/spec/app/finders/interesting_findings/readme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::Readme do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/interesting_findings/registration_spec.rb b/spec/app/finders/interesting_findings/registration_spec.rb index c3ba0ba3..4603fa2b 100644 --- a/spec/app/finders/interesting_findings/registration_spec.rb +++ b/spec/app/finders/interesting_findings/registration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::Registration do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/tmm_db_migrate_spec.rb b/spec/app/finders/interesting_findings/tmm_db_migrate_spec.rb index f1012648..f92a07cb 100644 --- a/spec/app/finders/interesting_findings/tmm_db_migrate_spec.rb +++ b/spec/app/finders/interesting_findings/tmm_db_migrate_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::TmmDbMigrate do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/upload_direcrory_listing_spec.rb b/spec/app/finders/interesting_findings/upload_direcrory_listing_spec.rb index 94c5673e..db1cd5c7 100644 --- a/spec/app/finders/interesting_findings/upload_direcrory_listing_spec.rb +++ b/spec/app/finders/interesting_findings/upload_direcrory_listing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::UploadDirectoryListing do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/upload_sql_dump_spec.rb b/spec/app/finders/interesting_findings/upload_sql_dump_spec.rb index c12a5a4c..a3316151 100644 --- a/spec/app/finders/interesting_findings/upload_sql_dump_spec.rb +++ b/spec/app/finders/interesting_findings/upload_sql_dump_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::UploadSQLDump do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/interesting_findings/wp_cron_spec.rb b/spec/app/finders/interesting_findings/wp_cron_spec.rb index 460a1719..ae361b63 100644 --- a/spec/app/finders/interesting_findings/wp_cron_spec.rb +++ b/spec/app/finders/interesting_findings/wp_cron_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::WPCron do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/interesting_findings_spec.rb b/spec/app/finders/interesting_findings_spec.rb index 7548b6b0..79c25066 100644 --- a/spec/app/finders/interesting_findings_spec.rb +++ b/spec/app/finders/interesting_findings_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::InterestingFindings::Base do subject(:files) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/main_theme/css_style_spec.rb b/spec/app/finders/main_theme/css_style_spec.rb index 5ac2694e..1cf30fb8 100644 --- a/spec/app/finders/main_theme/css_style_spec.rb +++ b/spec/app/finders/main_theme/css_style_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::MainTheme::CssStyle do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/main_theme/urls_in_homepage_spec.rb b/spec/app/finders/main_theme/urls_in_homepage_spec.rb index 576cd36a..9f7565f9 100644 --- a/spec/app/finders/main_theme/urls_in_homepage_spec.rb +++ b/spec/app/finders/main_theme/urls_in_homepage_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::MainTheme::UrlsInHomepage do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/main_theme/woo_framework_meta_generator_spec.rb b/spec/app/finders/main_theme/woo_framework_meta_generator_spec.rb index 9397a72b..e73d16b8 100644 --- a/spec/app/finders/main_theme/woo_framework_meta_generator_spec.rb +++ b/spec/app/finders/main_theme/woo_framework_meta_generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::MainTheme::WooFrameworkMetaGenerator do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/main_theme_spec.rb b/spec/app/finders/main_theme_spec.rb index 0ab14031..11037430 100644 --- a/spec/app/finders/main_theme_spec.rb +++ b/spec/app/finders/main_theme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::MainTheme::Base do subject(:main_theme) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/medias/attachment_brute_forcing_spec.rb b/spec/app/finders/medias/attachment_brute_forcing_spec.rb index 78914c4f..257bc70c 100644 --- a/spec/app/finders/medias/attachment_brute_forcing_spec.rb +++ b/spec/app/finders/medias/attachment_brute_forcing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Medias::AttachmentBruteForcing do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/medias_spec.rb b/spec/app/finders/medias_spec.rb index 8b9294e6..7271abb6 100644 --- a/spec/app/finders/medias_spec.rb +++ b/spec/app/finders/medias_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Medias::Base do subject(:media) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/plugin_version/readme_spec.rb b/spec/app/finders/plugin_version/readme_spec.rb index c35f9565..bc6ad23b 100644 --- a/spec/app/finders/plugin_version/readme_spec.rb +++ b/spec/app/finders/plugin_version/readme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::PluginVersion::Readme do subject(:finder) { described_class.new(plugin) } let(:plugin) { WPScan::Model::Plugin.new('spec', target) } diff --git a/spec/app/finders/plugin_version_spec.rb b/spec/app/finders/plugin_version_spec.rb index 6cf45548..66688ae1 100644 --- a/spec/app/finders/plugin_version_spec.rb +++ b/spec/app/finders/plugin_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # If this file is tested alone (rspec path-to-this-file), then there will be an error about # constants not being intilialized. This is due to the Dynamic Finders. diff --git a/spec/app/finders/plugins/body_pattern_spec.rb b/spec/app/finders/plugins/body_pattern_spec.rb index 396ee7d7..7921c78b 100644 --- a/spec/app/finders/plugins/body_pattern_spec.rb +++ b/spec/app/finders/plugins/body_pattern_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::BodyPattern do it_behaves_like WPScan::Finders::DynamicFinder::WpItems::Finder do subject(:finder) { described_class.new(target) } diff --git a/spec/app/finders/plugins/comment_spec.rb b/spec/app/finders/plugins/comment_spec.rb index ec64d135..d7343d80 100644 --- a/spec/app/finders/plugins/comment_spec.rb +++ b/spec/app/finders/plugins/comment_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::Comment do it_behaves_like WPScan::Finders::DynamicFinder::WpItems::Finder do subject(:finder) { described_class.new(target) } diff --git a/spec/app/finders/plugins/config_parser_spec.rb b/spec/app/finders/plugins/config_parser_spec.rb index 956c98af..236728cc 100644 --- a/spec/app/finders/plugins/config_parser_spec.rb +++ b/spec/app/finders/plugins/config_parser_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::ConfigParser do xit diff --git a/spec/app/finders/plugins/header_pattern_spec.rb b/spec/app/finders/plugins/header_pattern_spec.rb index 51dd483f..d5383a5c 100644 --- a/spec/app/finders/plugins/header_pattern_spec.rb +++ b/spec/app/finders/plugins/header_pattern_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::HeaderPattern do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/plugins/javascript_var_spec.rb b/spec/app/finders/plugins/javascript_var_spec.rb index 30963627..13017f51 100644 --- a/spec/app/finders/plugins/javascript_var_spec.rb +++ b/spec/app/finders/plugins/javascript_var_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::JavascriptVar do it_behaves_like WPScan::Finders::DynamicFinder::WpItems::Finder do subject(:finder) { described_class.new(target) } diff --git a/spec/app/finders/plugins/known_locations_spec.rb b/spec/app/finders/plugins/known_locations_spec.rb index 33e3816b..5dc4e5c9 100644 --- a/spec/app/finders/plugins/known_locations_spec.rb +++ b/spec/app/finders/plugins/known_locations_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::KnownLocations do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/plugins/query_parameter_spec.rb b/spec/app/finders/plugins/query_parameter_spec.rb index 410cf5fc..369ce1e5 100644 --- a/spec/app/finders/plugins/query_parameter_spec.rb +++ b/spec/app/finders/plugins/query_parameter_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::QueryParameter do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/plugins/urls_in_homepage_spec.rb b/spec/app/finders/plugins/urls_in_homepage_spec.rb index 26a52f86..1d25f3bd 100644 --- a/spec/app/finders/plugins/urls_in_homepage_spec.rb +++ b/spec/app/finders/plugins/urls_in_homepage_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::UrlsInHomepage do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/plugins/xpath_spec.rb b/spec/app/finders/plugins/xpath_spec.rb index 80a2037a..af69c376 100644 --- a/spec/app/finders/plugins/xpath_spec.rb +++ b/spec/app/finders/plugins/xpath_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::Xpath do it_behaves_like WPScan::Finders::DynamicFinder::WpItems::Finder do subject(:finder) { described_class.new(target) } diff --git a/spec/app/finders/plugins_spec.rb b/spec/app/finders/plugins_spec.rb index 89619fdc..fea6b1b5 100644 --- a/spec/app/finders/plugins_spec.rb +++ b/spec/app/finders/plugins_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Plugins::Base do subject(:plugins) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/theme_version/style_spec.rb b/spec/app/finders/theme_version/style_spec.rb index 349a8fed..0dd03128 100644 --- a/spec/app/finders/theme_version/style_spec.rb +++ b/spec/app/finders/theme_version/style_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::ThemeVersion::Style do subject(:finder) { described_class.new(theme) } let(:theme) { WPScan::Model::Theme.new('spec', target) } diff --git a/spec/app/finders/theme_version/woo_framework_meta_generator_spec.rb b/spec/app/finders/theme_version/woo_framework_meta_generator_spec.rb index 7fe7e63c..d20ce6c8 100644 --- a/spec/app/finders/theme_version/woo_framework_meta_generator_spec.rb +++ b/spec/app/finders/theme_version/woo_framework_meta_generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::ThemeVersion::WooFrameworkMetaGenerator do subject(:finder) { described_class.new(theme) } let(:theme) { WPScan::Model::Theme.new(slug, target) } diff --git a/spec/app/finders/theme_version_spec.rb b/spec/app/finders/theme_version_spec.rb index 823266ac..18a3f0fa 100644 --- a/spec/app/finders/theme_version_spec.rb +++ b/spec/app/finders/theme_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::ThemeVersion::Base do subject(:theme_version) { described_class.new(theme) } let(:theme) { WPScan::Model::Plugin.new(slug, target) } diff --git a/spec/app/finders/themes/known_locations_spec.rb b/spec/app/finders/themes/known_locations_spec.rb index 58bba7b7..d559ba5e 100644 --- a/spec/app/finders/themes/known_locations_spec.rb +++ b/spec/app/finders/themes/known_locations_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Themes::KnownLocations do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/themes/urls_in_homepage_spec.rb b/spec/app/finders/themes/urls_in_homepage_spec.rb index 85c5d6f7..bc175f61 100644 --- a/spec/app/finders/themes/urls_in_homepage_spec.rb +++ b/spec/app/finders/themes/urls_in_homepage_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Themes::UrlsInHomepage do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/themes_spec.rb b/spec/app/finders/themes_spec.rb index 436922e1..7b033c57 100644 --- a/spec/app/finders/themes_spec.rb +++ b/spec/app/finders/themes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Themes::Base do subject(:themes) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/timthumb_version/bad_request_spec.rb b/spec/app/finders/timthumb_version/bad_request_spec.rb index 3e2e15ee..905f6bb2 100644 --- a/spec/app/finders/timthumb_version/bad_request_spec.rb +++ b/spec/app/finders/timthumb_version/bad_request_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::TimthumbVersion::BadRequest do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Model::Timthumb.new(url) } diff --git a/spec/app/finders/timthumb_version_spec.rb b/spec/app/finders/timthumb_version_spec.rb index cfd7cff5..e59b8a70 100644 --- a/spec/app/finders/timthumb_version_spec.rb +++ b/spec/app/finders/timthumb_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::TimthumbVersion::Base do subject(:timthumb_version) { described_class.new(target) } let(:target) { WPScan::Model::Timthumb.new(url) } diff --git a/spec/app/finders/timthumbs/known_locations_spec.rb b/spec/app/finders/timthumbs/known_locations_spec.rb index 3eb08e8e..ddc96068 100644 --- a/spec/app/finders/timthumbs/known_locations_spec.rb +++ b/spec/app/finders/timthumbs/known_locations_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Timthumbs::KnownLocations do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/timthumbs_spec.rb b/spec/app/finders/timthumbs_spec.rb index b818be1b..2fb9763d 100644 --- a/spec/app/finders/timthumbs_spec.rb +++ b/spec/app/finders/timthumbs_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Timthumbs::Base do subject(:timthumb) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/author_id_brute_forcing_spec.rb b/spec/app/finders/users/author_id_brute_forcing_spec.rb index e6325b63..e1b9de24 100644 --- a/spec/app/finders/users/author_id_brute_forcing_spec.rb +++ b/spec/app/finders/users/author_id_brute_forcing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::AuthorIdBruteForcing do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/author_posts_spec.rb b/spec/app/finders/users/author_posts_spec.rb index 6327cbfb..4bca4e3f 100644 --- a/spec/app/finders/users/author_posts_spec.rb +++ b/spec/app/finders/users/author_posts_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::AuthorPosts do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/login_error_messages_spec.rb b/spec/app/finders/users/login_error_messages_spec.rb index badb5cae..3cd0d720 100644 --- a/spec/app/finders/users/login_error_messages_spec.rb +++ b/spec/app/finders/users/login_error_messages_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::LoginErrorMessages do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/oembed_api_spec.rb b/spec/app/finders/users/oembed_api_spec.rb index d9a5a208..355408bf 100644 --- a/spec/app/finders/users/oembed_api_spec.rb +++ b/spec/app/finders/users/oembed_api_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::OembedApi do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/rss_generator_spec.rb b/spec/app/finders/users/rss_generator_spec.rb index 5caaa4e5..cc83cec9 100644 --- a/spec/app/finders/users/rss_generator_spec.rb +++ b/spec/app/finders/users/rss_generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::RSSGenerator do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/wp_json_api_spec.rb b/spec/app/finders/users/wp_json_api_spec.rb index 6f7e2cb4..b3c00838 100644 --- a/spec/app/finders/users/wp_json_api_spec.rb +++ b/spec/app/finders/users/wp_json_api_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::WpJsonApi do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users/yoast_seo_author_sitemap_spec.rb b/spec/app/finders/users/yoast_seo_author_sitemap_spec.rb index 789068c7..8bc2fb3b 100644 --- a/spec/app/finders/users/yoast_seo_author_sitemap_spec.rb +++ b/spec/app/finders/users/yoast_seo_author_sitemap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::YoastSeoAuthorSitemap do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/users_spec.rb b/spec/app/finders/users_spec.rb index 8890345e..b23b7f40 100644 --- a/spec/app/finders/users_spec.rb +++ b/spec/app/finders/users_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Users::Base do subject(:user) { described_class.new(target) } let(:target) { WPScan::Target.new(url) } diff --git a/spec/app/finders/wp_version/atom_generator_spec.rb b/spec/app/finders/wp_version/atom_generator_spec.rb index 5c33234f..c46cf545 100644 --- a/spec/app/finders/wp_version/atom_generator_spec.rb +++ b/spec/app/finders/wp_version/atom_generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::WpVersion::AtomGenerator do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/wp_version/rdf_generator_spec.rb b/spec/app/finders/wp_version/rdf_generator_spec.rb index ac4190ae..7af0e95c 100644 --- a/spec/app/finders/wp_version/rdf_generator_spec.rb +++ b/spec/app/finders/wp_version/rdf_generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::WpVersion::RDFGenerator do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/wp_version/readme_spec.rb b/spec/app/finders/wp_version/readme_spec.rb index eff86c26..f1a37ffe 100644 --- a/spec/app/finders/wp_version/readme_spec.rb +++ b/spec/app/finders/wp_version/readme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::WpVersion::Readme do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/wp_version/rss_generator_spec.rb b/spec/app/finders/wp_version/rss_generator_spec.rb index 19c4327e..767da47a 100644 --- a/spec/app/finders/wp_version/rss_generator_spec.rb +++ b/spec/app/finders/wp_version/rss_generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::WpVersion::RSSGenerator do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/wp_version/unique_fingerprinting_spec.rb b/spec/app/finders/wp_version/unique_fingerprinting_spec.rb index 7a3066b4..c310e33e 100644 --- a/spec/app/finders/wp_version/unique_fingerprinting_spec.rb +++ b/spec/app/finders/wp_version/unique_fingerprinting_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::WpVersion::UniqueFingerprinting do subject(:finder) { described_class.new(target) } let(:target) { WPScan::Target.new(url).extend(CMSScanner::Target::Server::Apache) } diff --git a/spec/app/finders/wp_version_spec.rb b/spec/app/finders/wp_version_spec.rb index be367fc1..9739d5e3 100644 --- a/spec/app/finders/wp_version_spec.rb +++ b/spec/app/finders/wp_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # If this file is tested alone (rspec path-to-this-file), then there will be an error about # constants not being intilialized. This is due to the Dynamic Finders. diff --git a/spec/app/models/interesting_finding_spec.rb b/spec/app/models/interesting_finding_spec.rb index 4afd239a..4d65402a 100644 --- a/spec/app/models/interesting_finding_spec.rb +++ b/spec/app/models/interesting_finding_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::InterestingFinding do it_behaves_like WPScan::References do subject(:finding) { described_class.new('http://e.org/file.php', opts) } diff --git a/spec/app/models/media_spec.rb b/spec/app/models/media_spec.rb index 252a97c3..21c80a81 100644 --- a/spec/app/models/media_spec.rb +++ b/spec/app/models/media_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::Media do subject(:media) { described_class.new(url) } let(:url) { 'http://e.oeg/?attachment_id=2' } diff --git a/spec/app/models/plugin_spec.rb b/spec/app/models/plugin_spec.rb index a95fc56a..dc2313ed 100644 --- a/spec/app/models/plugin_spec.rb +++ b/spec/app/models/plugin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::Plugin do subject(:plugin) { described_class.new(slug, blog, opts) } let(:slug) { 'spec' } diff --git a/spec/app/models/theme_spec.rb b/spec/app/models/theme_spec.rb index c648ac57..4d573bd1 100644 --- a/spec/app/models/theme_spec.rb +++ b/spec/app/models/theme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::Theme do subject(:theme) { described_class.new(slug, blog, opts) } let(:slug) { 'spec' } diff --git a/spec/app/models/timthumb_spec.rb b/spec/app/models/timthumb_spec.rb index e1f3ba90..5c65be21 100644 --- a/spec/app/models/timthumb_spec.rb +++ b/spec/app/models/timthumb_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::Timthumb do subject(:timthumb) { described_class.new(url, opts) } let(:url) { 'http://wp.lab/wp-content/timthumb.php' } diff --git a/spec/app/models/wp_item_spec.rb b/spec/app/models/wp_item_spec.rb index 8566eee0..573f9fc3 100644 --- a/spec/app/models/wp_item_spec.rb +++ b/spec/app/models/wp_item_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::WpItem do subject(:wp_item) { described_class.new(slug, blog, opts) } let(:slug) { 'test_item' } diff --git a/spec/app/models/wp_version_spec.rb b/spec/app/models/wp_version_spec.rb index ffcabca2..2945b533 100644 --- a/spec/app/models/wp_version_spec.rb +++ b/spec/app/models/wp_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::WpVersion do describe '#new' do context 'when invalid number' do diff --git a/spec/app/models/xml_rpc_spec.rb b/spec/app/models/xml_rpc_spec.rb index 460db1c4..86821fb7 100644 --- a/spec/app/models/xml_rpc_spec.rb +++ b/spec/app/models/xml_rpc_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Model::XMLRPC do subject(:xml_rpc) { described_class.new('http//e.org/xmlrpc.php') } diff --git a/spec/app/views_spec.rb b/spec/app/views_spec.rb index 16908773..e5cd9b9d 100644 --- a/spec/app/views_spec.rb +++ b/spec/app/views_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe 'App::Views' do let(:target_url) { 'http://ex.lo/' } let(:target) { WPScan::Target.new(target_url) } diff --git a/spec/lib/browser_spec.rb b/spec/lib/browser_spec.rb index 931c9ca0..2941967d 100644 --- a/spec/lib/browser_spec.rb +++ b/spec/lib/browser_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Browser do subject(:browser) { described_class.instance(options) } before { described_class.reset } diff --git a/spec/lib/db/dynamic_finders/base_spec.rb b/spec/lib/db/dynamic_finders/base_spec.rb index 62b49481..b50677fe 100644 --- a/spec/lib/db/dynamic_finders/base_spec.rb +++ b/spec/lib/db/dynamic_finders/base_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::DynamicFinders::Base do subject(:dynamic_finders) { described_class } diff --git a/spec/lib/db/dynamic_finders/plugin_spec.rb b/spec/lib/db/dynamic_finders/plugin_spec.rb index 449739ff..91baa5ee 100644 --- a/spec/lib/db/dynamic_finders/plugin_spec.rb +++ b/spec/lib/db/dynamic_finders/plugin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::DynamicFinders::Plugin do subject(:dynamic_finders) { described_class } diff --git a/spec/lib/db/dynamic_finders/theme_spec.rb b/spec/lib/db/dynamic_finders/theme_spec.rb index f67f7db4..0950b144 100644 --- a/spec/lib/db/dynamic_finders/theme_spec.rb +++ b/spec/lib/db/dynamic_finders/theme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::DynamicFinders::Theme do subject(:dynamic_finders) { described_class } diff --git a/spec/lib/db/dynamic_finders/wordpress_spec.rb b/spec/lib/db/dynamic_finders/wordpress_spec.rb index 3d168f34..c06747a5 100644 --- a/spec/lib/db/dynamic_finders/wordpress_spec.rb +++ b/spec/lib/db/dynamic_finders/wordpress_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::DynamicFinders::Wordpress do subject(:dynamic_finders) { described_class } diff --git a/spec/lib/db/fingerprints_spec.rb b/spec/lib/db/fingerprints_spec.rb index 1777cca6..3d7283a5 100644 --- a/spec/lib/db/fingerprints_spec.rb +++ b/spec/lib/db/fingerprints_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::Fingerprints do describe '#unique_fingerprints' do # Handled in #wp_unique_fingerprints diff --git a/spec/lib/db/plugin_spec.rb b/spec/lib/db/plugin_spec.rb index 153da73d..c700fb18 100644 --- a/spec/lib/db/plugin_spec.rb +++ b/spec/lib/db/plugin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::Plugin do describe '#vulnerabilities' do # Handled in spec/app/models/plugin_spec diff --git a/spec/lib/db/plugins_spec.rb b/spec/lib/db/plugins_spec.rb index a172ffdb..7838c7b2 100644 --- a/spec/lib/db/plugins_spec.rb +++ b/spec/lib/db/plugins_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::Plugins do subject(:plugins) { described_class } diff --git a/spec/lib/db/theme_spec.rb b/spec/lib/db/theme_spec.rb index b4c74802..cd42d071 100644 --- a/spec/lib/db/theme_spec.rb +++ b/spec/lib/db/theme_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::Theme do describe '#vulnerabilities' do # Handled in spec/app/models/theme_spec diff --git a/spec/lib/db/themes_spec.rb b/spec/lib/db/themes_spec.rb index c67c3d6b..d97c5c2a 100644 --- a/spec/lib/db/themes_spec.rb +++ b/spec/lib/db/themes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::Themes do subject(:themes) { described_class } diff --git a/spec/lib/db/wp_item_spec.rb b/spec/lib/db/wp_item_spec.rb index de038d61..3420549e 100644 --- a/spec/lib/db/wp_item_spec.rb +++ b/spec/lib/db/wp_item_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::WpItem do describe '#vulnerabilities' do # Handled in spec/app/models/plugin_spec diff --git a/spec/lib/db/wp_items_spec.rb b/spec/lib/db/wp_items_spec.rb index 20fa3157..a1ed7ceb 100644 --- a/spec/lib/db/wp_items_spec.rb +++ b/spec/lib/db/wp_items_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::WpItems do # Handled in plugins_spec & themes_spec end diff --git a/spec/lib/db/wp_version_spec.rb b/spec/lib/db/wp_version_spec.rb index 4b32fb2d..6439474e 100644 --- a/spec/lib/db/wp_version_spec.rb +++ b/spec/lib/db/wp_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::DB::Version do describe '#vulnerabilities' do # Handled in spec/app/models/wp_version_spec diff --git a/spec/lib/finders/dynamic_finder/plugin_version_spec.rb b/spec/lib/finders/dynamic_finder/plugin_version_spec.rb index 90976910..bf68fd87 100644 --- a/spec/lib/finders/dynamic_finder/plugin_version_spec.rb +++ b/spec/lib/finders/dynamic_finder/plugin_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # All Plugin Dynamic Finders returning a Version are tested here. # When adding one to the spec/fixtures/db/dynamic_finder.yml, a few files have # to be edited/created diff --git a/spec/lib/finders/dynamic_finder/version/body_pattern_spec.rb b/spec/lib/finders/dynamic_finder/version/body_pattern_spec.rb index 629cffe9..2256ee2d 100644 --- a/spec/lib/finders/dynamic_finder/version/body_pattern_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/body_pattern_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::BodyPattern do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/version/comment_spec.rb b/spec/lib/finders/dynamic_finder/version/comment_spec.rb index 9a1dad77..5c62ad19 100644 --- a/spec/lib/finders/dynamic_finder/version/comment_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/comment_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::Comment do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/version/config_parser_spec.rb b/spec/lib/finders/dynamic_finder/version/config_parser_spec.rb index e271e5a9..777ba40b 100644 --- a/spec/lib/finders/dynamic_finder/version/config_parser_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/config_parser_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::ConfigParser do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/version/header_pattern_spec.rb b/spec/lib/finders/dynamic_finder/version/header_pattern_spec.rb index 93710719..af7ee206 100644 --- a/spec/lib/finders/dynamic_finder/version/header_pattern_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/header_pattern_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::HeaderPattern do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/version/javascript_var_spec.rb b/spec/lib/finders/dynamic_finder/version/javascript_var_spec.rb index d6b8d257..4ea1ae49 100644 --- a/spec/lib/finders/dynamic_finder/version/javascript_var_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/javascript_var_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::JavascriptVar do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/version/query_parameter_spec.rb b/spec/lib/finders/dynamic_finder/version/query_parameter_spec.rb index d9703940..832fad2a 100644 --- a/spec/lib/finders/dynamic_finder/version/query_parameter_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/query_parameter_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::QueryParameter do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/version/xpath_spec.rb b/spec/lib/finders/dynamic_finder/version/xpath_spec.rb index e5d6429f..e458548e 100644 --- a/spec/lib/finders/dynamic_finder/version/xpath_spec.rb +++ b/spec/lib/finders/dynamic_finder/version/xpath_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::Version::Xpath do module WPScan module Finders diff --git a/spec/lib/finders/dynamic_finder/wp_items/finder_spec.rb b/spec/lib/finders/dynamic_finder/wp_items/finder_spec.rb index 8d8c8650..59266f79 100644 --- a/spec/lib/finders/dynamic_finder/wp_items/finder_spec.rb +++ b/spec/lib/finders/dynamic_finder/wp_items/finder_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::DynamicFinder::WpItems::Finder do # Handled in spec/shared_examples/dynamic_finders/wp_items.rb end diff --git a/spec/lib/finders/dynamic_finder/wp_version_spec.rb b/spec/lib/finders/dynamic_finder/wp_version_spec.rb index 8dbbbffa..1a7f5fd4 100644 --- a/spec/lib/finders/dynamic_finder/wp_version_spec.rb +++ b/spec/lib/finders/dynamic_finder/wp_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + expected_all = df_expected_all['wordpress'] WPScan::DB::DynamicFinders::Wordpress.create_versions_finders diff --git a/spec/lib/finders/finder/wp_version/smart_url_checker_spec.rb b/spec/lib/finders/finder/wp_version/smart_url_checker_spec.rb index d8fe60ab..19ef9426 100644 --- a/spec/lib/finders/finder/wp_version/smart_url_checker_spec.rb +++ b/spec/lib/finders/finder/wp_version/smart_url_checker_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Finders::Finder::WpVersion::SmartURLChecker do xit end diff --git a/spec/lib/target_spec.rb b/spec/lib/target_spec.rb index 07c91e3a..e03ef838 100644 --- a/spec/lib/target_spec.rb +++ b/spec/lib/target_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Target do subject(:target) { described_class.new(url) } let(:url) { 'http://ex.lo' } diff --git a/spec/lib/vulnerability_spec.rb b/spec/lib/vulnerability_spec.rb index f4812d6b..18a61494 100644 --- a/spec/lib/vulnerability_spec.rb +++ b/spec/lib/vulnerability_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan::Vulnerability do subject(:vuln) { described_class.new(title, references) } let(:title) { 'Test Vuln' } diff --git a/spec/lib/wpscan_spec.rb b/spec/lib/wpscan_spec.rb index e4321993..02af6ddd 100644 --- a/spec/lib/wpscan_spec.rb +++ b/spec/lib/wpscan_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe WPScan do it 'has a version number' do expect(WPScan::VERSION).not_to be nil diff --git a/spec/shared_examples.rb b/spec/shared_examples.rb index 4cef8151..8c8636ea 100644 --- a/spec/shared_examples.rb +++ b/spec/shared_examples.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'shared_examples/views/wp_version' require 'shared_examples/views/main_theme' require 'shared_examples/views/enumeration' diff --git a/spec/shared_examples/dynamic_finders/wp_items.rb b/spec/shared_examples/dynamic_finders/wp_items.rb index 143469c9..50241955 100644 --- a/spec/shared_examples/dynamic_finders/wp_items.rb +++ b/spec/shared_examples/dynamic_finders/wp_items.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples WPScan::Finders::DynamicFinder::WpItems::Finder do let(:passive_fixture) do fixtures.join("#{described_class.to_s.demodulize.underscore}_passive_all.html") diff --git a/spec/shared_examples/finders/wp_items/urls_in_homepage.rb b/spec/shared_examples/finders/wp_items/urls_in_homepage.rb index 66b7abd5..d2b934c1 100644 --- a/spec/shared_examples/finders/wp_items/urls_in_homepage.rb +++ b/spec/shared_examples/finders/wp_items/urls_in_homepage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Finders::WpItems::URLsInHomepage' do before do stub_request(:get, finder.target.url).to_return(body: File.read(fixtures.join(file))) diff --git a/spec/shared_examples/references.rb b/spec/shared_examples/references.rb index 5b0285c9..91670938 100644 --- a/spec/shared_examples/references.rb +++ b/spec/shared_examples/references.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples WPScan::References do describe '#references_keys' do it 'contains the :wpvulndb symbol' do diff --git a/spec/shared_examples/target/platform/wordpress.rb b/spec/shared_examples/target/platform/wordpress.rb index ad867060..325c04a8 100644 --- a/spec/shared_examples/target/platform/wordpress.rb +++ b/spec/shared_examples/target/platform/wordpress.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'wordpress/custom_directories' shared_examples WPScan::Target::Platform::WordPress do diff --git a/spec/shared_examples/target/platform/wordpress/custom_directories.rb b/spec/shared_examples/target/platform/wordpress/custom_directories.rb index 9d4cfe67..fad08e3b 100644 --- a/spec/shared_examples/target/platform/wordpress/custom_directories.rb +++ b/spec/shared_examples/target/platform/wordpress/custom_directories.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'WordPress::CustomDirectories' do let(:fixtures) { super().join('custom_directories') } diff --git a/spec/shared_examples/views/enumeration.rb b/spec/shared_examples/views/enumeration.rb index 12a65bc3..3b20391f 100644 --- a/spec/shared_examples/views/enumeration.rb +++ b/spec/shared_examples/views/enumeration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'enumeration/users' require_relative 'enumeration/medias' require_relative 'enumeration/themes' diff --git a/spec/shared_examples/views/enumeration/config_backups.rb b/spec/shared_examples/views/enumeration/config_backups.rb index 0204685d..7243ed37 100644 --- a/spec/shared_examples/views/enumeration/config_backups.rb +++ b/spec/shared_examples/views/enumeration/config_backups.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::ConfigBackups' do let(:view) { 'config_backups' } let(:config_backup) { WPScan::Model::ConfigBackup } diff --git a/spec/shared_examples/views/enumeration/db_exports.rb b/spec/shared_examples/views/enumeration/db_exports.rb index 1d79c806..5c6d9cf5 100644 --- a/spec/shared_examples/views/enumeration/db_exports.rb +++ b/spec/shared_examples/views/enumeration/db_exports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::DbExports' do let(:view) { 'db_exports' } let(:db_export) { WPScan::Model::DbExport } diff --git a/spec/shared_examples/views/enumeration/medias.rb b/spec/shared_examples/views/enumeration/medias.rb index ee481465..9b1fc12d 100644 --- a/spec/shared_examples/views/enumeration/medias.rb +++ b/spec/shared_examples/views/enumeration/medias.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::Medias' do let(:view) { 'medias' } let(:media) { WPScan::Model::Media } diff --git a/spec/shared_examples/views/enumeration/plugins.rb b/spec/shared_examples/views/enumeration/plugins.rb index 07963c00..e3e4ebea 100644 --- a/spec/shared_examples/views/enumeration/plugins.rb +++ b/spec/shared_examples/views/enumeration/plugins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::Plugins' do let(:view) { 'plugins' } let(:plugin) { WPScan::Model::Plugin } diff --git a/spec/shared_examples/views/enumeration/themes.rb b/spec/shared_examples/views/enumeration/themes.rb index 8c32e900..6e663e03 100644 --- a/spec/shared_examples/views/enumeration/themes.rb +++ b/spec/shared_examples/views/enumeration/themes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::Themes' do let(:view) { 'themes' } let(:plugin) { WPScan::Model::Theme } diff --git a/spec/shared_examples/views/enumeration/timthumbs.rb b/spec/shared_examples/views/enumeration/timthumbs.rb index 1a5f6629..bfb59d1e 100644 --- a/spec/shared_examples/views/enumeration/timthumbs.rb +++ b/spec/shared_examples/views/enumeration/timthumbs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::Timthumbs' do let(:view) { 'timthumbs' } let(:timthumb) { WPScan::Model::Timthumb } diff --git a/spec/shared_examples/views/enumeration/users.rb b/spec/shared_examples/views/enumeration/users.rb index ec9301e3..13436c03 100644 --- a/spec/shared_examples/views/enumeration/users.rb +++ b/spec/shared_examples/views/enumeration/users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::Enumeration::Users' do let(:view) { 'users' } let(:user) { WPScan::Model::User } diff --git a/spec/shared_examples/views/main_theme.rb b/spec/shared_examples/views/main_theme.rb index 7f967ddc..901db775 100644 --- a/spec/shared_examples/views/main_theme.rb +++ b/spec/shared_examples/views/main_theme.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::MainTheme' do let(:controller) { WPScan::Controller::MainTheme.new } let(:tpl_vars) { { url: target_url } } diff --git a/spec/shared_examples/views/wp_version.rb b/spec/shared_examples/views/wp_version.rb index d9d38967..93b416ff 100644 --- a/spec/shared_examples/views/wp_version.rb +++ b/spec/shared_examples/views/wp_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples 'App::Views::WpVersion' do let(:controller) { WPScan::Controller::WpVersion.new } let(:tpl_vars) { { url: target_url } } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2b740563..6dc92641 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'simplecov' # Used filters are in /.simplecov