Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default username to my/mssql login #12892

Merged
merged 2 commits into from
Feb 16, 2020
Merged

add default username to my/mssql login #12892

merged 2 commits into from
Feb 16, 2020

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Jan 30, 2020

Fixes #12891
Adds default username field (as per module info) to mysql and mssql login fields.

Verification

  • Start msfconsole
  • use auxiliary/scanner/mssql/mssql_login
  • Verify username is 'sa' by defeault
  • use auxiliary/scanner/mysql/mysql_login
  • Verify username is 'root' by defeault

@digininja can you test this out?

@digininja
Copy link
Contributor

Closer, but not quite:

msf5 auxiliary(scanner/mssql/mssql_login) > show options

Module options (auxiliary/scanner/mssql/mssql_login):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   BLANK_PASSWORDS      false            no        Try blank passwords for all users
   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
   PASSWORD                              no        A specific password to authenticate with
   PASS_FILE                             no        File containing passwords, one per line
   RHOSTS                                yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT                1433             yes       The target port (TCP)
   STOP_ON_SUCCESS      false            yes       Stop guessing when a credential works for a host
   TDSENCRYPTION        false            yes       Use TLS/SSL for TDS data "Force Encryption"
   THREADS              1                yes       The number of concurrent threads (max one per host)
   USERNAME             sa               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
   USE_WINDOWS_AUTHENT  false            yes       Use windows authentification (requires DOMAIN option set)
   VERBOSE              true             yes       Whether to print output for all attempts

msf5 auxiliary(scanner/mssql/mssql_login) > set RHOSTS 1.2.3.4.
RHOSTS => 1.2.3.4
msf5 auxiliary(scanner/mssql/mssql_login) > run

[*] 1.2.3.4:1433    - 1.2.3.4:1433 - MSSQL - Starting authentication scanner.
[*] 1.2.3.4:1433    - Error: 1.2.3.4: Metasploit::Framework::LoginScanner::Invalid Cred details can't be blank, Cred details can't be blank (Metasploit::Framework::LoginScanner::MSSQL)
[*] 1.2.3.4:1433    - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

The problem is that it doesn't like a blank password as a default if BLANK_PASSWORDS is set to false which it is by default. I realised that what I did last time was to set USER_AS_PASS to true which would have given it a password to test.

So I guess either BLANK_PASSWORDS needs setting true by default, or you need to populate the PASSWORD field with something and then change the description.

@wvu wvu changed the title add default un to my/mssql login add default username to my/mssql login Feb 3, 2020
@space-r7 space-r7 added the bug label Feb 3, 2020
@h00die
Copy link
Contributor Author

h00die commented Feb 8, 2020

@digininja 2nd time's the charm! Tested against mysql, worked fine.
Also, setting default options is prob WAY more preferred than overwriting imports.

@bcoles bcoles self-assigned this Feb 16, 2020
bcoles added a commit that referenced this pull request Feb 16, 2020
Set default username `sa` for auxiliary/scanner/mssql/mssql_login
Set default username `root` for auxiliary/scanner/mysql/mysql_login

Enable `BLANK_PASSWORDS` option by default for both modules,
as the default users make use of a blank password in by default.
@bcoles bcoles merged commit 3707d4c into rapid7:master Feb 16, 2020
@bcoles
Copy link
Contributor

bcoles commented Feb 16, 2020

Release Notes

Set default username sa for auxiliary/scanner/mssql/mssql_login
Set default username root for auxiliary/scanner/mysql/mysql_login

Enable BLANK_PASSWORDS option by default for both modules,
as the default users make use of a default blank password.

@h00die h00die deleted the 12891 branch February 16, 2020 14:10
@bcoles bcoles added the rn-fix release notes fix label Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auxiliary/scanner/mysql/mysql_login missing default username or incorrect description
4 participants