Commit Graph

8546 Commits

Author SHA1 Message Date
bwatters 2c1869f9df Land #14907, Add exploit for CVE-2021-1732
Merge branch 'land-14907' into upstream-master
2021-03-18 14:29:59 -05:00
Spencer McIntyre 0bff88c0c0 Update the module metadata and add module docs 2021-03-16 10:40:34 -04:00
Jeffrey Martin 83d757f0dd use ensure for cleanup
There exists a possibility that cleanup can be missed when an exploit raises
an exception other than `Interrupt` when run, by shifting the cleanup into
`ensure` for all exceptions when `keep_handler` is not set handlers and
other cleanup tasks from a module will be called for more possible error
states.
2021-03-15 17:17:09 -05:00
Spencer McIntyre 2e3d98a36a Move the DLL injection code into a reusable function 2021-03-15 11:47:02 -04:00
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
Jeffrey Martin da31abc7ee Land #14874i, Fix autoloading when using the rpc client 2021-03-11 15:08:27 -06:00
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
dwelch-r7 fce10b8b76 fix autoloading when using the rpc client 2021-03-11 16:42:34 +00:00
Grant Willcox 0b9cd7f6f4 Land #14816, Autoload faker to avoid potential missing constant errors 2021-03-03 15:59:18 -06:00
dwelch-r7 4755aea4b5 autoload faker globally 2021-03-02 13:49:38 +00: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
bwatters 7cdd41df76 Land #14544, RDP Web Login User Enumeration Auxiliary Module
Merge branch 'land-14544' into upstream-master
2021-02-24 16:10:41 -06:00
bwatters 18f6245637 Land #14648, Process Herpaderping evasion module
Merge branch 'land-14648' into upstream-master
2021-02-24 11:39:47 -06:00
dwelch-r7 6f2ba26917 Fix missing constant error when accessing the api web service 2021-02-24 12:28:46 +00:00
Tim W edea755096 Land #14740, CVE-2021-3156 Sudo LPE (AKA: Baron Samedit) Improvements 2021-02-22 17:48:33 +00:00
Grant Willcox 5c886d46bf Land #14748, Fix Auxiliary::AuthBrute when using DB_ALL_USERS and DB_ALL_PASS options 2021-02-22 11:43:55 -06:00
Grant Willcox 66c4388eda Land #14670, Enable word wrapped rex tables by default 2021-02-19 14:21:59 -06:00
dwelch-r7 3817ab9345 Land #14772, Extract module data store to its own file 2021-02-19 17:35:28 +00:00
Alan Foster f3ce9082b6 Enable word wrapped rex tables by default 2021-02-19 13:23:31 +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
Alan Foster 6a349dad75 Extract module data store to its own file 2021-02-19 10:29:50 +00:00
k0pak4 8affc0e91a Add in proper realm reporting cred abilities 2021-02-15 18:20:56 -05: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
adfoster-r7 30d24b5d88 Land #14747, Fix usage of Failure:: constant 2021-02-12 17:01:15 +00:00
dwelch-r7 f6c3de5732 Land #14733, Add latest Rubocop rules 2021-02-12 16:18:13 +00:00
Christophe De La Fuente cc1dde5ba8 Remove call to #creds in #build_credentials_array 2021-02-12 16:32:49 +01:00
dwelch-r7 b6eb940e46 Fix usage of Failure:: constant 2021-02-12 14:33:05 +00:00
Spencer McIntyre 20067d183e Use single quotes for escaping arguments consistently 2021-02-12 08:59:38 -05:00
Alan Foster bed7ae2c78 Add latest rubocop rules 2021-02-12 13:31:51 +00:00
Spencer McIntyre f31c7846d2 Escape shell arguments even more thoroughly 2021-02-11 12:25:28 -05:00
Spencer McIntyre 6562f309ce Handle whitespace in the target path 2021-02-10 17:40:42 -05:00
Spencer McIntyre 8757eb33fe Add an automatic target that uses version fingerprinting 2021-02-10 16:16:33 -05:00
Spencer McIntyre 7f17202194 Consistently handle existing directories in mkdir 2021-02-10 08:45:52 -05:00
firefart f9e8ac8f58 update more references 2021-02-08 17:48:54 +01:00
dwelch-r7 7fbbe23426 Remove more requires that were missed before 2021-02-08 14:51:58 +00:00
dwelch-r7 043d8efdbf Formatting 2021-02-08 12:49:31 +00:00
dwelch-r7 b95be3ed10 Zeitwerk rex folder 2021-02-08 12:24:12 +00:00
adfoster-r7 b3da14e66b Land #14669, ensure selected cracker is available and viable 2021-02-05 16:24:59 +00:00
Jeffrey Martin cce7dfb55f correction to error message grammar 2021-02-05 08:50:37 -06:00
dwelch-r7 4c43a8081a Land #14480, Improve handling of external modules when missing runtime dependencies 2021-02-05 13:51:11 +00:00
adfoster-r7 0b18de5a3d Land #14720, Fix missing vhost in rhost http url feature 2021-02-05 10:41:37 +00:00
dwelch-r7 3b8d87bdcb Fix missing vhost in rhost http url feature 2021-02-04 16:52:43 +00:00
Spencer McIntyre 7281d00938 Implement feedback from PR review 2021-02-04 09:25:40 -05:00