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 2, 2024
1 parent 557b9ec commit 4bf4cc7
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 16 deletions.
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
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
1 change: 0 additions & 1 deletion modules/auxiliary/gather/windows_secrets_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def initialize(info = {})
[ 'DOMAIN', { 'Description' => 'Dump domain secrets (credentials, password history, Kerberos keys, etc.)' } ]
],
'DefaultAction' => 'ALL',
'SessionTypes' => %w[SMB]
)
)

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 4bf4cc7

Please sign in to comment.