Skip to content

Commit

Permalink
Add session type to info hash in the mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-r7 committed Feb 11, 2024
1 parent 8f1b91c commit 448313e
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 19 deletions.
8 changes: 7 additions & 1 deletion lib/msf/core/optional_session/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down
7 changes: 6 additions & 1 deletion lib/msf/core/optional_session/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down
9 changes: 8 additions & 1 deletion lib/msf/core/optional_session/smb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down
2 changes: 1 addition & 1 deletion lib/msf_autoload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/admin/smb/delete_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def initialize
'mubix' # copied from hdm upload_file module
],
'License' => MSF_LICENSE,
'SessionTypes' => %w[SMB]
)

register_options([
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/admin/smb/download_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def initialize
'mubix' # copied from hdm upload_file module
],
'License' => MSF_LICENSE,
'SessionTypes' => %w[SMB]
)

register_options([
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/admin/smb/psexec_ntdsgrab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/admin/smb/upload_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def initialize
[
],
'License' => MSF_LICENSE,
'SessionTypes' => %w[SMB]
)

register_options([
Expand Down
3 changes: 1 addition & 2 deletions modules/auxiliary/gather/windows_secrets_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
)

Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/postgres/postgres_schemadump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/pipe_auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/pipe_dcerpc_auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/smb_enum_gpp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/smb_enumshares.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def initialize(info = {})
'DefaultOptions' => {
'DCERPC::fake_bind_multi' => false
},
'SessionTypes' => %w[SMB]
)
)

Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/smb_enumusers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def initialize
'DefaultOptions' => {
'DCERPC::fake_bind_multi' => false
},
'SessionTypes' => %w[SMB]
)

register_options(
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/smb_enumusers_domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion modules/auxiliary/scanner/smb/smb_lookupsid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def initialize
['DOMAIN', { 'Description' => 'Enumerate domain accounts' } ]
],
'DefaultAction' => 'LOCAL',
'SessionTypes' => %w[SMB]
)

register_options(
Expand Down
1 change: 0 additions & 1 deletion modules/exploits/windows/smb/psexec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
))
Expand Down

0 comments on commit 448313e

Please sign in to comment.