Skip to content

auth_brute fix mixin: Add report_host (if service down) & report_service (auto, if service up)#21396

Open
g0tmi1k wants to merge 1 commit intorapid7:masterfrom
g0tmi1k:auth_brute_mixin
Open

auth_brute fix mixin: Add report_host (if service down) & report_service (auto, if service up)#21396
g0tmi1k wants to merge 1 commit intorapid7:masterfrom
g0tmi1k:auth_brute_mixin

Conversation

@g0tmi1k
Copy link
Copy Markdown
Contributor

@g0tmi1k g0tmi1k commented Apr 30, 2026

The idea of this PR to update the authbrute force mixin, so each module doesn't need to be udpated to support being able to detect if a host is up, but the service attacking isn't on the target.

Example:

  • 10.0.0.1 is attacker, without service.
  • 10.0.0.10 is target, with service.

Both now are in hosts, without having to update any modules. Doing it via mixin.

Before

$ ./msfconsole -q -x 'db_status; workspace -D;
setg VERBOSE true; setg RHOSTS 10.0.0.10; setg LHOST tap0;'
[*] Connected to msf. Connection type: postgresql.
[*] Deleted workspace: default
[*] Recreated the default workspace
VERBOSE => true
RHOSTS => 10.0.0.10
LHOST => tap0
msf > git checkout
[*] exec: git checkout

Your branch is up to date with 'origin/master'.
msf > use exec_login

Matching Modules
================

   #  Name                                     Disclosure Date  Rank    Check  Description
   -  ----                                     ---------------  ----    -----  -----------
   0  auxiliary/scanner/rservices/rexec_login  .                normal  No     rexec Authentication Scanner


Interact with a module by name or index. For example info 0, use 0 or use auxiliary/scanner/rservices/rexec_login

[*] Using auxiliary/scanner/rservices/rexec_login
msf auxiliary(scanner/rservices/rexec_login) > options

Module options (auxiliary/scanner/rservices/rexec_login):

   Name              Current Setting  Required  Description
   ----              ---------------  --------  -----------
   ANONYMOUS_LOGIN   false            yes       Attempt to login with a blank username and password
   BLANK_PASSWORDS   false            no        Try blank passwords for all users
   BRUTEFORCE_SPEED  5                yes       How fast to bruteforce, from 0 to 5
   CreateSession     true             no        Create a new session for every successful login
   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
   DB_SKIP_EXISTING  none             no        Skip existing credentials stored in the current database (Accepted: none, user, user&realm)
   ENABLE_STDERR     false            yes       Enables connecting the stderr port
   PASSWORD                           no        A specific password to authenticate with
   PASS_FILE                          no        File containing passwords, one per line
   RHOSTS            10.0.0.10        yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
   RPORT             512              yes       The target port (TCP)
   STDERR_PORT                        no        The port to listen on for stderr
   STOP_ON_SUCCESS   false            yes       Stop guessing when a credential works for a host
   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
   VERBOSE           true             yes       Whether to print output for all attempts


View the full module info with the info, or info -d command.

msf auxiliary(scanner/rservices/rexec_login) > set RHOST 10.0.0.1 10.0.0.10
RHOST => 10.0.0.1 10.0.0.10
msf auxiliary(scanner/rservices/rexec_login) > set USERNAME foo
USERNAME => foo
msf auxiliary(scanner/rservices/rexec_login) > set PASSWORD bar
PASSWORD => bar
msf auxiliary(scanner/rservices/rexec_login) > run
[*] 10.0.0.1:512          - 10.0.0.1:512 - Starting rexec sweep
[*] 10.0.0.1:512          - 10.0.0.1:512 - Attempting rexec with username:password 'foo':'bar'
[*] Scanned 1 of 2 hosts (50% complete)
[*] 10.0.0.10:512         - 10.0.0.10:512 - Starting rexec sweep
[*] 10.0.0.10:512         - 10.0.0.10:512 - Attempting rexec with username:password 'foo':'bar'
[-] 10.0.0.10:512         - 10.0.0.10:512         - [1/1] - Result: Where are you?
[*] Scanned 2 of 2 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(scanner/rservices/rexec_login) > workspace -v

Workspaces
==========

current  name     hosts  services  vulns  creds  loots  notes
-------  ----     -----  --------  -----  -----  -----  -----
*        default  1      1         0      0      0      0

msf auxiliary(scanner/rservices/rexec_login) > hosts

Hosts
=====

address    mac  name  os_name  os_flavor  os_sp  purpose  info  comments
-------    ---  ----  -------  ---------  -----  -------  ----  --------
10.0.0.10             Unknown                    device

msf auxiliary(scanner/rservices/rexec_login) > services
Services
========

host       port  proto  name  state  info  resource  parents
----       ----  -----  ----  -----  ----  --------  -------
10.0.0.10  512   tcp    exec  open         {}

msf auxiliary(scanner/rservices/rexec_login) >

After

$ ./msfconsole -q -x 'db_status; workspace -D;
setg VERBOSE true; setg RHOSTS 10.0.0.10; setg LHOST tap0;'
[*] Connected to msf. Connection type: postgresql.
[*] Deleted workspace: default
[*] Recreated the default workspace
VERBOSE => true
RHOSTS => 10.0.0.10
LHOST => tap0
msf > git checkout
[*] exec: git checkout

Your branch is up to date with 'origin/auth_brute_mixin'.
msf > use exec_login

Matching Modules
================

   #  Name                                     Disclosure Date  Rank    Check  Description
   -  ----                                     ---------------  ----    -----  -----------
   0  auxiliary/scanner/rservices/rexec_login  .                normal  No     rexec Authentication Scanner


Interact with a module by name or index. For example info 0, use 0 or use auxiliary/scanner/rservices/rexec_login

[*] Using auxiliary/scanner/rservices/rexec_login
msf auxiliary(scanner/rservices/rexec_login) > set RHOST 10.0.0.1 10.0.0.10
RHOST => 10.0.0.1 10.0.0.10
msf auxiliary(scanner/rservices/rexec_login) > set USERNAME foo
USERNAME => foo
msf auxiliary(scanner/rservices/rexec_login) > set PASSWORD bar
PASSWORD => bar
msf auxiliary(scanner/rservices/rexec_login) > options

Module options (auxiliary/scanner/rservices/rexec_login):

   Name              Current Setting     Required  Description
   ----              ---------------     --------  -----------
   ANONYMOUS_LOGIN   false               yes       Attempt to login with a blank username and password
   BLANK_PASSWORDS   false               no        Try blank passwords for all users
   BRUTEFORCE_SPEED  5                   yes       How fast to bruteforce, from 0 to 5
   CreateSession     true                no        Create a new session for every successful login
   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
   DB_SKIP_EXISTING  none                no        Skip existing credentials stored in the current database (Accepted: none, user, user&realm)
   ENABLE_STDERR     false               yes       Enables connecting the stderr port
   PASSWORD          bar                 no        A specific password to authenticate with
   PASS_FILE                             no        File containing passwords, one per line
   RHOSTS            10.0.0.1 10.0.0.10  yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
   RPORT             512                 yes       The target port (TCP)
   STDERR_PORT                           no        The port to listen on for stderr
   STOP_ON_SUCCESS   false               yes       Stop guessing when a credential works for a host
   THREADS           1                   yes       The number of concurrent threads (max one per host)
   USERNAME          foo                 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
   VERBOSE           true                yes       Whether to print output for all attempts


View the full module info with the info, or info -d command.

msf auxiliary(scanner/rservices/rexec_login) > run
[*] 10.0.0.1:512          - 10.0.0.1:512 - Starting rexec sweep
[*] 10.0.0.1:512          - 10.0.0.1:512 - Attempting rexec with username:password 'foo':'bar'
[-] 10.0.0.1:512          - 10.0.0.1:512          - [1/1] - Connection refused
[*] Scanned 1 of 2 hosts (50% complete)
[*] 10.0.0.10:512         - 10.0.0.10:512 - Starting rexec sweep
[*] 10.0.0.10:512         - 10.0.0.10:512 - Attempting rexec with username:password 'foo':'bar'
[-] 10.0.0.10:512         - 10.0.0.10:512         - [1/1] - Result: Where are you?
[*] Scanned 2 of 2 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(scanner/rservices/rexec_login) > workspace -v

Workspaces
==========

current  name     hosts  services  vulns  creds  loots  notes
-------  ----     -----  --------  -----  -----  -----  -----
*        default  2      1         0      0      0      0

msf auxiliary(scanner/rservices/rexec_login) > hosts

Hosts
=====

address    mac  name  os_name  os_flavor  os_sp  purpose  info  comments
-------    ---  ----  -------  ---------  -----  -------  ----  --------
10.0.0.1
10.0.0.10             Unknown                    device

msf auxiliary(scanner/rservices/rexec_login) > services
Services
========

host       port  proto  name  state  info  resource  parents
----       ----  -----  ----  -----  ----  --------  -------
10.0.0.10  512   tcp    exec  open         {}

msf auxiliary(scanner/rservices/rexec_login) >

@g0tmi1k g0tmi1k changed the title auth_brute: Add report_host & report_service auth_brute fix mixin: Add report_host (if service down) & report_service (auto, if service up) May 4, 2026
@g0tmi1k g0tmi1k force-pushed the auth_brute_mixin branch from 3b6b989 to 003f610 Compare May 5, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants