Commit Graph

3133 Commits

Author SHA1 Message Date
Grant Willcox 94dbe9f39e Land #14882, Fix Wordpress user login validation for recent versions of WordPress 2021-03-11 16:47:42 -06:00
Grant Willcox 4c0da1c82f Ninja commit to fix a typo 2021-03-11 16:46:50 -06:00
suryasaradhi 37eaf7944b Added changes to regex expression
Now the search will be for the exact user error
2021-03-12 03:12:58 +05:30
suryasaradhi ae29e749c7 Fixed wordpress user login validation
## BUG

While trying using 

`module> auxiliary/scanner/http/wordpress_login_enum`

User validation does not occur correctly in wordpress 5.x



## Verification

- mkdir wordpress
- cd wordpress
- nano docker-compose.yml
- Enter the following into the file

```
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: {}
```
- sudo docker-compose up -d

- Follow the setup instructions at 127.0.0.1:8000 and set up a new user in WordPress.
- Start msfconsole
- creds add user:test
- use auxiliary/scanner/http/wordpress_login_enum
- set RHOSTS 127.0.0.1
- set RPORT 8000
- set DB_ALL_USERS true
- run

## Expected Output

```
msf6 > use auxiliary/scanner/http/wordpress_login_enum 
msf6 auxiliary(scanner/http/wordpress_login_enum) > show options

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

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   BLANK_PASSWORDS      false            no        Try blank passwords for all users
   BRUTEFORCE           true             yes       Perform brute force authentication
   BRUTEFORCE_SPEED     5                yes       How fast to bruteforce, from 0 to 5
   DB_ALL_CREDS         false            no        Try each user/password couple stored in the current database
   DB_ALL_PASS          false            no        Add all passwords in the current database to the list
   DB_ALL_USERS         false            no        Add all users in the current database to the list
   ENUMERATE_USERNAMES  true             yes       Enumerate usernames
   PASSWORD                              no        A specific password to authenticate with
   PASS_FILE                             no        File containing passwords, one per line
   Proxies                               no        A proxy chain of format type:host:port[,type:host:port][...]
   RANGE_END            10               no        Last user id to enumerate
   RANGE_START          1                no        First user id to enumerate
   RHOSTS                                yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT                80               yes       The target port (TCP)
   SSL                  false            no        Negotiate SSL/TLS for outgoing connections
   STOP_ON_SUCCESS      false            yes       Stop guessing when a credential works for a host
   TARGETURI            /                yes       The base path to the wordpress application
   THREADS              1                yes       The number of concurrent threads (max one per host)
   USERNAME                              no        A specific username to authenticate as
   USERPASS_FILE                         no        File containing users and passwords separated by space, one pair per line
   USER_AS_PASS         false            no        Try the username as the password for all users
   USER_FILE                             no        File containing usernames, one per line
   VALIDATE_USERS       true             yes       Validate usernames
   VERBOSE              true             yes       Whether to print output for all attempts
   VHOST                                 no        HTTP server virtual host

msf6 auxiliary(scanner/http/wordpress_login_enum) > set RHOSTS 127.0.0.1
RHOSTS => 127.0.0.1
msf6 auxiliary(scanner/http/wordpress_login_enum) > set RPORT 8080
RPORT => 8080
msf6 auxiliary(scanner/http/wordpress_login_enum) > set DB_ALL_USERS true
DB_ALL_USERS => true
msf6 auxiliary(scanner/http/wordpress_login_enum) > run

[-] The connection was refused by the remote host (127.0.0.1:8080).
[-] / does not seem to be WordPress site
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/http/wordpress_login_enum) > set RPORT 8000
RPORT => 8000
msf6 auxiliary(scanner/http/wordpress_login_enum) > run

[*] / - WordPress Version 5.6.1 detected
[*] 127.0.0.1:8000 - / - WordPress User-Enumeration - Running User Enumeration
[*] 127.0.0.1:8000 - / - WordPress User-Validation - Running User Validation
[*] / - WordPress User-Validation - Checking Username:'Administrator'
[-] 127.0.0.1:8000 - [1/4] - / - WordPress User-Validation - Invalid Username: 'Administrator'
[*] / - WordPress User-Validation - Checking Username:'administrator'
[-] 127.0.0.1:8000 - [2/4] - / - WordPress User-Validation - Invalid Username: 'administrator'
[*] / - WordPress User-Validation - Checking Username:'test'
[+] / - WordPress User-Validation - Username: 'test' - is VALID
[+] / - WordPress User-Validation - Found 1 valid user
[-] 127.0.0.1:8000 - [4/4] - / - WordPress User-Validation - Invalid Username: 'normal'
[*] 127.0.0.1:8000 - [5/4] - / - WordPress Brute Force - Running Bruteforce
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/http/wordpress_login_enum) > 

```

## Linked Issue

[https://github.com/rapid7/metasploit-framework/issues/14790#issue-81372544](https://github.com/rapid7/metasploit-framework/issues/14790#issue-813725448,"https://github.com/rapid7/metasploit-framework/issues/14790#issue-813725448")

Please remind me if any issue is found with the fix! ;-)
2021-03-12 00:02:11 +05:30
Spencer McIntyre b0239b34e3 Document the new java deserialization mixin methods 2021-03-11 12:09:29 -06:00
Spencer McIntyre 8d2e644f4f Add a new Java Deserialization mixin and use it to set the shell 2021-03-11 12:09:29 -06:00
zerosum0x0 fb393d8a36 add "Windows Storage Server 2008 R2" to fingerprints 2021-03-01 19:05:35 -07:00
dwelch-r7 319f15d938 Handle nil versions for rubygems 4 2021-02-25 16:47:49 +00:00
agalway-r7 275e9c5454 Land #14696, Further Zeitwerk lands to improve boot speed
Zeitwerk rex folder
2021-02-19 10:33:37 +00:00
Jeffrey Martin 2e1dba1af1 guard thread in ftp module 2021-02-17 15:27:44 -06:00
Jeffrey Martin 43ecfe5138 Land #14602, Fix length detection & enhance hex 2021-02-14 12:37:48 -06:00
Jeffrey Martin dbce3982fd Land #14067, [GSoC] Module for CVE-2019-13375, and PostgreSQL support for the library 2021-02-14 12:11:09 -06:00
Jeffrey Martin 7c4e42186d address merge conflict 2021-02-14 12:10:44 -06:00
dwelch-r7 b6eb940e46 Fix usage of Failure:: constant 2021-02-12 14:33:05 +00:00
dwelch-r7 7fbbe23426 Remove more requires that were missed before 2021-02-08 14:51:58 +00:00
dwelch-r7 b95be3ed10 Zeitwerk rex folder 2021-02-08 12:24:12 +00:00
dwelch-r7 8f83de865c Revert "Fix bug where vhost wasn't being set correctly when using rhost http url" 2021-02-01 16:33:18 +00:00
Grant Willcox 0fc8df31f2 Land #14609, Fix bug where vhost wasn't being set correctly when using rhost http url 2021-01-19 11:10:50 -06:00
Alan Foster 557623370e Fix broken ntlm message constants 2021-01-14 10:23:57 +00:00
dwelch-r7 2578d824db Fix bug where vhost wasn't being set correctly when using rhost http url 2021-01-13 14:41:45 +00:00
Niboucha Redouane 82874a5cf5 fix hex_encode_strings, encode empty strings before others (""||"a" would otherwise encode "||" before getting to empty strings) 2021-01-09 14:15:05 +01:00
Niboucha Redouane e63dd77b52 Handle empty strings when hex_encode_strings is true 2021-01-09 14:01:32 +01:00
Niboucha Redouane b9d9a8af5b Fix MySQLi timebasedblind output length detection 2021-01-09 14:00:25 +01:00
bwatters 54f5e565fa Land #14330, SpamTitan Gateway Remote Code Execution
Merge branch 'land-14330' into upstream-master
2021-01-04 12:14:12 -06:00
Christophe De La Fuente afea5cd74e Use opts['RHOST'] and opts['RPORT'] to creating the SNMP::Manager instance in connect_snmp 2020-12-16 15:15:27 +01:00
William Vu 9452c1dcfa Fix merge conflict from #14202, in linear history 2020-12-09 17:24:29 -06:00
Spencer McIntyre 90a99ae7c3 Land #14423, Expand wordpress_scanner to look for themes & plugins 2020-12-09 09:12:28 -05:00
h00die ac26d4d79b wordpress version update 2020-12-07 18:36:53 -05:00
dwelch-r7 1617b3ec9b Use zeitwerk for lib/msf/core folder 2020-12-07 10:31:45 +00:00
William Vu 010e110b8d Fix indentation
Whoops!
2020-12-07 01:35:13 -06:00
William Vu 6066ad47bd Remove unnecessary includes 2020-12-07 01:35:13 -06:00
William Vu e0561c03e9 Remove useless comment 2020-12-07 01:35:13 -06:00
William Vu 967f573b8d Refactor Msf::Exploit::Remote::SSH 2020-12-07 01:35:13 -06:00
Grant Willcox e26d6ca683 Land #14458, Add auxiliary support to autocheck mixin 2020-12-05 23:54:41 -06:00
Alan Foster 76e967353e Add auxiliary support to autocheck mixin 2020-12-03 01:09:06 +00:00
Spencer McIntyre f82ce5335d Support running local exploits from the meterpreter context 2020-12-01 15:22:48 -05:00
h00die a855a455ce wordpress version lib return plugin version 2020-11-22 07:52:00 -05:00
Alan Foster 79a3328cd3 Validate that AutoCheck is prepended 2020-11-11 22:15:40 +00:00
Spencer McIntyre a1561cff46 Add some additional error handling with more readable messages 2020-10-30 14:34:44 -04:00
Spencer McIntyre 17df870e74 Show the current NS server IP address when doing a transfer 2020-10-30 10:28:14 -04:00
Spencer McIntyre a312688391 Use the datastore nameservers when doing zone transfers when set 2020-10-29 17:52:18 -04:00
Spencer McIntyre 861879275e Land #14250, Fix how DNS enumeration displays AXFR results 2020-10-28 13:38:38 -04:00
Grant Willcox 1ad24fb5d0 Fix up dns_axfr function output so that we have start the output on a new line for better clarity 2020-10-28 09:41:19 -05:00
Grant Willcox ab7ed90457 Add in fixes from Spencer's review so we treat the zone object as an array not as a string, like we should have been doing 2020-10-27 15:20:29 -05:00
Niboucha Redouane 17c7c4fdbe Fix issues 2020-10-27 00:55:06 +01:00
William Vu 1a341ae931 Add SharePoint SSI and ViewState RCE
CVE-2020-16952
2020-10-14 17:45:15 -05:00
Grant Willcox d79537e88c Fix up the DNS enumeration library so that AXFR records don't have stray [ and ] characters printed in the output 2020-10-09 14:01:09 -05:00
Grant Willcox 5986bc98f1 Land #14171, Replace erroneous calls to get_service with calls to service 2020-09-30 10:05:13 -05:00
Shelby Pace 6c76442639 Land #14153, display SRVHOST SRVPORT opts w/auto 2020-09-24 11:12:08 -05:00
RageLtMan 2c83cde6a8 Add PSH generation methods to Util::Exe
MSIL generation was never added to util, and the pending rc4
generator should be accessible from here as well. Add both to the
end of the powershell generators section.

Add rc4 to the powershell method enum in opts which is passed
into rex-powershell.
2020-09-23 14:41:10 -05:00