Skip to content

Commit

Permalink
Use mssql option session mixin with mssql modules
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-r7 committed Feb 14, 2024
1 parent 587a869 commit 0d4e1ed
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 18 deletions.
8 changes: 7 additions & 1 deletion lib/msf/core/optional_session/mssql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ module MSSQL
include Msf::OptionalSession

def initialize(info = {})
super
super(
update_info(
info,
'SessionTypes' => %w[MSSQL]
)
)

if framework.features.enabled?(Msf::FeatureManager::MSSQL_SESSION_TYPE)
register_options(
[
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/core/optional_session/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(info = {})
super(
update_info(
info,
'SessionTypes' => %w[MySQL]
'SessionTypes' => %w[mysql]
)
)

Expand All @@ -18,7 +18,7 @@ def initialize(info = {})
[
Msf::OptInt.new('SESSION', [ false, 'The session to run this module on' ]),
Msf::Opt::RHOST(nil, false),
Msf::Opt::RPORT(nil, false)
Msf::Opt::RPORT(3306, false)
]
)
add_info('New in Metasploit 6.4 - This module can target a %grnSESSION%clr or an %grnRHOST%clr')
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/core/optional_session/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(info = {})
super(
update_info(
info,
'SessionTypes' => %w[PostgreSQL]
'SessionTypes' => %w[postgresql]
)
)
if framework.features.enabled?(Msf::FeatureManager::POSTGRESQL_SESSION_TYPE)
Expand All @@ -19,7 +19,7 @@ def initialize(info = {})
Msf::OptString.new('DATABASE', [ false, 'The database to authenticate against', 'postgres']),
Msf::OptString.new('USERNAME', [ false, 'The username to authenticate as', 'postgres']),
Msf::Opt::RHOST(nil, false),
Msf::Opt::RPORT(nil, false)
Msf::Opt::RPORT(5432, false)
]
)
add_info('New in Metasploit 6.4 - This module can target a %grnSESSION%clr or an %grnRHOST%clr')
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/core/optional_session/smb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(info = {})
super(
update_info(
info,
'SessionTypes' => %w[SMB]
'SessionTypes' => %w[smb]
)
)

Expand All @@ -19,7 +19,7 @@ def initialize(info = {})
[
Msf::OptInt.new('SESSION', [ false, 'The session to run this module on' ]),
Msf::Opt::RHOST(nil, false),
Msf::Opt::RPORT(nil, false)
Msf::Opt::RPORT(443, false)
]
)
add_info('New in Metasploit 6.4 - This module can target a %grnSESSION%clr or an %grnRHOST%clr')
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::Auxiliary::Report
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_escalate_dbowner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_escalate_execute_as.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_findandsampledata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_idf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/admin/mssql/mssql_sql_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize(info = {})
super(update_info(info,
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/scanner/mssql/mssql_hashdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize
super(
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/scanner/mssql/mssql_schemadump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL

def initialize
super(
Expand Down
2 changes: 1 addition & 1 deletion modules/exploits/windows/mssql/mssql_payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MetasploitModule < Msf::Exploit::Remote

include Msf::Exploit::Remote::MSSQL
include Msf::Exploit::CmdStager
include Msf::OptionalSession
include Msf::OptionalSession::MSSQL
#include Msf::Exploit::CmdStagerDebugAsm
#include Msf::Exploit::CmdStagerDebugWrite
#include Msf::Exploit::CmdStagerTFTP
Expand Down

0 comments on commit 0d4e1ed

Please sign in to comment.