-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Land #18770, Extract SMB, PostgreSQL, MySQL and MSSQL optional sessio…
…ns into their own mixins
- Loading branch information
Showing
57 changed files
with
213 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def type | |
# @return [String] The type of the session | ||
# | ||
def self.type | ||
'PostgreSQL' | ||
'postgresql' | ||
end | ||
|
||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def type | |
# Returns the type of session. | ||
# | ||
def self.type | ||
'SMB' | ||
'smb' | ||
end | ||
|
||
def self.can_cleanup_files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
module Msf | ||
module OptionalSession | ||
module MSSQL | ||
include Msf::OptionalSession | ||
|
||
def initialize(info = {}) | ||
super( | ||
update_info( | ||
info, | ||
'SessionTypes' => %w[mssql] | ||
) | ||
) | ||
|
||
if framework.features.enabled?(Msf::FeatureManager::MSSQL_SESSION_TYPE) | ||
register_options( | ||
[ | ||
Msf::OptInt.new('SESSION', [ false, 'The session to run this module on' ]), | ||
Msf::OptString.new('DATABASE', [ false, 'The database to authenticate against', 'MSSQL']), | ||
Msf::OptString.new('USERNAME', [ false, 'The username to authenticate as', 'MSSQL']), | ||
Msf::Opt::RHOST(nil, false), | ||
Msf::Opt::RPORT(1433, false) | ||
] | ||
) | ||
add_info('New in Metasploit 6.4 - This module can target a %grnSESSION%clr or an %grnRHOST%clr') | ||
end | ||
end | ||
|
||
def session | ||
return nil unless framework.features.enabled?(Msf::FeatureManager::MSSQL_SESSION_TYPE) | ||
|
||
super | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module Msf | ||
module OptionalSession | ||
module MySQL | ||
include Msf::OptionalSession | ||
|
||
def initialize(info = {}) | ||
super( | ||
update_info( | ||
info, | ||
'SessionTypes' => %w[mysql] | ||
) | ||
) | ||
|
||
if framework.features.enabled?(Msf::FeatureManager::MYSQL_SESSION_TYPE) | ||
register_options( | ||
[ | ||
Msf::OptInt.new('SESSION', [ false, 'The session to run this module on' ]), | ||
Msf::Opt::RHOST(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') | ||
|
||
end | ||
end | ||
|
||
def session | ||
return nil unless framework.features.enabled?(Msf::FeatureManager::MYSQL_SESSION_TYPE) | ||
|
||
super | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module Msf | ||
module OptionalSession | ||
module PostgreSQL | ||
include Msf::OptionalSession | ||
|
||
def initialize(info = {}) | ||
super( | ||
update_info( | ||
info, | ||
'SessionTypes' => %w[postgresql] | ||
) | ||
) | ||
if framework.features.enabled?(Msf::FeatureManager::POSTGRESQL_SESSION_TYPE) | ||
register_options( | ||
[ | ||
Msf::OptInt.new('SESSION', [ false, 'The session to run this module on' ]), | ||
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(5432, false) | ||
] | ||
) | ||
add_info('New in Metasploit 6.4 - This module can target a %grnSESSION%clr or an %grnRHOST%clr') | ||
end | ||
end | ||
|
||
def session | ||
return nil unless framework.features.enabled?(Msf::FeatureManager::POSTGRESQL_SESSION_TYPE) | ||
|
||
super | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module Msf | ||
module OptionalSession | ||
module SMB | ||
include Msf::OptionalSession | ||
|
||
def initialize(info = {}) | ||
super( | ||
update_info( | ||
info, | ||
'SessionTypes' => %w[smb] | ||
) | ||
) | ||
|
||
|
||
if framework.features.enabled?(Msf::FeatureManager::SMB_SESSION_TYPE) | ||
register_options( | ||
[ | ||
Msf::OptInt.new('SESSION', [ false, 'The session to run this module on' ]), | ||
Msf::Opt::RHOST(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') | ||
end | ||
end | ||
|
||
def session | ||
return nil unless framework.features.enabled?(Msf::FeatureManager::SMB_SESSION_TYPE) | ||
|
||
super | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.