Files
metasploit-gs/lib/msf/core/exploit/remote/ssh.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.0 KiB
Ruby
Raw Normal View History

2019-06-02 17:11:37 -05:00
# -*- coding: binary -*-
# Require most things so that modules using this will "just work"
require 'net/ssh'
require 'net/ssh/command_stream'
require 'rex/socket/ssh_factory'
2020-12-06 01:35:10 -06:00
# Patch in our custom auth methods:
# fortinet-backdoor
# libssh-auth-bypass
# malformed-packet
require 'msf/core/exploit/remote/ssh/auth_methods'
2018-09-05 23:10:28 -05:00
module Msf::Exploit::Remote::SSH
2019-06-02 17:11:37 -05:00
# Register SSH datastore options:
2019-06-02 18:26:25 -05:00
# SSH_IDENT (TODO: Refactor to SSHIdent)
2019-06-02 17:11:37 -05:00
# SSH_TIMEOUT (TODO: Refactor to SSHTimeout)
# SSH_DEBUG (TODO: Refactor to SSHDebug)
include Msf::Exploit::Remote::SSH::Options
2018-09-05 23:10:28 -05:00
2019-06-02 17:11:37 -05:00
def ssh_socket_factory
2022-03-25 16:32:58 +01:00
unless defined? datastore
2022-03-24 22:57:27 +01:00
return Rex::Socket::SSHFactory.new(framework, self, proxies)
end
2019-06-02 17:11:37 -05:00
Rex::Socket::SSHFactory.new(framework, self, datastore['Proxies'])
end
2020-11-30 16:17:17 -06:00
def ssh_client_defaults
{
non_interactive: true,
config: false,
use_agent: false,
verify_host_key: :never,
proxy: ssh_socket_factory,
append_all_supported_algorithms: true
2020-11-30 16:17:17 -06:00
}
end
2016-07-19 16:37:19 -05:00
end