Skip to content

Commit

Permalink
Move CreateSession from advanced into basic options
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranleese-r7 committed Feb 6, 2024
1 parent b72d8d1 commit 09b4e2c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/msf/base/sessions/command_shell_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ module CommandShellOptions
def initialize(info = {})
super(info)

register_options(
[
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', true])
]
)

register_advanced_options(
[
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', true]),
OptString.new('InitialAutoRunScript', "An initial script to run on session creation (before AutoRunScript)"),
OptString.new('AutoRunScript', "A script to run automatically on session creation."),
OptString.new('CommandShellCleanupCommand', "A command to run before the session is closed"),
Expand Down
3 changes: 2 additions & 1 deletion modules/auxiliary/scanner/mssql/mssql_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::MSSQL
include Msf::Auxiliary::Report
include Msf::Auxiliary::AuthBrute

include Msf::Auxiliary::CommandShell
include Msf::Auxiliary::Scanner

def initialize
Expand All @@ -33,6 +33,7 @@ def initialize
)
register_options([
OptBool.new('TDSENCRYPTION', [ true, 'Use TLS/SSL for TDS data "Force Encryption"', true]),
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', false])
])

deregister_options('PASSWORD_SPRAY')
Expand Down
3 changes: 2 additions & 1 deletion modules/auxiliary/scanner/mysql/mysql_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def initialize(info = {})

register_options(
[
Opt::Proxies
Opt::Proxies,
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', false])
])

options_to_deregister = %w[PASSWORD_SPRAY]
Expand Down
1 change: 1 addition & 0 deletions modules/auxiliary/scanner/postgres/postgres_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def initialize(info = {})
register_options(
[
Opt::Proxies,
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', false]),
OptPath.new('USERPASS_FILE', [ false, "File containing (space-separated) users and passwords, one pair per line",
File.join(Msf::Config.data_directory, "wordlists", "postgres_default_userpass.txt") ]),
OptPath.new('USER_FILE', [ false, "File containing users, one per line",
Expand Down
1 change: 1 addition & 0 deletions modules/auxiliary/scanner/smb/smb_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def initialize
register_options(
[
Opt::Proxies,
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', false]),
OptBool.new('ABORT_ON_LOCKOUT', [ true, 'Abort the run when an account lockout is detected', false ]),
OptBool.new('PRESERVE_DOMAINS', [ false, 'Respect a username that contains a domain name.', true ]),
OptBool.new('RECORD_GUEST', [ false, 'Record guest-privileged random logins to the database', false ]),
Expand Down

0 comments on commit 09b4e2c

Please sign in to comment.