diff --git a/lib/msf/core/optional_session/mysql.rb b/lib/msf/core/optional_session/mysql.rb index 699b8c29fed2a..f67c24b037209 100644 --- a/lib/msf/core/optional_session/mysql.rb +++ b/lib/msf/core/optional_session/mysql.rb @@ -6,7 +6,13 @@ module MySQL include Msf::OptionalSession def initialize(info = {}) - super + super( + update_info( + info, + 'SessionTypes' => %w[MySQL] + ) + ) + if framework.features.enabled?(Msf::FeatureManager::MYSQL_SESSION_TYPE) register_options( [ diff --git a/lib/msf/core/optional_session/postgresql.rb b/lib/msf/core/optional_session/postgresql.rb index 5695bbe8dfd55..b218dbdabb31a 100644 --- a/lib/msf/core/optional_session/postgresql.rb +++ b/lib/msf/core/optional_session/postgresql.rb @@ -6,7 +6,12 @@ module PostgreSQL include Msf::OptionalSession def initialize(info = {}) - super + super( + update_info( + info, + 'SessionTypes' => %w[PostgreSQL] + ) + ) if framework.features.enabled?(Msf::FeatureManager::POSTGRESQL_SESSION_TYPE) register_options( [ diff --git a/lib/msf/core/optional_session/smb.rb b/lib/msf/core/optional_session/smb.rb index 72919840b1379..6f94910b23619 100644 --- a/lib/msf/core/optional_session/smb.rb +++ b/lib/msf/core/optional_session/smb.rb @@ -6,7 +6,14 @@ module SMB include Msf::OptionalSession def initialize(info = {}) - super + super( + update_info( + info, + 'SessionTypes' => %w[SMB] + ) + ) + + if framework.features.enabled?(Msf::FeatureManager::SMB_SESSION_TYPE) register_options( [ diff --git a/lib/msf_autoload.rb b/lib/msf_autoload.rb index d17bd4ac2eeed..257eb0a4c57e7 100644 --- a/lib/msf_autoload.rb +++ b/lib/msf_autoload.rb @@ -36,7 +36,7 @@ def camelize(basename, abspath) elsif basename == 'ui' && abspath.end_with?("#{__dir__}/msf/core/module/ui", "#{__dir__}/msf/core/module/ui.rb", "#{__dir__}/rex/post/ui", "#{__dir__}/rex/post/ui.rb", "#{__dir__}/rex/post/meterpreter/extensions/stdapi/ui.rb") 'UI' elsif basename == 'mysql' && abspath.end_with?("#{__dir__}/msf/core/exploit/remote/mysql.rb") - 'MySQL' + 'MYSQL' elsif basename == 'ssh' && abspath.end_with?("#{__dir__}/rex/proto/ssh") 'Ssh' elsif basename == 'http' && abspath.end_with?("#{__dir__}/rex/proto/http") diff --git a/modules/auxiliary/admin/smb/delete_file.rb b/modules/auxiliary/admin/smb/delete_file.rb index 68da40cf4cf24..d1c564b681417 100644 --- a/modules/auxiliary/admin/smb/delete_file.rb +++ b/modules/auxiliary/admin/smb/delete_file.rb @@ -32,7 +32,6 @@ def initialize 'mubix' # copied from hdm upload_file module ], 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) register_options([ diff --git a/modules/auxiliary/admin/smb/download_file.rb b/modules/auxiliary/admin/smb/download_file.rb index e8bdb64a17e2e..7003ec8b35913 100644 --- a/modules/auxiliary/admin/smb/download_file.rb +++ b/modules/auxiliary/admin/smb/download_file.rb @@ -26,7 +26,6 @@ def initialize 'mubix' # copied from hdm upload_file module ], 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) register_options([ diff --git a/modules/auxiliary/admin/smb/psexec_ntdsgrab.rb b/modules/auxiliary/admin/smb/psexec_ntdsgrab.rb index 1d1be9e582656..4698746ebba6a 100644 --- a/modules/auxiliary/admin/smb/psexec_ntdsgrab.rb +++ b/modules/auxiliary/admin/smb/psexec_ntdsgrab.rb @@ -35,7 +35,6 @@ def initialize(info = {}) [ 'URL', 'http://sourceforge.net/projects/smbexec' ], [ 'URL', 'https://www.optiv.com/blog/owning-computers-without-shell-access' ] ], - 'SessionTypes' => %w[SMB] )) register_options([ diff --git a/modules/auxiliary/admin/smb/upload_file.rb b/modules/auxiliary/admin/smb/upload_file.rb index 139424aec9268..b4fb88a6bbe2c 100644 --- a/modules/auxiliary/admin/smb/upload_file.rb +++ b/modules/auxiliary/admin/smb/upload_file.rb @@ -30,7 +30,6 @@ def initialize [ ], 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) register_options([ diff --git a/modules/auxiliary/gather/windows_secrets_dump.rb b/modules/auxiliary/gather/windows_secrets_dump.rb index 57d828d773992..858a2bf977288 100644 --- a/modules/auxiliary/gather/windows_secrets_dump.rb +++ b/modules/auxiliary/gather/windows_secrets_dump.rb @@ -74,8 +74,7 @@ def initialize(info = {}) [ 'LSA', { 'Description' => 'Dump LSA secrets' } ], [ 'DOMAIN', { 'Description' => 'Dump domain secrets (credentials, password history, Kerberos keys, etc.)' } ] ], - 'DefaultAction' => 'ALL', - 'SessionTypes' => %w[SMB] + 'DefaultAction' => 'ALL' ) ) diff --git a/modules/auxiliary/scanner/postgres/postgres_schemadump.rb b/modules/auxiliary/scanner/postgres/postgres_schemadump.rb index 76739fffd164b..15a6b2f1ef780 100644 --- a/modules/auxiliary/scanner/postgres/postgres_schemadump.rb +++ b/modules/auxiliary/scanner/postgres/postgres_schemadump.rb @@ -18,7 +18,6 @@ def initialize ), 'Author' => ['theLightCosine'], 'License' => MSF_LICENSE, - 'SessionTypes' => %w[PostgreSQL] ) register_options([ OptBool.new('DISPLAY_RESULTS', [true, 'Display the Results to the Screen', true]), diff --git a/modules/auxiliary/scanner/smb/pipe_auditor.rb b/modules/auxiliary/scanner/smb/pipe_auditor.rb index 42dd86b887188..3e235d4887e19 100644 --- a/modules/auxiliary/scanner/smb/pipe_auditor.rb +++ b/modules/auxiliary/scanner/smb/pipe_auditor.rb @@ -22,7 +22,6 @@ def initialize 'Description' => 'Determine what named pipes are accessible over SMB', 'Author' => 'hdm', 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) deregister_options('RPORT', 'SMBDirect') diff --git a/modules/auxiliary/scanner/smb/pipe_dcerpc_auditor.rb b/modules/auxiliary/scanner/smb/pipe_dcerpc_auditor.rb index b65cb58d74d22..33c77357cacab 100644 --- a/modules/auxiliary/scanner/smb/pipe_dcerpc_auditor.rb +++ b/modules/auxiliary/scanner/smb/pipe_dcerpc_auditor.rb @@ -22,7 +22,6 @@ def initialize 'Description' => 'Determine what DCERPC services are accessible over a SMB pipe', 'Author' => 'hdm', 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) deregister_options('RPORT') diff --git a/modules/auxiliary/scanner/smb/smb_enum_gpp.rb b/modules/auxiliary/scanner/smb/smb_enum_gpp.rb index 59aa167c20e7c..920db641e097f 100644 --- a/modules/auxiliary/scanner/smb/smb_enum_gpp.rb +++ b/modules/auxiliary/scanner/smb/smb_enum_gpp.rb @@ -38,7 +38,6 @@ def initialize ['URL', 'https://labs.portcullis.co.uk/blog/are-you-considering-using-microsoft-group-policy-preferences-think-again/'] ], 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) register_options([ OptString.new('SMBSHARE', [true, 'The name of the share on the server', 'SYSVOL']), diff --git a/modules/auxiliary/scanner/smb/smb_enumshares.rb b/modules/auxiliary/scanner/smb/smb_enumshares.rb index e966ababa8f17..27f8192758432 100644 --- a/modules/auxiliary/scanner/smb/smb_enumshares.rb +++ b/modules/auxiliary/scanner/smb/smb_enumshares.rb @@ -41,7 +41,6 @@ def initialize(info = {}) 'DefaultOptions' => { 'DCERPC::fake_bind_multi' => false }, - 'SessionTypes' => %w[SMB] ) ) diff --git a/modules/auxiliary/scanner/smb/smb_enumusers.rb b/modules/auxiliary/scanner/smb/smb_enumusers.rb index 2ff5bc74a2fca..13b55fcd6940e 100644 --- a/modules/auxiliary/scanner/smb/smb_enumusers.rb +++ b/modules/auxiliary/scanner/smb/smb_enumusers.rb @@ -26,7 +26,6 @@ def initialize 'DefaultOptions' => { 'DCERPC::fake_bind_multi' => false }, - 'SessionTypes' => %w[SMB] ) register_options( diff --git a/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb b/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb index 675813f3ab7cc..86376844cadd6 100644 --- a/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb +++ b/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb @@ -30,7 +30,6 @@ def initialize [ 'URL', 'https://docs.microsoft.com/en-us/windows/win32/api/lmwksta/nf-lmwksta-netwkstauserenum' ] ], 'License' => MSF_LICENSE, - 'SessionTypes' => %w[SMB] ) deregister_options('RPORT') diff --git a/modules/auxiliary/scanner/smb/smb_lookupsid.rb b/modules/auxiliary/scanner/smb/smb_lookupsid.rb index 18378cf5322ca..4637532bc32c9 100644 --- a/modules/auxiliary/scanner/smb/smb_lookupsid.rb +++ b/modules/auxiliary/scanner/smb/smb_lookupsid.rb @@ -37,7 +37,6 @@ def initialize ['DOMAIN', { 'Description' => 'Enumerate domain accounts' } ] ], 'DefaultAction' => 'LOCAL', - 'SessionTypes' => %w[SMB] ) register_options( diff --git a/modules/exploits/windows/smb/psexec.rb b/modules/exploits/windows/smb/psexec.rb index 5fad4002c949b..1b79c4fffb2b5 100644 --- a/modules/exploits/windows/smb/psexec.rb +++ b/modules/exploits/windows/smb/psexec.rb @@ -69,7 +69,6 @@ def initialize(info = {}) [ 'Command', { 'Arch' => [ARCH_CMD], 'Payload' => { 'Space' => 8191 } } ] ], 'DefaultTarget' => 0, - 'SessionTypes' => %w[SMB], # For the CVE, PsExec was first released around February or March 2001 'DisclosureDate' => '1999-01-01' ))