Module: WpTarget::WpLoginProtection

Included in:
WpTarget
Defined in:
lib/wpscan/wp_target/wp_login_protection.rb

Constant Summary collapse

LOGIN_PROTECTION_METHOD_PATTERN =
/^has_(.*)_protection\?/i

Instance Method Summary collapse

Instance Method Details

#has_login_protection?Boolean


10
11
12
# File 'lib/wpscan/wp_target/wp_login_protection.rb', line 10

def 
  !().nil?
end

#login_protection_pluginObject

Checks if a login protection plugin is enabled return a WpPlugin object or nil if no one is found


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/wpscan/wp_target/wp_login_protection.rb', line 16

def 
  unless @login_protection_plugin
    protected_methods.grep(LOGIN_PROTECTION_METHOD_PATTERN).each do |symbol_to_call|

      if send(symbol_to_call)
        plugin_name = symbol_to_call[LOGIN_PROTECTION_METHOD_PATTERN, 1].gsub('_', '-')

        return @login_protection_plugin = WpPlugin.new(
          @uri,
          name:           plugin_name,
          wp_content_dir: wp_content_dir,
          wp_plugins_dir: wp_plugins_dir
        )
      end
    end
    @login_protection_plugin = nil
  end
  @login_protection_plugin
end