diff --git a/lib/rex/post/ldap/ui/console.rb b/lib/rex/post/ldap/ui/console.rb index 72145a3381b34..55efc2c453a05 100644 --- a/lib/rex/post/ldap/ui/console.rb +++ b/lib/rex/post/ldap/ui/console.rb @@ -85,7 +85,6 @@ def queue_cmd(cmd) # Runs the specified command wrapper in something to catch exceptions. # def run_command(dispatcher, method, arguments) - # TODO: double check these are the correct errors to handle super rescue Timeout::Error log_error('Operation timed out.') diff --git a/lib/rex/post/ldap/ui/console/command_dispatcher/client.rb b/lib/rex/post/ldap/ui/console/command_dispatcher/client.rb index 41fe110b50691..4529edb5c1901 100644 --- a/lib/rex/post/ldap/ui/console/command_dispatcher/client.rb +++ b/lib/rex/post/ldap/ui/console/command_dispatcher/client.rb @@ -6,7 +6,7 @@ module LDAP module Ui ### # - # Core SMB client commands + # Core LDAP client commands # ### class Console::CommandDispatcher::Client @@ -41,17 +41,18 @@ def commands end # - # Shares + # Client # def name 'Client' end + # # Query the LDAP server # def cmd_query(*args) if args.include?('-h') || args.include?('--help') - cmd_shares_help + cmd_query_help return end diff --git a/modules/auxiliary/scanner/ldap/ldap_login.rb b/modules/auxiliary/scanner/ldap/ldap_login.rb index 3ba7f540323c3..e9a7707273ee1 100644 --- a/modules/auxiliary/scanner/ldap/ldap_login.rb +++ b/modules/auxiliary/scanner/ldap/ldap_login.rb @@ -68,7 +68,9 @@ def run logins = results.flat_map { |_k, v| v[:successful_logins] } sessions = results.flat_map { |_k, v| v[:successful_sessions] } print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.") - if datastore['CreateSession'] + return results unless framework.features.enabled?(Msf::FeatureManager::LDAP_SESSION_TYPE) + + if create_session? print_status("#{sessions.size} LDAP #{sessions.size == 1 ? 'session was' : 'sessions were'} opened successfully.") else print_status('You can open an LDAP session with these credentials and %grnCreateSession%clr set to true') diff --git a/modules/auxiliary/scanner/mssql/mssql_login.rb b/modules/auxiliary/scanner/mssql/mssql_login.rb index 83e69d52977f7..859b78d9644d6 100644 --- a/modules/auxiliary/scanner/mssql/mssql_login.rb +++ b/modules/auxiliary/scanner/mssql/mssql_login.rb @@ -61,7 +61,9 @@ def run logins = results.flat_map { |_k, v| v[:successful_logins] } sessions = results.flat_map { |_k, v| v[:successful_sessions] } print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.") - if datastore['CreateSession'] + return results unless framework.features.enabled?(Msf::FeatureManager::MSSQL_SESSION_TYPE) + + if create_session? print_status("#{sessions.size} MSSQL #{sessions.size == 1 ? 'session was' : 'sessions were'} opened successfully.") else print_status('You can open an MSSQL session with these credentials and %grnCreateSession%clr set to true') diff --git a/modules/auxiliary/scanner/mysql/mysql_login.rb b/modules/auxiliary/scanner/mysql/mysql_login.rb index e1bc9ba44b360..cec15d727f4bc 100644 --- a/modules/auxiliary/scanner/mysql/mysql_login.rb +++ b/modules/auxiliary/scanner/mysql/mysql_login.rb @@ -65,7 +65,9 @@ def run logins = results.flat_map { |_k, v| v[:successful_logins] } sessions = results.flat_map { |_k, v| v[:successful_sessions] } print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.") - if datastore['CreateSession'] + return results unless framework.features.enabled?(Msf::FeatureManager::MYSQL_SESSION_TYPE) + + if create_session? print_status("#{sessions.size} MySQL #{sessions.size == 1 ? 'session was' : 'sessions were'} opened successfully.") else print_status('You can open an MySQL session with these credentials and %grnCreateSession%clr set to true') diff --git a/modules/auxiliary/scanner/postgres/postgres_login.rb b/modules/auxiliary/scanner/postgres/postgres_login.rb index f12706b4009cf..2ba18b8f0ff37 100644 --- a/modules/auxiliary/scanner/postgres/postgres_login.rb +++ b/modules/auxiliary/scanner/postgres/postgres_login.rb @@ -70,7 +70,9 @@ def run logins = results.flat_map { |_k, v| v[:successful_logins] } sessions = results.flat_map { |_k, v| v[:successful_sessions] } print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.") - if datastore['CreateSession'] + return results unless framework.features.enabled?(Msf::FeatureManager::POSTGRESQL_SESSION_TYPE) + + if create_session? print_status("#{sessions.size} Postgres #{sessions.size == 1 ? 'session was' : 'sessions were'} opened successfully.") else print_status('You can open a Postgres session with these credentials and %grnCreateSession%clr set to true') diff --git a/modules/auxiliary/scanner/smb/smb_login.rb b/modules/auxiliary/scanner/smb/smb_login.rb index a5fb6bd67b5b8..57056f9153c59 100644 --- a/modules/auxiliary/scanner/smb/smb_login.rb +++ b/modules/auxiliary/scanner/smb/smb_login.rb @@ -94,7 +94,9 @@ def run logins = results.flat_map { |_k, v| v[:successful_logins] } sessions = results.flat_map { |_k, v| v[:successful_sessions] } print_status("Bruteforce completed, #{logins.size} #{logins.size == 1 ? 'credential was' : 'credentials were'} successful.") - if datastore['CreateSession'] + return results unless framework.features.enabled?(Msf::FeatureManager::SMB_SESSION_TYPE) + + if create_session? print_status("#{sessions.size} SMB #{sessions.size == 1 ? 'session was' : 'sessions were'} opened successfully.") else print_status('You can open an SMB session with these credentials and %grnCreateSession%clr set to true')