Skip to content
Permalink
Browse files

Land #12024, add gatherproof to ssh_login modules

  • Loading branch information...
h00die committed Jul 10, 2019
2 parents c1c600c + dc81adb commit 9274b1d259c6e07e929f33addfc645cd424546db
@@ -39,6 +39,9 @@ class SSH
#
# @return [Symbol] An element of {VERBOSITIES}.
attr_accessor :verbosity
# @!attribute skip_gather_proof
# @return [Boolean] Whether to skip calling gather_proof
attr_accessor :skip_gather_proof

validates :verbosity,
presence: true,
@@ -90,7 +93,7 @@ def attempt_login(credential)

unless result_options.has_key? :status
if ssh_socket
proof = gather_proof
proof = gather_proof unless skip_gather_proof
result_options.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL, proof: proof)
else
result_options.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: nil)
@@ -42,8 +42,9 @@ def initialize
register_advanced_options(
[
Opt::Proxies,
OptBool.new('SSH_DEBUG', [ false, 'Enable SSH debugging output (Extreme verbosity!)', false]),
OptInt.new('SSH_TIMEOUT', [ false, 'Specify the maximum time to negotiate a SSH session', 30])
OptBool.new('SSH_DEBUG', [false, 'Enable SSH debugging output (Extreme verbosity!)', false]),
OptInt.new('SSH_TIMEOUT', [false, 'Specify the maximum time to negotiate a SSH session', 30]),
OptBool.new('GatherProof', [true, 'Gather proof of access via pre-session shell commands', false])
]
)

@@ -112,6 +113,7 @@ def run_host(ip)
connection_timeout: datastore['SSH_TIMEOUT'],
framework: framework,
framework_module: self,
skip_gather_proof: !datastore['GatherProof']
)

scanner.verbosity = :debug if datastore['SSH_DEBUG']
@@ -47,9 +47,10 @@ def initialize
register_advanced_options(
[
Opt::Proxies,
OptBool.new('SSH_DEBUG', [ false, 'Enable SSH debugging output (Extreme verbosity!)', false]),
OptBool.new('SSH_DEBUG', [false, 'Enable SSH debugging output (Extreme verbosity!)', false]),
OptString.new('SSH_KEYFILE_B64', [false, 'Raw data of an unencrypted SSH public key. This should be used by programmatic interfaces to this module only.', '']),
OptInt.new('SSH_TIMEOUT', [ false, 'Specify the maximum time to negotiate a SSH session', 30])
OptInt.new('SSH_TIMEOUT', [false, 'Specify the maximum time to negotiate a SSH session', 30]),
OptBool.new('GatherProof', [true, 'Gather proof of access via pre-session shell commands', false])
]
)

@@ -134,6 +135,7 @@ def run_host(ip)
connection_timeout: datastore['SSH_TIMEOUT'],
framework: framework,
framework_module: self,
skip_gather_proof: !datastore['GatherProof']
)

scanner.verbosity = :debug if datastore['SSH_DEBUG']

0 comments on commit 9274b1d

Please sign in to comment.
You can’t perform that action at this time.